LVM 使用 Striped 方式

LVM 使用Striped 方式

兩顆HDD使用Striped的方式
1. Create the physical volumes for LVM to use.
pvcreate /dev/sda1
pvcreate /dev/sdb1

2. Create our volume group.
vgcreate -s 16M logvg /dev/sda1 /dev/sdb1

You can verify that it's there by typing vgdisplay logvg

3. Now let's create our logical volume, and we'll stripe it across all two disks.
lvcreate -i2 -I64 -L 8000G -n loglv logvg /dev/sda1 /dev/sdb1
OR
lvcreate -i2 -I64 -l 476930 -n loglv1 logvg1 /dev/sda1 /dev/sdb1

64KB is default stripesize

You can verify that it's there by typing lvdisplay /dev/logvg/loglv

4. Now let's create our filesystem.
mkfs -t ext4 /dev/logvg/loglv

5. Add it to /etc/fstab
vi /etc/fstab

Append the following to the end of the file:
/dev/logvg/loglv      /mnt/data              ext4    defaults        0 0


The important switches you want to look at are -i and -I:

-i: number of stripes. You want to equal to the number of disks in your volume group.
-I: size of your stripes. This has to be in power of 2, (2,4,8,16,32,64,etc),
    and cannot exceed the extent size (in our example is 64 megabytes
    which is set by the vgcreate flag -s). The unit you set is in kilobytes.
    so -I64 would be stripe sizes of 64 kilobytes.

參閱
http://linux.vbird.org/linux_basic/0420quota.php#lvm
https://www.ibm.com/developerworks/community/blogs/AWojo/entry/basic_linux_lvm_striping1?lang=en

~~



沒有留言:

張貼留言