LVM on RAID 10
mdadm -v –create /dev/md1 –level=raid10 –raid-devices=4 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2
pvcreate /dev/md1
vgcreate vg-server1 /dev/md1
lvcreate -L4g -nlv-home vg-server1
lvcreate -L2g -nlv-var vg-server1
lvcreate -L1g -nlv-tmp vg-server1
The -L option specifies the size of the volume
lvcreate -l 100%FREE -nlv-home vg (creates all of the unallocated space in the volume group)
reducing volume to 100GB (not for XFS filesystem!)
- umount /dev/vg-server1/lv-zapas
- e2fsck -f /dev/vg-server1/lv-zapas
- resize2fs -p /dev/vg-server1/lv-zapas 100G
- lvreduce -L 100G /dev/vg-server1/lv-zapas
- e2fsck -f /dev/vg-server1/lv-zapas
- resize2fs -p /dev/vg-server1/lv-zapas
- e2fsck -f /dev/vg-server1/lv-zapas
- mount /dev/vg-server1/lv-zapas
extending volume up to 100GB (not for XFS filesystem !)
- umount /dev/vg-server1/lv-home
- lvextend -L 100G /dev/vg-server1/lv-home or ( lvextend -l +100%FREE /dev/vg-server1/lv-home)
- e2fsck -f /dev/vg-server1/lv-home
- resize2fs -p /dev/vg-server1/lv-home
- e2fsck -f /dev/vg-server1/lv-home
- mount /dev/vg-server1/lv-home
extending volume + 1GB
lvextend -L+1G /dev/vg-server1/lv-var