Skip to main content
2 of 3
added 151 characters in body
user1301428
  • 1.1k
  • 3
  • 14
  • 24

Can't resize a partition using resize2fs

I recently resized the hard drive of a VM from 150 GB to 500 GB in VMWare ESXi. After doing this, I used Gparted to effectively resize the partition of this image. Now all I have to do is to resize the file system, since it still shows the old value (as you can see from the output of df -h):

Filesystem                     Size  Used Avail Use% Mounted on
/dev/mapper/owncloud--vg-root  157G   37G  112G  25% /
udev                           488M  4.0K  488M   1% /dev
tmpfs                          100M  240K  100M   1% /run
none                           5.0M     0  5.0M   0% /run/lock
none                           497M     0  497M   0% /run/shm
/dev/sda1                      236M   32M  192M  14% /boot

However, running sudo resize2fs /dev/mapper/owncloud--vg-root returns this:

resize2fs 1.42 (29-Nov-2011)
The filesystem is already 41608192 blocks long.  Nothing to do!

Since Gparted says that my partition is /dev/sda5, I also tried running sudo resize2fs /dev/sda5, but in this case I got this:

resize2fs 1.42 (29-Nov-2011)
resize2fs: Device or resource busy while trying to open /dev/sda5
Couldn't find valid filesystem superblock.

Finally, this is the output of pvs:

PV         VG          Fmt  Attr PSize   PFree
/dev/sda5  owncloud-vg lvm2 a-   499.76g 340.04g

How can I resize the partition so that I can finally make the OS see 500 GB of hard drive?

user1301428
  • 1.1k
  • 3
  • 14
  • 24