How NOT to partition your disks (and how to).

Well, I have been doing this the moment I decided to use linux which is quite a few years back, but I can that I have never found a perfect way to partition my disks in a way that will take care of all the future requirements of adding/deleting an os. I had Ubuntu and windows 7 before this weekend and I wanted fedora 14- 64bit as a third os and hence I was stuck to figure out how to manipulate my disks now. The following was the partition layout before adding fedora.

—————————————–500 Gig——————————————-

| [windows 7]  |  [Extendended partition {swap}{root}{home}] | [DATA]

———————————————————————————————-

where the [] defines primary partitions. I thought that if I wanted to add another linux partition, I would just shrink the last DATA partition and make that.

Now the problem with that is we can only make 4 primary partitions and ONE extended partition (More on partitions here and here). So that meant that I had to first free up some space, which was the easy part, and then somehow use that space as an extended partition to install fedora. By this time you must have envisioned the problem this led to. I will redraw the above layout with modifications for clarity

—————————————–500 Gig——————————————-

| [windows 7]  |  [Extendended partition{swap}{root}{home}] | [DATA] | [Free Space(for fedora]

———————————————————————————————-

Here, the last section of free space HAS to be a part of the extended partition for using it to install fedora(or any other os for that matter). Answer is quite simple, take that space and insert it between the existing extended partition and data section to get the following layout.

 

—————————————–500 Gig——————————————-

| [windows 7]  |  [Extendended partition {swap}{root}{home}]| [Free Space(for fedora]| [DATA]

———————————————————————————————-

The next obvious step is to merge the free space with the extended partition so that the free space is now a subsection of the original extended partition, and use this extra space to make room for your new linux installation and eureka… you’re there.

Not so fast. If you have thought it this way, then you might end up spending more than 6 hours(depending on how large data section are you shifting around), like I did. You will, no doubt, achieve the result but its just too frustrating to wait for such a long time. I had 350 gig as my data section and the full procedure took me whole day to get through with.

The best way out of it is planning this from the moment you install your first os on the machine. First things first. Keep the bootable usb drive or cd of Gparted with you. ALL THE TIME. This is a swiss army knife for anything and everything that can and has to be done to your partitions. This is a must have at all the times. Moving on, before installing any os, fire up your gparted live cd and get to the main window where it shows your complete disk layout. For this part, I am assuming that even if you do have window, you want to scrap it and start everything afresh, so that you have the complete disk to play with at this time.

Give the required space for windows (dont allocate any filesystem). Format the second part as extended partition, and the last one as NTFS, or FAT whichever you want.The point here is that you would want to have free space if, later you want to install another linux distro on the same machine and at the same time, you want to get rid of all the extra time taken to move that huge block(s) of data.

The solution which I implemented is as follows. Do let me know if you have thought of a better way.

Make another small data partition of the size which you usually allocate to a new os and keep is beside the extended partition and try to keep the movable sort of data in it, eg, movies, documents, which wont effect anything else one they are transferred from one partition to another. Music does screw up the libraries that have to be recompiled.

The layout will be like this after that operation.

————————————————————————————

| [windows ]  |  [Extendended partition {swap}{root}{home}]| [DATA1]| [DATA2]

————————————————————————————-

The next step is pretty obvious, whenever the new os installation is required, transfer the data from this drive to somewhere else, format this drive, and merge it with the existing extended partition to install the new os. Moving the data from this 30-40 gig drive will take not more than 15 minutes and you save approximate 6 hours of trouble.

The reason why a new partition is required and the DATA2 cannot be used is because (diagrammatically), the filling up of data starts from left side of the disk space shown above. So even if your DATA2 is empty at the end, you cannot free up space at the beginning of it, which is required for merging it with extended partition which has to be contiguous.

Anyways, I did manage to get things working for me but there is still a problem if I have to install more os later on. The approach just discussed assumes that one know’s the number of os he is going to install.

Theoretically, the data section can also be put in between the windows and linux partition, and it can be shrunk when the space is required while the extended partition can be extended towards the left to fill up the free space. I haven’t tried this and if anyone has, then would really want to know the feasibility of this method. Will definitely try this the next time I go ahead with the installation.Right now I am just happy to get things working.

 

Share Comments
comments powered by Disqus