5. Volume Lesson 2: Striped Volumes

Look at the following log, and see if you can see what's being done. I'm starting from clean vmdisks again. We'll talk about it afterwords, here goes:

# vxprint
Disk group: rootdg

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg rootdg       rootdg       -        -        -        -        -       -

dm disk01       c2t0d0s2     -        17678493 -        -        -       -
dm disk02       c2t1d0s2     -        17678493 -        -        -       -
dm disk03       c2t2d0s2     -        17678493 -        -        -       -
dm disk04       c2t6d0s2     -        17678493 -        -        -       -
# vxmake sd disk01-01 disk01,0,17678493
# vxmake sd disk02-01 disk02,0,17678493
# vxmake sd disk03-01 disk03,0,17678493
# vxmake sd disk04-01 disk04,0,17678493
# vxmake plex vol01-01 layout=stripe ncolumn=4 stwidth=32k sd=disk01-01,disk02-01,disk03-01,disk04-01
# vxprint -hrt
Disk group: rootdg

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 rootdg       default      default  0        952738334.1025.nexus6

dm disk01       c2t0d0s2     sliced   3590     17678493 -
dm disk02       c2t1d0s2     sliced   3590     17678493 -
dm disk03       c2t2d0s2     sliced   3590     17678493 -
dm disk04       c2t6d0s2     sliced   3590     17678493 -

pl vol01-01     -            DISABLED -        70714077 STRIPE    4/64     RW
sd disk01-01    vol01-01     disk01   0        17678493 0/0       c2t0d0   ENA
sd disk02-01    vol01-01     disk02   0        17678493 1/0       c2t1d0   ENA
sd disk03-01    vol01-01     disk03   0        17678493 2/0       c2t2d0   ENA
sd disk04-01    vol01-01     disk04   0        17678493 3/0       c2t6d0   ENA
#
# vxmake -U fsgen vol vol01 plex=vol01-01
# vxprint -hrt
Disk group: rootdg

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 rootdg       default      default  0        952738334.1025.nexus6

dm disk01       c2t0d0s2     sliced   3590     17678493 -
dm disk02       c2t1d0s2     sliced   3590     17678493 -
dm disk03       c2t2d0s2     sliced   3590     17678493 -
dm disk04       c2t6d0s2     sliced   3590     17678493 -

v  vol01        fsgen        DISABLED EMPTY    70713885 ROUND     -
pl vol01-01     vol01        DISABLED EMPTY    70714077 STRIPE    4/64     RW
sd disk01-01    vol01-01     disk01   0        17678493 0/0       c2t0d0   ENA
sd disk02-01    vol01-01     disk02   0        17678493 1/0       c2t1d0   ENA
sd disk03-01    vol01-01     disk03   0        17678493 2/0       c2t2d0   ENA
sd disk04-01    vol01-01     disk04   0        17678493 3/0       c2t6d0   ENA
#
# vxvol start vol01
# vxprint -hrt
Disk group: rootdg

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 rootdg       default      default  0        952738334.1025.nexus6

dm disk01       c2t0d0s2     sliced   3590     17678493 -
dm disk02       c2t1d0s2     sliced   3590     17678493 -
dm disk03       c2t2d0s2     sliced   3590     17678493 -
dm disk04       c2t6d0s2     sliced   3590     17678493 -

v  vol01        fsgen        ENABLED  ACTIVE   70713885 ROUND     -
pl vol01-01     vol01        ENABLED  ACTIVE   70714077 STRIPE    4/64     RW
sd disk01-01    vol01-01     disk01   0        17678493 0/0       c2t0d0   ENA
sd disk02-01    vol01-01     disk02   0        17678493 1/0       c2t1d0   ENA
sd disk03-01    vol01-01     disk03   0        17678493 2/0       c2t2d0   ENA
sd disk04-01    vol01-01     disk04   0        17678493 3/0       c2t6d0   ENA
#

Okey! How did it look? Everything looks very similar to our first lesson when we were working with a Simple RAID. There is one difference... and only one! It was where we used VxMake to create the plex. Let's dissect this line. Here's the line I used:

