7. Volume Lesson 4: RAID5 Volumes

RAID5 is pretty simple to deal with. You can get pretty specific about the volume setup using vxassist, but generally when you are using RAID5 you're not looking to break any benchmarks. Therefore there is no more to it's creation than specifying the layout as "raid5", and specifying any disks you want to use. The syntax again is:

vxassist -g <diskgroup> -U <usagetype> make <volname> <size> \
	layout=<layouttype>  <disk1> <disk2> <disk3> ...

RAID5 does have some requirements, though, you must use at least 3 vmdisk (4 is preferable) to create a RAID5 volumes, of which 3 subdisks are used for the volume itself, and 1 subdisk is automatically created as a RAID5 log plex. A RAID5 log is used for volume metadata and parity logging. While you do not absolutely need a RAID5, you would be a fool to not use one, and vxassist just assumes give you on right away.

Let's look at an example of a RAID5 volumes building built:

# vxassist -g cuddledg -U fsgen make raid5vol 4g layout=raid5
# vxprint -g cuddledg -hrt raid5vol
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

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 -

v  raid5vol     raid5        ENABLED  ACTIVE   8388640  RAID      -
pl raid5vol-01  raid5vol     ENABLED  ACTIVE   8402880  RAID      6/32     RW
sd cuddle-f0-01 raid5vol-01  cuddle-f0 0       1680588  0/0       c1t0d0   ENA
sd cuddle-f1-01 raid5vol-01  cuddle-f1 0       1680588  1/0       c1t1d0   ENA
sd cuddle-f2-01 raid5vol-01  cuddle-f2 0       1680588  2/0       c1t2d0   ENA
sd cuddle-f3-01 raid5vol-01  cuddle-f3 0       1680588  3/0       c1t3d0   ENA
sd cuddle-f4-01 raid5vol-01  cuddle-f4 0       1680588  4/0       c1t4d0   ENA
sd cuddle-f5-01 raid5vol-01  cuddle-f5 0       1680588  5/0       c1t5d0   ENA
pl raid5vol-02  raid5vol     ENABLED  LOG      3591     CONCAT    -        RW
sd cuddle-f6-01 raid5vol-02  cuddle-f6 0       3591     0         c1t6d0   ENA
#

Here we see that vxassist descided to work with 6 disks for the actual volume, and then created a very small (1.5M) subdisk for a RAID5 log plex. We could alternately have specified the number of columns we wanted in the RAID5 volumes using the option "ncolumns", just like we did to control striped volumes in the previous examples. But remember, if you specify "ncolumns" as 5, and you want to specify disks to use, to specify 6 disks for use so that you don't end up forcing vxassist to put the log plex on one of the data disks.

Here's one more RAID5 example with alittle more clarify than before:

# vxassist -g cuddledg -U fsgen make raid5vol 4g layout=raid5 ncolumns=3 cuddle-f0 cuddle-f1 cuddle-f2 cuddle-f3
# vxprint -g cuddledg -hrt raid5vol
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

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 -

v  raid5vol     raid5        ENABLED  ACTIVE   8388608  RAID      -
pl raid5vol-01  raid5vol     ENABLED  ACTIVE   8395712  RAID      3/32     RW
sd cuddle-f0-01 raid5vol-01  cuddle-f0 0       4197879  0/0       c1t0d0   ENA
sd cuddle-f1-01 raid5vol-01  cuddle-f1 0       4197879  1/0       c1t1d0   ENA
sd cuddle-f2-01 raid5vol-01  cuddle-f2 0       4197879  2/0       c1t2d0   ENA
pl raid5vol-02  raid5vol     ENABLED  LOG      3591     CONCAT    -        RW
sd cuddle-f3-01 raid5vol-02  cuddle-f3 0       3591     0         c1t3d0   ENA
#

Wham, just what I asked for, ready to go. It's VxVM awsome!