1836369 Members
2070 Online
110100 Solutions
New Discussion

Stripe/Dist difference?

 
Roger Baptiste
Honored Contributor

Stripe/Dist difference?


Given,
-------
#vgcreate -s g testvg PV1 PV2 PV3 PV4 (four disks)

#lvcreate -L 20000 -D y -s g -r N -n distr_lv testvg

#lvcreate -L 20000 -i 4 -I 1024 -r N -n stripe_lv testvg

-----

What will be the difference
in the way data is written
onto the two LV's?? I tried
it, but couldnt locate any
difference in the output
of Lvdisplay or pvdisplay
outputs.

Is data allocated in terms
of the Stripe size or the
extent size, across the
physical volumes??

thanks
Take it easy.
7 REPLIES 7
Patrick Wallek
Honored Contributor

Re: Stripe/Dist difference?

The two work basically the same.

The distributed option (-D) work at the PE (physical extent) level. When the logical volume is created extent 1 will be put on PV1, 2 on PV2, 3 on PV3, 4 on PV4, 5 on PV1, 6 on PV2, etc. until it reaches the number of extents necessary to create the LV in the size you specify. If you look at 'lvdisplay -v' output you should be able to see the extent allocation.

Striping (-i -I) will take the data as it is written and stripe it across the 4 disks (-i 4) in 1024KB chunks (-I 1024).

The basic difference is that with a distributed LV, your data will be striped across the disks in chunks which are the size of PE as defined in the VG, which defaults to 4MB unless you specify something else. So if you have a file less than 4MB it will only be written on one disk. With regular striping the data is in 1024KB chunks, so unless you have a REALLY SMALL file, it will be striped across several disks.

One thing to keep in mind is that a Distributed LV (-D) CAN be mirrored, whereas a striped LV (-i -I) CAN NOT be mirrored.
Roger Baptiste
Honored Contributor

Re: Stripe/Dist difference?

Patrick, thanks.
One more question, is
there any command to show
how the space actually used
by the LVM is striped/spread
across the physical volumes?
LVdisplay, PVdisplay shows
only the total allocated
space , but not the actual
usage.

-raj
Take it easy.
James R. Ferguson
Acclaimed Contributor

Re: Stripe/Dist difference?

Hi:

# lvdisplay -v /dev/vgXX/lvolX

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: Stripe/Dist difference?

Hi:

# pvdisplay -v /dev/dsk/cXtYdZ
# lvdisplay -v /dev/vgXX/lvolX

...JRF...
Roger Baptiste
Honored Contributor

Re: Stripe/Dist difference?

James, yes i meant the
verbose (-v) option too for
lvdisplay and pvdisplay.
Both of them do not show
the details of the actual
"usage". They only display
the "allocated" space.
So, for instance if a LV
is allocated 20Gb across
four PV's , they display
that Information, but do
not show , how the space is
actually used by the files.
Here is an example: On a filesystem mountpoint i
do:

#ll
drwxr-xr-x 2 root root 96 Apr 20 15:30 lost+found
-rw-r----- 1 root sys 5242880 Apr 20 15:33 5mb
-rw-r----- 1 root sys 5242880 Apr 20 15:40 5mb1

Then,
i do a lvdisplay -v

LV Name /dev/test_metavg1/distri_meta1_lv1
VG Name /dev/test_metavg1
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 20480
Current LE 10240
Allocated PE 10240
Stripes 0
Stripe Size (Kbytes) 0
Bad block NONE
Allocation PVG-strict/distributed
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c44t0d0 2560 2560
/dev/dsk/c47t0d1 2560 2560
/dev/dsk/c50t0d2 2560 2560
/dev/dsk/c53t0d3 2560 2560

--- Logical extents ---
LE PV1 PE1 Status 1
00000 0 00000 current
00001 1 00000 current
00002 2 00000 current
00003 3 00000 current
00004 0 00001 current
00005 1 00001 current
00006 2 00001 current
00007 3 00001 current
......................................
10231 3 02557 current
10232 0 02558 current
10233 1 02558 current
10234 2 02558 current
10235 3 02558 current
10236 0 02559 current
10237 1 02559 current
10238 2 02559 current
10239 3 02559 current

----------------

How do i see how the
files 5mb and 5mb1 are
striped across the disks?

thanks
Take it easy.
Patrick Wallek
Honored Contributor

Re: Stripe/Dist difference?

As far as I know, there is no way to see how actual files are laid out within your LVs. That would be a nice feature, but rather complicated to program, I think.

The short answer is, I don't think you can do what you want to do.
Tim D Fulford
Honored Contributor

Re: Stripe/Dist difference?

This does not answer you question but may be useful.

If your LV's are mirrored under LVM(distributed stripe only) You could try using
# pvdisplay -v /dev/dsk/
The state flag will go from "current" to "stale" for a short period whislt the mirrors re-sync.

Alternatively, if you want to place particular dbspaces/tables (files) on certain parts of the disk the only way I have found is to create dedicated LV's. This will obviously be more applicable for databases as opposed to filesystems, but I can't see why you would need to optimise the reading/writing performance of regular files.

Tim
-