1

I have an Ubuntu VM on VMWare Player, on which I can't increase the virtual disk size. Earlier I built the VM with 30G size, then I used the VMWare expand 'button' to expand to 50G. Now the VMWare image shows 50G. But when I do a df -h inside the OS, I still see it as 30G.

fdisk -l shows disk as 50G, but the sda1 partition still shows 30G. How can I extend my / (everything is on /, just one partition) to the full 50G?

# fdisk -l
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0001183e

Device     Boot    Start      End  Sectors Size Id Type
/dev/sda1  *        2048 58722303 58720256  28G 83 Linux
/dev/sda2       58724350 62912511  4188162   2G  5 Extended
/dev/sda5       58724352 62912511  4188160   2G 82 Linux swap / Solaris

Thank you.

peterh
  • 9,488
  • 16
  • 59
  • 88
rajeev
  • 225
  • 2
  • 13
  • 4
    You have increased the partition, but not the **filesystem**. The garage now holds two SUV's, but the car in it is still the same VW Beetle. – Kaz Sep 14 '17 at 20:38
  • Which filesystem? please add the output of "mount" to the question – Rui F Ribeiro Sep 14 '17 at 20:40

2 Answers2

3

The expansion grows the virtual hard disk, but without doing anything with its content. It is like if you had cloned a physical 30G hard disk to a 50G one:

  • also the partition table on your virtual disk remained the same, so it points now to a 30G partition (on the already 50G disk).
  • furthermore, your sda1 still holds a 30G partition, even if you update the partition table, it remain still 30G.

The solution is very simple:

  1. Reboot your virtual machine into a virtual Ubuntu live ISO image.
  2. Use the parted tool to extend 1) your sda1 partition 2) the filesystem on it.
peterh
  • 9,488
  • 16
  • 59
  • 88
0

I found the answer here. https://askubuntu.com/a/116367/349090

  1. removed existing partitions
  2. created new main(pri) part.
  3. created swap part. rebooted.
  4. ran resize2fs

I followed all steps in there, it worked nicely. I thought I would delete my question. But then, maybe someone will come asking the same thing....

Thank you.

rajeev
  • 225
  • 2
  • 13