Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I wanted to create more space for Ubuntu on my hard disk in favor of my Windows partition. I booted the livecd and resized the NTFS partition to 100 GB. Then I wanted to resize my Ubuntu (ext4) partition to fill up the created unallocated space.

A screenshot of my current disk. (With the livecd there's no 'key' icon after sda6) a screenshot of my current disk

My first thought was just right click on sda6 → move/resize → done. Unfortunately I cannot resize or move the partition. However I can resize the NTFS partition.

I guess it is because the extended sda4 partition is locked. I couldn't see an unlock possibility though…

So how do I resize the ext4 partition anyway, probably by unlocking the extended partition, but how?

Thanks in advance.

share|improve this question

marked as duplicate by psusi, Uri Herrera, Kevin Bowen, Seth, AgentCool Jun 6 '13 at 8:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

9 Answers 9

up vote 18 down vote accepted

You cannot resize a mounted filesystem, that's why you see a lock icon.

You were doing well, you booted into a Live CD and resized the NTFS partition.

Now you need to enlarge the Extended partition, partitions "inside" that extended partition cannot "escape" outside.

  1. Make sure that /dev/sda6 is unmounted. If a lock icon is visible, right click on it and choose for Unmount
  2. Make sure that the swap partition /dev/sda5 is unmounted. Right click on it and choose for Swapoff
  3. Select /dev/sda4 and choose for Resize. Use the free space on the left side
  4. Select /dev/sda6 and resize it on the right side
  5. Apply the changes and you're done.
share|improve this answer
    
@arian Yeah, the screenshot you provided suggests that its still mounted (hence why you can't do anything with the drive). And also, you're right, @Lekensteyn, that extended partition needs to be resized first to make that space available for the partitions inside that (we didnt have this information before now :P) –  Thomas W. Jun 30 '11 at 15:38
    
right, sda4 is still locked (in the live-cd too), and sda6 is unlocked so I cannot resize my extended partition to make size available. That's probably the problem here. –  arian Jun 30 '11 at 15:58
    
@arian: it seems that the swap partition is always mounted. Check the new instructions. –  Lekensteyn Jun 30 '11 at 21:17
    
Thanks, it worked! It took a while (1.5 hours) but everything seems to work fine. I had to use a margin of about 5mbs on the left because initially I got an error message. –  arian Jul 1 '11 at 18:09
add comment

For a start boot with your live CD.

Press Start and type Gparted:

open gparted

Once you open the program you will see a list with your partitions. Now to make any changes, we have to unmount the partitions we want to edit. Right-Click on the partition, and choose Unmount:

unmount partition

Let's assume that I want to decrease the size of sda1 and add it in sda3. Right-Click on sda1 and choose Resize/Move

enter image description here

A new windows will pop out were we can make our changes. Now to decrease the size, drag the Right arrow to the left. You can also type a custom value next to the option New size (MB):. Once you choose the new size click on the button Resize/Move

enter image description here

Now a new box will appear with the label unallocated. We will now add this free space at sda3 partition.

enter image description here

Right-Click on sda3 and choose Resize/Move

enter image description here

Drag the left arrow to the left as shown below:

enter image description here

Hit the button Resize/Move to submit the change.

Finally, click on the "tick" button to apply all your changes.

enter image description here

share|improve this answer
add comment

A partition cannot be resized when Ubuntu is running off of it, or it is mounted.

You can use a live CD:

  1. Boot the setup CD(live CD) and select to "Try Ubuntu".

  2. Once it boots, start GParted and right-click the partition. Unmount it.

  3. Then, delete or resize any partitions to the left or the right of the partition in question.

  4. Now, right-click the partition and resize it.

  5. Click Apply on the GParted window and let it finish.

    You need to "Apply" since the changes are not done until this step. They are only queued up when you perform operations in GParted.

Don't forget to make a backup of any important data!

share|improve this answer
add comment

Yes you can with GParted.

  1. Boot from Ubuntu live CD.
  2. Launch GParted.
  3. Select the Ubuntu partition in question and click on Resize/Move from the GParted toolbar or select Partition menu → Resize/Move - provided that the gained unallocated space is right next to the Ubuntu partition in question.

    If the unallocated space is not adjacent to the Ubuntu partition, then you either have to move or shrink partitions to be able to put the unallocated space adjacent to the Ubuntu partition to be able to resize it.

    For a more detailed information, take a look at these sites:

    http://www.dedoimedo.com/computers/gparted.html

    http://en.kioskea.net/faq/2036-how-to-resize-a-partition-using-gparted-on-linux

    http://gparted.sourceforge.net/larry/resize/resizing.htm

    http://www.howtogeek.com/114503/how-to-resize-your-ubuntu-partitions/

share|improve this answer
add comment

I found Lekensteyn's answer very helpful, but after I expanded my /root ext4 partition, I rebooted into the grub rescue mode grub rescue >.

I was doing this to fix a multiple swap partitions problem created by the Ubuntu installations. It was ugly but how I fixed it is here.

share|improve this answer
add comment

You should boot into a LiveCD to use gparted to resize your active ext4 partition - its unwise to modify partitions while they're actively being used (especially the active system partition which is ext4)

Afterwards, you should be able to move and resize the partition within that LiveCD environment, and the changes will be done when you boot back to the ext4 partition and not the LiveCD

share|improve this answer
1  
Yeah, I did boot into the livecd (see my second sentence :)) –  arian Jun 30 '11 at 14:26
add comment

If you are using LVM2 or Btrfs, it is easy. However, I guess you are using a partition/block device for /.

An alternative to gparted:

  1. making another 10 GB space and create a new partition

  2. use it as block device and create a new file system, for example /dev/sda6 type ext4

  3. move your old /home (boot with a live CD and mount your old home and new partition -safer) on /mnt/root(assume / and /home are on the same block device, so your old home resides in /mnt/root/home) and new partition on /mnt/home, copy all files over

    rsync -axHAX --progress /mnt/root/home /mnt/home
    
  4. modify the /etc/fstab (note it is now under /mnt/root/etc/fstab)

add a new line

/dev/sda6   /home   ext4    defaults    0   2

Save

    sync; sync; reboot

You should be on top of your disk space;-)

NOTE: you can do the same for different mount points, e.g. /var, /usr etc. Howeve, finally you need to consider using LVM2, Btrfs or repartition the HDD.

share|improve this answer
add comment

I'm not saying that this is impossible, but there is a high risk involved; you don't want to lose any files if I may quote you. You have to resize a partition sda4 to a desired length a then split in logical partitions. Then you have to merge the new partition to your WUBI partition in order to increase its size.

A lot can go wrong doing so !

What I'd like to suggest is that you save all your files from Ubuntu to sda4, or an extern medium like a memory stick (etc). In Windows remove your Wubi-installation And install Ubuntu as a dualboot besides Windows 7. There are a lot of advantages doing so; your Ubuntu will respond faster, and no worries when Windows breaks that you lose your Ubuntu inside it.

I know this might not be the answer your looking for, but see it as a warning that setting up a dualboot is not only faster, it is also fail-safe. Resizing and merging partitions are a risky bussiness.

share|improve this answer
add comment

Thank you all for the answers:

this page has a solution for my problem

Increase size of root partition after installing Ubuntu in Windows

My problem is solved :-) ........................

share|improve this answer
add comment

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