Fun with LVM
Jozef
Basics
apt-get install lvm2 dmsetup
pv - physical volume
vg - volume group
lv - logical volume
PV
Physical volume
pvcreate /dev/hdb
pvscan -v -u
pvmove -v /dev/hdb
VG
Volume group
vgcreate vg00 /dev/hdb
vgdisplay -v
vgextend vg00 /dev/hdd
vgreduce vg00 /dev/hdb
why more than one vg?
LV
Logical volume
lvcreate -n test1 -L 200M vg00
mkfs.ext3 -m0 /dev/mapper/vg00-test1
mount /dev/mapper/vg00-test1 /mnt
df -h
vgdisplay -v
lvextend -L 400M vg00/test1
resize2fs /dev/mapper/vg00-test1 400M
# lvreduce -L 150M vg00/test1
# lvremove vg00/test1
migrating
stop using /dev/hdd
vgdisplay -v
vgextend vg00 /dev/hdb
pvmove -v /dev/hdd
vgreduce vg00 /dev/hdd
vgdisplay -v
badblocks -s -v -w /dev/hdd
physical?
what can be pv
/dev/hdb
/dev/hdb2
/dev/md0
iSCSI
any other block device
it's always fun with hotswap
And that's it...
Questions?