1833644 Members
5027 Online
110062 Solutions
New Discussion

About stripes with LVM

 
Heber Garcia
Advisor

About stripes with LVM

Hi,
Is there any way to create a lvol with stripes in the disk that you want?

I want to create an lvol and next extend with stripes to another disk drive . No distributed.

Like with mirror .

Thanks.
2 REPLIES 2
Rodney Hills
Honored Contributor

Re: About stripes with LVM

I went throught the following (without SAMs help)...

# Create physical volume devices
pvcreate -f /dev/rdsk/c7d0s2
pvcreate -f /dev/rdsk/c8d0s2
pvcreate -f /dev/rdsk/c9d0s2
pvcreate -f /dev/rdsk/c10d0s2
pvcreate -f /dev/rdsk/c11d0s2
# Create vg01
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x010000
# Add 4 disks to vg01ms
vgcreate -g vg01ms -s 1 -e 2100 /dev/vg01
/dev/dsk/c7d0s2 /dev/dsk/c8d0s2
/dev/dsk/c9d0s2 /dev/dsk/c10d0s2
# Add 1 disk to vg01ss (for mirror)
vgextend -g vg01ss /dev/vg01 /dev/dsk/c11d0s2
# Create logical volume
lvcreate -n lvol1 -m 1 -s g /dev/vg01
# The follwing commands were built by a script to
# rotate the striping onto 4 disks (with a mirror on the 5th disk)
lvextend -l 1 /dev/vg01/lvol1 /dev/dsk/c3t0d0
lvextend -m 1 /dev/vg01/lvol1 vg01ss ;# Turn on mirroring with first PE
lvextend -l 2 /dev/vg01/lvol1 /dev/dsk/c3t1d0 /dev/dsk/c3t4d0
lvextend -l 3 /dev/vg01/lvol1 /dev/dsk/c3t2d0 /dev/dsk/c3t4d0
lvextend -l 4 /dev/vg01/lvol1 /dev/dsk/c3t3d0 /dev/dsk/c3t4d0
...
There be dragons...
Jeen Oppedijk
Advisor

Re: About stripes with LVM

The problem with LVM is the fact that striping and mirroring can't be used together with lvcreate (or lvextend).
When using striping you want to increase the speed of disk I/O, that is why the blocksize is important. With lvcreate the stripe blocksize can be set to 4KB to 64KB, which are good values. It depends on you environment, but small is better (most of the time).

If you also want to mirror the discs you have to find another solution. The solution which Rodney suggests uses blocks of minimal 1MB (the minimal Logical Extent size), which is far to big for effective striping. So I wouldn't recommend it.
The best solution would be to use hardware striping and/or mirroring using EMC, XP or other disc-cabinets. Or not to use striping altogether ;-)