5

I am new to Linux so please forgive the incorrect use of vocabulary.

My company has a private cloud that provisions VM's in a KVM. I received a RHEL 6.4. When I provisioned it, I asked for 50GB of additional storage.

Here is the results of df -h:

enter image description here

The filesystem /dev/mapper/VolGroup-lv_root mounted on / is full. After consulting my companies FAQ, I found one called "Where is my extra storage that I ordered with my VM?" and was directed to a PDF that showed me how to create a new filesystem mounted on a new directory called /data. I was unable to determine how to simply extend the fileysystem mounted on /. I did that on a different VM as a test.

On the VM which I wish to extend the filesystem mounted on /, here are the results of fdisk -l:

enter image description here

Here are the results for pvdisplay:

enter image description here

On a test VM I issued the following commands as specified by my companies FAQ:

pvcreate /dev/vdb
vgcreate DATAVG /dev/sdb
lvcreate -L 10G -n lvdata1 DATAVG
mkfs -t ext4 /dev/DATAVG/lvdata1
tune2fs -c0 -i0 /dev/DATAAVG/lvdata1

I appended the following to /etc/fstab

/dev/DATAVG/lvdata1    /data    ext4    defaults    1 2

and then mounted /data:

mount /data

After this, a df -h results in:

enter image description here

This shows that I can successfully add storage, but I wish to add the storage to the filesystem mounted on / instead.

6

At first you need to unmount the second device again, before you proceed with the following steps:

You will have to add the device /dev/vdb into your logical volume group VolGroup, you can do this using vgextend.

vgextend VolGroup /dev/vdb

After this you can first grow the logical volume lv_root to the size of the group, using lvextend.

lvextend /dev/mapper/VolGroup-lv_root -L+49G

Then you need to grow the file system on the logical volume with fsadm.

fsadm resize /dev/mapper/VolGroup-lv_root

Here are more details about resizing the file system: grow file system

  • Hi Mauro. I issued umount /data and confirmed it with df. However, the vgextend VolGroup /dev/vdb resulted in Physical volume '/dev/vdb' is already in volume group 'DATAVG' Unable to add physical volume '/dev/vdb' to volume group 'VolGroup'. How may I rectify that? I assume it got that way from when I issued vgcreate DATAVG /dev/sdb – Matthew Moisen Jan 3 '14 at 22:27
  • I also have another VM that I can start over again from pvcreate /dev/vdb – Matthew Moisen Jan 3 '14 at 22:28
  • you need to completely free up /dev/vdb first. This means delete the logical volume lvdata1 that you created in the group DATAVG, and then delete the group DATAVG. – replay Jan 3 '14 at 22:28
  • Ok I issued lvremove DATAVG and vgremove DATAVG. I was then able to issue vgextend VolGroup /dev/vdb. however the lvextend /dev/mapper/VolGroup-lv_root +49G resulted in Physical Volume "+49G" not found in Volume Group "VolGroup" Did you mean lvextend /dev/mapper/VolGroup-lv_root -L+49G? That worked for me. I have just entered fsadm resize /dev/mapper/VolGroup -lv_root and am awaiting the result. – Matthew Moisen Jan 3 '14 at 22:35
  • and now df -h shows the filesystem mounted on / as having increased 50G! Thank you! Would you please edit your lvextend comand to include -L+49G instead of +49G ? – Matthew Moisen Jan 3 '14 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.