Playing with LVM

My main problem all the time is that i have small capacities on hard disks (8GB,10GB) and so on.

I don’t want to throw them away but i don’t want also to leave them lying around.

This time i did an exception: i bought a big one, a Western Digital WDC WD2000JB (200GB) plus this time i didn’t the same mistake => That is create partitions with knowning how big it should be and how you will resize them on the feature.

So i desided to give a try to LVM. LVM isn’t as difficult as it sounds. Follow the howto and you will be up and running in seconds.
Initialize the disk

[root@bofh ~]# pvcreate /dev/hdc
Physical volume “/dev/hdc” successfully created

Create a volume group
[root@bofh ~]# vgcreate volume_group /dev/hdc
Volume group “volume_group” successfully created

[root@bofh ~]# pvdisplay /dev/hdc
— Physical volume —
PV Name /dev/hdc
VG Name volume_group
PV Size 186.31 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 47695
Free PE 47695
Allocated PE 0
PV UUID xWttvY-ruQD-AaiC-ibkp-SPk1-v5nZ-GMLXVY

Creating a logical volume
[root@bofh /]# lvcreate –size 10GB volume_group -n backups
Logical volume “backups” created

Create a filesystem on the /dev/mapper/volume_group-backups mount it and you have finished

When i will need more space for my backups i will do a lvextend extend the filesystem and that’s it.

Plus i can attach other harddisks on the lvm anytime i want 🙂