Friday, December 16, 2011

Adding more space to linux (Redhat) with lvm

Adding more space to linux (Redhat) with lvm


Scan for new Luns.


echo "- - -" > /sys/class/scsi_host/host0/scan

Create partition as usual for the new disk discovered.
$ fdisk /dev/sdb

Create physical volume.
$ pvcreate /dev/sdb1

Create volume group using the physical volume if a volume group doesn’t already exist.
$ vgcreate pool0 /dev/sdb1

If adding space to an already existing volume group, add the physical volume to it.
$ vgextend pool0 /dev/sdb1

Activate the volume group if it isn’t already.
$ vgchange –a y pool0

Create a logical volume in the volume group.
$ lvcreate –L 60g –n opt pool0

Create a filesystem on the logical volume as normally done.

$ mkfs.ext3 –L /opt /dev/pool0/opt

Mount the new filesystem.

$ mount /dev/pool0/opt /opt

No comments:

Post a Comment