# vxmake plex vol01-01 layout=stripe ncolumn=4 stwidth=32k \
	sd=disk01-01,disk02-01,disk03-01,disk04-01

This line may look scary, but its really tame. If you read my first course (RAID Theory) this will probably make sense already. Let's break it down..... The syntax is like this:

vxmake plex <plexname> layout=<layout> ncolumn=<#> stwidth=<width>
	sd=<subdisk>,<subdisk>,....

Okey, "vxmake" is the command we're using. "plex" is what we want vxmake to build for us. "plexname" is the name of our new plex will have, call it anything you like. "layout" specifies the plex layout type, or what you commonly think of as "RAID Type". Veritas supports several layout types, but the 3 most common are concat, stripe, and raid5. The concat layout is a Simple RAID. The stripe layout is a RAID0. And the raid5 layout is RAID5 - go figure. We're using stripe, to form a striped RAID0. "ncloumns" is used to specify how many columns your striped volume with contain. For the meantime, just figure that you need 1 column per subdisk. In our case we're going to be using 4 subdisks, so we'll specify 4 columns. Next, "stwidth" specifies stripe width. We'll use a 32k stripe width, just for fun. (We'll get to these last two options in a minute). And last we have "sd=" followed by a list of the subdisks we want to have vxmake attach to the plex for us. Using the "sd=" option allows vxmake to just associate the subdisks by itself, so that we don't need to worry about using "vxsd" to manually associate them.

Lets talk about two concepts here: "ncolumn" and "stwidth". Remember why we want to stripe data. We want our data to be stretched across all 4 of our subdisks, so that all 4 are sharing the data load. In order to do this we need to tell Veritas how to divide the data. We do this by dividing the data into chunks, which is specified by "stwidth" and then sequentially placing on different disks, which is specified by "ncolumn". So, in our new plex, when we write data to our volume, the first 32k will be written to disk01-01. The second 32k will be written to disk02-01. The third 32k will be written to disk03-01. Then the fourth 32k will be written to disk04-01. The fifth chunk goes on disk01-01, and so on. We just keep "wrapping" data around our subdisks, evenly splitting the load. In this way, even a single 128k file will exist on all 4 of our disks! So, again, Stripe Width is the amount of data that should be written to a column before moving to the next, and a Column is the number of subdisks to be written to.

One more thing, look back at the final vxprint output from our example, and notice that the subdisks associated with our plex have numbers in the 7th column (under "STRIPE" in the plex line) that look like this "1/0". This is the "ncolumn/offset" pair. If the number is "1/0" this tells me that this subdisk is the second column (always start with zero!) and it has no offset. If the number was "5/23128" the subdisk would be the sixth subdisk, with an offset of 23128 sectors. This is important to look for, and something you'll only see with the "-hrt" option to vxprint.

At this point, I hope you're confident in building volumes, and working with Veritas objects. I hope you are seeing how they work together. In the "Advanced Veritas Theory" course we'll talk about more kool things you can do with this new found information, and how to work with common problems. We're going to leave RAID5 out of this course, for information on RAID5 and Veritas look at the "Volume Kreation: The VxAssist Way", vxassist is a much better tool for RAID5 creation. If you haven't read any of the Veritas manuals by now, please start flipping through them. Also start reading the manual pages, which are really truly great reading. (I keep them all printed and in a binder!)

Wasn't this easy? I just want to leave this course, by pointing out how "undifficult" Veritas is. It's just different and new, not hard at all. Don't ever let Veritas scare you... she's sweet and kind. Be gentle and kind to her and she'll always treat you right. If you have a problem admit that you probably don't know what you are doing, and study the materials in man pages and in guides. In all my workings with Veritas 99.9995% of the time I have problems in Veritas it's a personal problem, not Veritas' fault. I've become comfortable with this, understanding that Veritas is trying to help me, I just need to listen to what it tells me so that I can find the right and best solution for the problem... she wants me to stop and think, no go away. Be confident, and enjoy Veritas.