Adding more space to VirtualBox HD (Centos Host) does not add space in the folder [closed]

I am running Centos 6.5 guest on Windows 7 Pro host (VirtualBox v4.3.6) – all 64 bit.
I am trying to increase the size of Centos virtual disk (which is currently about 15G) to 90G.
I did run the following Command

VBoxManage modifyhd “C:_Ten\Centos 6.5.vdi” –resize 92160

I observed expected output

0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%

and so far everything looks good.

Then I booted my Centos VM into GParted utility and this is where things start get confusing.
What I see in GParted is two partitions /dev/sda1 500MiB, /dev/sda2 30GiB and unallocated space of 60 GiB. What /dev/dev1 and /dev/sda2 represent? Which one of them do I need to grow?

I actually tried growing both (separately and simultaneously) nothing helps. What I really need is to add space available under /data (where I have my MongoDB databases). Prior to HD resize exercise “df -h /data” command in Centos was showing that that directory is using 98% of 28G available.

After running VBoxManage and GParted nothing changed no matter which partition I grow.

Question 1: How come my physical disk size is only 15GB but df shows that I have used 28 is there some kind of compression going on in VBoxManage?

Question 2: how do I get more space available to “/” and thus respectively to “/data”?

Thank you

Answer

Question 1: Could be a corrupt filesystem. Run fsck and see if it fixes the problem.

Question 2: You have to resize your partition and your filesystem. The partition can be resized using parted. The filesystem has to be resized using a tool specific for your filesystem, for example resize2fs for ext2/ext3/ext4, xfs_growfs for xfs and so on.

Here is a guide for the whole procedure: http://positon.org/resize-an-ext3-ext4-partition

And sda1 could be your boot or swap partition. Check your /etc/fstab.

Attribution
Source : Link , Question Author : Henry , Answer Author : scai

Leave a Comment