Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have Ubuntu installed on a drive. The problem is it is running low on disk space. This is installed on vmware. I expanded the virtual drive and booted into ubuntu. But when I opened gparted(sudo gparted), the move/resize option is unavailable. This is the partition Ubuntu is installed on, but I need to resize it. Any ideas? I am comfortable using command line

share|improve this question

4 Answers

up vote 2 down vote accepted

You are almost there.
You can not resize the partition using GParted while Ubuntu is running.
You will need to attach the GParted ISO's as a CD to the VM machine and reboot the machine so that the GParted will be loaded instead of Ubuntu (I think you can boot from the virtual CD by pressing F12 immediately after machine is started).
Once you booted into GParted the option to move/resize will be enabled as Ubuntu is not currently running.

share|improve this answer

As a matter of fact, you CAN enlarge the root filesystem while Ubuntu is running (I learned this recently myself here) - this sounds incredible but it's true :)

The magic command is resize2fs. From man resize2fs:

The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3 and ext4.).

My understanding is that gparted would use resize2fs behind the scenes anyway, so if for any reason booting from Ubuntu LiveCD is not an option, using resize2fs will solve the problem

share|improve this answer

Regarding resize2fs, enlarging the root file system does NOT mean you can increase the partition size, as the man page ("man resize2fs") states clearly.

share|improve this answer
Welcome to Ask Ubuntu! Please refrain from posting comments as answers. – InkBlend Mar 30 at 4:20

Thank you for your note. I believe I have now answer (not comment...). I succeeded in enlarging my primary ext4 partiion using the methodology described here: http://www.howtoforge.com/linux_resizing_ext3_partitions

Some notes from my personal experience: - The link example is for shrinking partition, hence the order is resize2fs first and then fdisk. When enlarging partition (as in my case) the order should be fdisk first, reboot and then resize2fs. Also, when using fdisk, the primary as well as the extended partitions should be removed and re-defined. - I booted the ubonto from another drive and then worked on this drive which actually was mirror (using dd) of the older drive. Made it bootable using GParted - The current version of resize2fs (I am using ubontu 12.04LTS) support ext4 - no need to do the actions described in the link of changing it the ext2.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.