I have Ubuntu 15.04 as a guest OS in VirtualBox, and have resized the VDI drive and the partition inside it using GParted LiveCD. GParted correctly see the new size (14.5 GB), but inside Ubuntu it's still the old size: enter image description here

$ df -k
Filesystem                1K-blocks    Used Available Use% Mounted on
/dev/mapper/zion--vg-root   7331536 7115864         0 100% /
none                              4       0         4   0% /sys/fs/cgroup
udev                        1013420       4   1013416   1% /dev
tmpfs                        204912     448    204464   1% /run
none                           5120       0      5120   0% /run/lock
none                        1024556       0   1024556   0% /run/shm
none                         102400       0    102400   0% /run/user
/dev/sda1                    240972  136514     92017  60% /boot
overflow                       1024     140       884  14% /tmp


Output of parted -l:

Disk /dev/sda: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  256MB   255MB   primary   ext2         boot
 2      257MB   15.7GB  15.5GB  extended
 5      257MB   15.7GB  15.5GB  logical                lvm

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/zion--vg-swap_1: 533MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size   File system     Flags
 1      0.00B  533MB  533MB  linux-swap(v1)

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/zion--vg-root: 7764MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  7764MB  7764MB  ext4

Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0
has been opened read-only.
Error: Can't have a partition outside the disk!
  • Have you rebooted since making the change with Gparted?
    – David
    Dec 7 '15 at 13:13
  • @DavidCole yes, several times
    – CharlesB
    Dec 7 '15 at 13:14
  • 1
    The output of sudo parted -l from the Ubuntu system installed in the VirtualBox might be helpful. Please edit your question to add it.
    – Byte Commander
    Dec 7 '15 at 14:47
  • 1
    @ByteCommander Original size was 7.8 GB, and I expanded it to 15000 MB using VBoxManage modifyhd, no shrinking after that
    – CharlesB
    Dec 7 '15 at 16:12
  • 1
    @CharlesB Ah, I see. You need to reconfigure your LVM. I don't know about that, but it looks like your LVM did not notice that the partition it is located in grew. GParted can't do that, I don't know what you need to do though.
    – Byte Commander
    Dec 7 '15 at 17:19

As pointed out in the comments, problem is that my volumes are LVM, and GParted doesn't know how to resize it. Solution was to boot on GParted LiveCD, and run the following commands:

# to find the name of the volume, /dev/zion-vg/root here
$ sudo lvdisplay

#to extend the volume (started at 15G, but had to bring it down to 13.9G since it had not enough size)
$ sudo lvextend -L13.9G /dev/zion-vg/root 

#needed by resize2fs
$ sudo e2fsck -f /dev/zion-vg/root

#final resize
$ sudo resize2fs  /dev/zion-vg/root

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.