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.
1 |
# fdisk /dev/sdb |
Create the Physical Volume
1 2 |
# pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created |
Create the volume group. We will call it vgapp.
1 2 |
# vgcreate vgapp /dev/sdb Volume group "vgapp" successfully created |
Verify it created.
1 2 3 4 |
#vgs 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.
1 2 |
# lvcreate -n lvapp -L+10G /dev/vgapp Logical volume "lvapp" created |
Now lets format the logical volume as ext4.
1 |
# mkfs.ext4 /dev/vgapp/lvapp |
Verify it.
1 2 3 |
# lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert lvapp vgapp -wi-a- 10.00G |
Make a directory for the mount
1 |
# cd / | mkdir app |
Add the new filesystem to /etc/fstab
1 |
/dev/vgapp/lvapp /app ext4 noatime 1 2 |
Mount it
1 |
# mount /app |
All done and ready for use!
Leave a Reply