Help resizing partitions

live wire

Reputable
Apr 18, 2014
3
0
4,510
How do I move some unallocated space into the correct adjacent position, so that I can add some needed gigs to the first primary partition? OS = Ubuntu 10.4. I'm using g-parted from a live disk, so my disk is unmounted. I can see sda1 is my / partition (13.97 gb total, 12.49 gb used), sda2 is my swap (3.86 gb), sda3 (280 gb total, 18 gb used) is my / home partition. I can easily resize the sda3, saving to the preceding space, but the unallocated space will be next to the swap sda2, instead of adjacent to the root sda1. How do I get some unallocated space into the correct position, next to sda1? Thanks.
 
If it is unallocated.
Then it means no partition is marked to use it.

Simply click on the root of the drive. The intended partition
right click and extend drive.

If the partitions you stated are on two drives then the shrinking or extension of a partition is related to the physical drive.

Example SDA 3 if on another drive with SDA 2.
Cannot be allocated to SDA 1.

If two separate physical drives.




 
GPardted would allow you not just to resize a partitin, but also to move it around.
So, your current disk layout is like (R - root, S - swap, H - home, E - empty)
RRRRRRRRRRssHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

So, I would :
- shrink /home partition by e.g. 40gb (leaving it 240gb)
RRRRRRRRRRssHHHHHHHHHHHHHHHHHHHHHHHHHHHHHeeeee
- move /home back toward end of the disk
RRRRRRRRRRsseeeeeHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
- move swap toward beginning of /home
RRRRRRRRRReeeeessHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
- then extend root.
RRRRRRRRRRRRRRssHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Finally - with /home taking just 18gb, I would first make a backup of both root and home. GParted never failed on me, but you better be safe and slow than sorry
 

live wire

Reputable
Apr 18, 2014
3
0
4,510
@Shaun o - Thanks for your help. There is currently no unallocated space on this single hard drive. There is no free space left in the root partition, where I need it, so I need to do two things, at least. First, create some unallocated space from the unused part of the third primary partition. Second, move the 2nd and 3rd partitions so that I can get the free space where it needs to be, right next to the first partition. Moving the partitions is what I don't know how to do.
 

live wire

Reputable
Apr 18, 2014
3
0
4,510
@Alabalcho - I appreciate your response. G-parted has been good to use for me as well. I have made backups. Your steps make sense. It's the moving part (your steps 2 and 3) that I need to figure out. None of the many tutorials I've found address it, at least not so far.
 

stillblue

Honorable
Nov 30, 2012
1,163
0
11,660
MAKE SURE YOU DO NOT INTERRUPT THE PROCESS! Or you'll be using that backup. It takes a looooong time, hours not minutes.
If your space is at the end extend the last partition into it then shrink it from the left which moves the empty space to the left. Rinse and repeat.
 

Select the partition that has to be moved, then right-click, and "Move". I think there's also a menu entry for that operation. Don't forget to click on "Apply", and have something else to do for next hour or so.