1

I have Ubuntu server running in VirtualBox. I had an 8GB (default vdi size) and I needed more space so I used a 2 steps method: VBoxManager and an iso with GParted. I also installed parted on Ubuntu and I get the following message:

(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 52.4GB
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   19.1GB  18.8GB  extended
 5      257MB   19.1GB  18.8GB  logical                lvm

The 52GB are added from VBoxManager and only added 10 GB to the already existing partition.

Using df -h I get the following:

Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/kvg-root         6.5G  6.2G   52M 100% /
none                         4.0K     0  4.0K   0% /sys/fs/cgroup
udev                         488M  4.0K  488M   1% /dev
tmpfs                        100M  1.9M   98M   2% /run
none                         5.0M     0  5.0M   0% /run/lock
none                         498M     0  498M   0% /run/shm
none                         100M     0  100M   0% /run/user
/dev/sda1                    228M  156M   60M  73% /boot

Only 6.5GB which is the old size.

I saw the answer from here Root partition size remains same after partition resize with gparted but I get the following:

resize2fs 1.42.5 (29-Jul-2012)
open: Is a directory while opening /

or:

sudo resize2fs /dev/mapper/kvg-root
resize2fs 1.42.5 (29-Jul-2012)
The filesystem is already 1764352 blocks long.  Nothing to do!

What should I do so that df -h will output the right values and use the new extra space?

2

I ran into you while attempting to solve this problem.

I think I may may kind of fixed it. http://pastebin.com/RNE9uC7u

I was looking at this persons pasted output.

Try running

 lvextend -L +1G /dev/mapper/kvg-root

the +1G is however much space you are adding. Try doing +9G.

then do

 sudo resize2fs /dev/mapper/kvg-root
  • I marked your answer as being the right one. A day or two after I asked the question I tried again and I don't remember the exact steps but, I think I also did lvextend and it worked. Perhaps it was a combination of commands, because I know I tried a lot. – Emi Feb 5 '14 at 8:40

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.