4. Volume Lession1: No Frills Volumes

In our first lession we'll build a very simple volume. Let's make a 4G volume name "simplevol". The syntax for this creation will look like this:

vxassist -g <diskgroup> -U <usagetype> make <volname> <size>

We discused the use of "-g" earlier. The "-U" can specify two types of usage: gen and fsgen. In effect, "gen" is a raw volume (charrector device only) and "fsgen" is a regular volume (charrector and block device). The only times I see people use "gen" type volumes is in coorlation with large database systems which sometimes use raw volumes rather than filesystems. We'll use the type "fsgen" for this course. The directive "make" tells vxassist that we want to make a volume. The "volname" is the name we want to give to the volume we're creating and "size" is the size of the volume to build. Size can be specified in the following forms: 1, 1m, 1g. That would be: 1 sector (512KB), 1 megabyte, and 1 gigabyte.

Now that we know the syntax, let's build it:

# vxassist -g cuddledg -U fsgen make simplevol 4g
# vxprint -g cuddledg -hrt
DG NAME         NCONFIG      NLOG     MINORS   GROUP-ID
DM NAME         DEVICE       TYPE     PRIVLEN  PUBLEN   STATE
V  NAME         USETYPE      KSTATE   STATE    LENGTH   READPOL   PREFPLEX
PL NAME         VOLUME       KSTATE   STATE    LENGTH   LAYOUT    NCOL/WID MODE
SD NAME         PLEX         DISK     DISKOFFS LENGTH   [COL/]OFF DEVICE   MODE
SV NAME         PLEX         VOLNAME  NVOLLAYR LENGTH   [COL/]OFF AM/NM    MODE

dg cuddledg     default      default  10000    1029129226.1248.gaff

dm cuddle-f0    c1t0d0s2     sliced   3590     17678493 -
dm cuddle-f1    c1t1d0s2     sliced   3590     17678493 -
dm cuddle-f2    c1t2d0s2     sliced   3590     17678493 -
dm cuddle-f3    c1t3d0s2     sliced   3590     17678493 -
dm cuddle-f4    c1t4d0s2     sliced   3590     17678493 -
dm cuddle-f5    c1t5d0s2     sliced   3590     17678493 -
dm cuddle-f6    c1t6d0s2     sliced   3590     17678493 -
dm cuddle-r0    c1t16d0s2    sliced   3590     17678493 -
dm cuddle-r1    c1t17d0s2    sliced   3590     17678493 -
dm cuddle-r2    c1t18d0s2    sliced   3590     17678493 -
dm cuddle-r3    c1t19d0s2    sliced   3590     17678493 -
dm cuddle-r4    c1t20d0s2    sliced   3590     17678493 -
dm cuddle-r5    c1t21d0s2    sliced   3590     17678493 -
dm cuddle-r6    c1t22d0s2    sliced   3590     17678493 -

v  simplevol     fsgen        ENABLED  ACTIVE   8388608  SELECT    -
pl simplevol-01  simplevol     ENABLED  ACTIVE   8392167  CONCAT    -        RW
sd cuddle-f0-01  simplevol-01  cuddle-f0 0       8392167  0         c1t0d0   ENA
# 

Talk about simple! We've now got a volume enabled and ready for a filesystem. You'll notice that the volumes layout is "CONCAT", it's on one disk, it used the first disk it deemed usable to create the volume and built all the subobject. The volume is even started for us! This is why vxassist is so popular and helpful, it's very quick and easy.

Just for completeness let's see a filesystem put on this puppy and put into use:

# newfs /dev/vx/rdsk/cuddledg/simplevol 
newfs: /dev/vx/rdsk/cuddledg/simplevol last mounted as /test
newfs: construct a new file system /dev/vx/rdsk/cuddledg/simplevol: (y/n)? y
/dev/vx/rdsk/cuddledg/simplevol: 
	8388608 sectors in 4096 cylinders of 32 tracks, 64 sectors
        4096.0MB in 84 cyl groups (49 c/g, 49.00MB/g, 6144 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 100448, 200864, 301280, 401696, 502112, 602528, 702944, 803360, 903776,
 1004192, 1104608, 1205024, 1305440, 1405856, 1506272, 1606688, 1707104,
 1807520, 1907936, 2008352, 2108768, 2209184, 2309600, 2410016, 2510432,
 2610848, 2711264, 2811680, 2912096, 3012512, 3112928, 3211296, 3311712,
 3412128, 3512544, 3612960, 3713376, 3813792, 3914208, 4014624, 4115040,
 4215456, 4315872, 4416288, 4516704, 4617120, 4717536, 4817952, 4918368,
 5018784, 5119200, 5219616, 5320032, 5420448, 5520864, 5621280, 5721696,
 5822112, 5922528, 6022944, 6123360, 6223776, 6324192, 6422560, 6522976,
 6623392, 6723808, 6824224, 6924640, 7025056, 7125472, 7225888, 7326304,
 7426720, 7527136, 7627552, 7727968, 7828384, 7928800, 8029216, 8129632,
 8230048, 8330464,
# mkdir /simple_vol
# mount -F ufs /dev/vx/dsk/cuddledg/simplevol /simple_vol/
# cd /simple_vol/
# touch new_file
# ls -al
total 20
drwxr-xr-x   3 root     root         512 Aug 11 23:24 .
drwxr-xr-x  33 root     root        1024 Aug 11 23:23 ..
drwx------   2 root     root        8192 Aug 11 23:22 lost+found
-rw-r--r--   1 root     other          0 Aug 11 23:24 new_file
# 

There we have it, from start to finish, from SCSI disks to a usable volume with filesystem and it's even mounted. You'll notice that the device path is in the form: /usr/vx/(r)dsk/<diskgroup>/<volumename>. Everything else should be familar to you.

From this point on I will limit down the ammount of output, such as only showing the volume information in the vxprint output instead of all of it, and we won't cover creation of filesystems since you already know how to do that and every volume (regardless of how it's created) is created in a similar fashion as above. With that said, let's get onto the next lesson!