The output of count.txt when $NUMBER is 6:
02
03
04
05
06
And here is the ultimate goal of all the counting (the output of the disk adding script I wrote is below) NOTE: I commented out the actual lines that add the disks, so there will be a few errors below due to the fact that it is not actually adding disks, but only printing the commands to screen.:
Code:
This script is only to be used when building NEW DISK GROUPS ONLY!!
that will be using VXVM 4.1 or higher to manage disks, with no rootdg.
This version is an option for striping.
Have you ran the inq script?
Enter 'y' for Yes or 'n' for No :y
Chose the type of external storage
you will be working with. Your choices
are 'EMC' and 'EVA' (EVA = HSV).
Enter 'EMC' or 'EVA'. Disk type? :eva
Disk sizes that are available are:
524288000
What size disk do you want to use?
Disk size? :524288000
There are 11 HSV disks of this size available.
How many do you want to use(20 disks max!)
to create your diskgroup? :6
What will the name of y our diskgroup?
Ensure that the name of your diskgroup
ends with 'dg', or there will be problems!!!
For example(s).. 'datadg'...or 'p1vma1c1dg'.
Diskgroup Name :fakedg
vxdg init fakedg fakedg01=c10t0d6
vxdg -g fakedg adddisk fakedg02=c10t0d7
vxdg -g fakedg adddisk fakedg03=c10t1d0
vxdg -g fakedg adddisk fakedg04=c10t1d1
vxdg -g fakedg adddisk fakedg05=c10t1d2
vxdg -g fakedg adddisk fakedg06=c10t1d3
Are you ready to create a lvol in fakedg?
Enter 'y' for Yes or 'n' for No :y
Enter the name of your lvol.
Lvol name :fakelvol
Enter the size of your lvol.
The maximum size is: -1149269920 or -1096G <-- Wrong value is due to a bug in the script when I use 5 or more disks...
Lvol size :2G
Enter the block size of your lvol.
Lvol block size :8192
Do you need to do any striping?
Enter 'y' for Yes or 'n' for No :y
What is the size of your strpewidth?
Stripewidth size :128
What is the number of disks that will be striped across?
NOTE: You just created diskgroup fakedg with 6 disks.
Enter a value for 'nstripe' :6
vxassist -g fakedg make fakelvol 2G fakedg01 fakedg02 fakedg03 fakedg04 fakedg05 fakedg06 layout=stripe nstripe=6 stripewidth=128
mkfs -F vxfs -o largefiles -o bsize=8192 /dev/vx/dsk/fakedg/fakelvol
VxVM vxassist ERROR V-5-1-607 Diskgroup fakedg not found
VxVM vxassist ERROR V-5-1-607 Diskgroup fakedg not found
This is how much space you have left in the diskgroup fakedg:
<Nothing listed here, because script is not actually executing the commands>
This is the max size your lvol can be:
<Nothing listed here, because script is not actually executing the commands>
Do you want to max out the size of your lvol?
Enter 'y' for Yes or 'n' for No :n
Last edited by LinuxRacr; 02-26-2008 at 08:15 PM..
because, you can do you lv stuff while inside the loop. In this case, I touch'ed files to create/put timestamp. See the following as output from execution
Code:
> alpha1
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma02
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma03
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma04
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma05
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma06
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma07
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma08
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma09
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma10
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma11
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma12
-rw-rw---- 1 jgillis dp 0 Feb 26 11:08 p1vma13
The %.2d says to format for two digits, thus can allocate from device _02 to _99. If you want to be able to go past this, simply change the script to %.3d before you execute. (Your example seemed to skip over the possibility of a _01 device.)
However, I would find it unusual to think you would be configuring more than 99 devices.
Before implementing this or any other suggestions, strongly recommend 'trial runs' where you do not execute the commands, but display/print the commands you are about to run.
The %.2d says to format for two digits, thus can allocate from device _02 to _99. If you want to be able to go past this, simply change the script to %.3d before you execute. (Your example seemed to skip over the possibility of a _01 device.)
However, I would find it unusual to think you would be configuring more than 99 devices.
Before implementing this or any other suggestions, strongly recommend 'trial runs' where you do not execute the commands, but display/print the commands you are about to run.
I totally agree. The output above from the script are just the commands echoed to screen. This clarifies a couple of things. Thanks for your replies!
Ok, so this is how I ended up using it in my script. Of course I had to change a couple of other things to make it work but it works great!!!
Code:
## Increment the disk counter based on $NUMBER, and output to disks3.txt
> disks3.txt
CURRENT=0
while [ $CURRENT -le $NUMBER ]
do
if [ $CURRENT -gt 1 ]
then
lv_val=$(printf "%.2d" $CURRENT)
##Capture disk names, all except the first disk in the disk group
echo ${DISKGROUP}$lv_val >> disks3.txt
fi
CURRENT=$(($CURRENT + 1))
done
Hello all,
I need help making a script run faster since I have a huge file to sift through. The file I am running my script on looks like this:
1 -1.9E+001 -1.8E-001 1.5E+001 3.32E+001
2 -1.7E+001 -1.0E-002 1.2E+001 6.37E+001
3 -1.5E+001 -3.8E-006 6.7E+001 4.81E+001
The... (12 Replies)
hi
i am writing a korn shell script to compile all programs there are arount 2000+ files now i have a script that can compile programs but i want to show status of compilation because to compile all programs it takes around 10-15 mins so how can i display status like it should print no of files... (3 Replies)