I dual boot windows 7 and Ubuntu MATE. My Ubuntu partition ran out of disk space so I decided to boot up a live CD to shrink the Windows partition to then allocate the space to my Ubuntu partition. However, now I'm having trouble trying to figure out how to allocate the unallocated disk space to sda5 (my Ubuntu partition). All guides on the internet deal with how to to this when the unallocated partition is on the RIGHT of the target partition, with swap inbetween. But I can't seem to find how to do this when it's to the LEFT.

Screenshot of GParted

Or maybe there's an easier way to do this than in GParted? Thanks in advance!


File systems are anchored to the start of the volume or if you prefer, the partition space assigned to it. As a result, it is relatively easy to change the position of the end of the file system space, i.e. its right limit. But more work is involved to move its left limit, because it requires to move the start of file system.

Usually, what is done is to slide the whole content of the file system "leftwards". This is simple and it should always work, just lasts a bit.

You might think clever softwares could rebuild the metadatas at start of the file system, then renumber all references within the file system to account for the changed reference position, then mark the added space as allocatable. Besides being potentially very complex to do, this requires some properties from the file system (for example it cannot be done with ext2/3/4 since file groups won't be on the expected positions) and it opens wide windows of opportunities for disaster (think what would happen if power fails while in the middle of the operation of renumbering...)

GParted (started form externally booted media like live CD) is the kind of software which should be able to perform the task of sliding; as explained in both links, you need to handle the sda3 partition first to allow sda5 to move. Backup before.

| improve this answer | |
  • Thanks will be trying this out later tonight. And you say the rebuilding of the metadatas would open wide windows of opportunities for disaster. But wouldn't the same happen in case of a power outtage when sliding the whole content of the file system "leftwards"? Btw, do you have any software recommendations for backing up whole partitions? – Jordy Jan 2 '17 at 18:10
  • Gparted can definitely move the partition location but it WILL break your boot loader. Have a rescue disc available (bootable windows install disc on media/ USB key). – Argonauts Jan 3 '17 at 5:56
  • @Argonauts wait, but if I do this: askubuntu.com/a/557769/160046 will I still break my bootloader by doing that? – Jordy Jan 4 '17 at 15:33
  • If you change the starting position (sector) of the OS install, the MBR (or equivalent) will be wrong and the OS will not load. I believe what you want to do is move it to start at a lower sector? It's not a difficult fix - but it is necessary. – Argonauts Jan 4 '17 at 15:59
  • @Argonauts: it used to be true (think LILO), but nowadays MBR code are usually smarter and do not rely on static informations; rather they load a truckload of code then they read the MBR and they figure out where the OS volume really starts based on the actual value stored in the MBR/EMBR; so if you update the position of the volumen, the boot loader adapts. As I wrote, LILO is old-school and does not adapt silently; so in such a case, you would have to run the lilo(8) program after performing the move; some people like it that way. – AntoineL Jan 12 '17 at 19:08

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.