Adding Additional Disks RHEL 6

Ever wondered how to add an additional disk to RHEL 5/6 and create a new LVM(Logical Volume Manager). In this post I will try to show how to do just that.

This is assuming a second disk was added (/dev/sdb) to the system. If the disk is different (dev/sdc…) just make the changes to the command.

# fdisk /dev/sdb

Create the Physical Volume

# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created

Create the volume group. We will call it vgapp.

# vgcreate vgapp /dev/sdb
Volume group "vgapp" successfully created

Verify it created.

VG    #PV #LV #SN Attr   VSize  VFree
vg00    1   6   0 wz--n- 13.91G  4.72G
vgapp   1   0   0 wz--n- 10.00G 10.00G

Create the logical volume, staying with app as the name we’ll call it lvapp.

# lvcreate -n lvapp -L+10G /dev/vgapp
Logical volume "lvapp" created

Now lets format the logical volume as ext4.

# mkfs.ext4 /dev/vgapp/lvapp

Verify it.

# lvs
LV     VG    Attr   LSize   Origin Snap%  Move Log Copy%  Convert
lvapp  vgapp -wi-a-   10.00G

Make a directory for the mount

# cd / | mkdir app

Add the new filesystem to /etc/fstab

/dev/vgapp/lvapp        /app                    ext4    noatime       1 2

Mount it

# mount /app

All done and ready for use!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.