Extending a partition backwards.......

Chrifister

Distinguished
Sep 6, 2011
7
0
18,510
Alright, first off let me say hi to everyone on these wonderful forums. You guys have been a big help to me over the years. Now I have a problem that I can't seem to find enough information to fix.

I have two 500GB HDD's on this laptop. My primary HDD has 5 partitions:

Primary HDD:
sda0 = 14GB = Recovery Console (don't ask why it's 14GB :??: )
sda1 = 100MB = System Reserved (Windows)
sda2 = 423GB = Windows 7 = 355GB free space
sda3 = 22GB = Linux = 10GB free space
sda4 = 8GB = Swap Area (Linux)

Second HDD is just one partition and is used for storage with around 175GB free.

I originally had just the first three partitions but wanted to install Linux so I shrunk the third partition and created two more. Now the Linux installation doesn't have enough space. I don't want to reinstall it because of the many things I've installed on it and the many tweaks I've gone through.

So the goal is to shrink sda2 by another 40GB and add it to sda3, without destroying the Linux installation. The problem is I have no idea how to do that and the web doesn't have much information on extending partitions backwards. Apparently you can't use any of the built-in tools in Windows. There may or may not be tools in Linux (GParted?) but I am a complete Linux noob.

I figure there's two ways to do this:

1. Copy/Clone the Linux installation to the second HDD, set up the primary HDD, copy the Linux installation back over.
2. Use a third-party program to extend the partition backwards.

I'm not exactly sure how to do the first solution. Can you copy a partition to a second disk? Do I have to repartition the second HDD to do it? Or can I somehow make an image of the Linux installation and store it on the second HDD and then restore from the image? As for the second solution, anybody know of a good program that can do it?

There are two issues I'm confused about. If sda3 is in EXT3 file format, is it possible to extend backward? Will the unallocated free space be converted to EXT3 without destroying the Linux installation? The other issue I'm worried about, say with cloning and restoring the Linux installation, is the numbering of the partitions. If I destroy sda3, then shrink sda2, I'll still end up with 5 partitions but will they be numbered the same? I can see all sorts of problems with Linux if the partition numbers change.
 
Solution
there are plenty of free/3rd party programs that can do just that, BUT in your situation (2 operating systems on 1 HDD) i'd be wary of having a windows program resize a linux partition and vice versa.

i'd suggest resizing each partition while within the OS on that partition.
you can shrink the windows partition from windows' own disk management (google how to do this if you're unsure), creating 40G of unused space between sda2 and 3.
then boot into linux and extend sda3 into it using it's equivalent tools (sorry, not familiar enough with linux to help you out here, but surely it can be done)

i've never tried such a thing, so don't take my assumption that it'd work as a guarantee. and don't forget to back everything up first!

Branden

Distinguished
Jan 22, 2009
598
0
19,060
there are plenty of free/3rd party programs that can do just that, BUT in your situation (2 operating systems on 1 HDD) i'd be wary of having a windows program resize a linux partition and vice versa.

i'd suggest resizing each partition while within the OS on that partition.
you can shrink the windows partition from windows' own disk management (google how to do this if you're unsure), creating 40G of unused space between sda2 and 3.
then boot into linux and extend sda3 into it using it's equivalent tools (sorry, not familiar enough with linux to help you out here, but surely it can be done)

i've never tried such a thing, so don't take my assumption that it'd work as a guarantee. and don't forget to back everything up first!
 
Solution

Chrifister

Distinguished
Sep 6, 2011
7
0
18,510
School has just started and I haven't had time to try anything. The little research I've done has come up with nothing. That Aomei program looks alright. Can you copy a partition with the free version? If not, I'll have to look elsewhere. It would be nice to copy that Linux partition to the second drive as a backup anyway.

The only problem I see is what if I copied the 22GB Linux partition over, destroyed the original, made a new 62GB partition there, and then tried to copy the 22GB partition into that unallocated space? Wouldn't it just make another 22GB partition on the original hard drive? If it did, I assume it would create it at the beginning of the unallocated space thus allowing me to extend it into that free space. Sounds like it would work.

Still need to find time to read up on some Linux tools. The program "GParted" keeps coming up in discussions and searches. Probably a good place to start.
 

Chrifister

Distinguished
Sep 6, 2011
7
0
18,510
Well I've been really busy lately but did some more research today. Also spoke to someone with quite a bit of Linux experience. I was on the right track with Gparted. You listed the proper steps to do it. I've decided against it for two reasons: it's a time-consuming operation, and it's very risky to both OS's.

The best thing for me to do is to auto-mount the second hdd in Linux and use that for everything. Never even considered it even though the massive amount of free space is staring me in the face every time I use the laptop.
 

Latest posts