Sunday, February 10, 2008

Linux for Absolute Beginers : Resizing NTFS partiton

It is a way lot easier to install linux if you have a fresh system. Then you can easily create all the partitions and file systems that you need and install you various OSs on them.
Problem is, generally vendors ship their PCs with a single ntfs partition containing WinXP. Now, when you try to install linux using the free space on this partition, you will need some extra steps before you can really start off.
Irony is that WinXP doesn't ship with any free partition resizing tool. Other variants like Partition magic are too expensive. New users are generally turned off by this initial hurdle.

Here let me show you an easy way to resize your existing NTFS partition and create new partitions to install Ubuntu or any other linux distro on them.

Disclaimer: I don't take responsibilty of any sorts for whatsoever damage that might be caused by following these instructions. Backup all your important docs from the ntfs partition and defrag it before proceeding.
Tools we need: 1 Ubuntu/Linux distro live CD, internet, 1 diet coke

1. Boot your system via the Live CD
2. Locate Terminal (Accessories menu or alt + F2 > xterm)
3. Install ntfsprogs
$ sudo apt-get install ntfsprogs

4. Install gParted
$ sudo apt-get install gparted

5. Run fdisk to locate your ntfs partition (/dev/sda2 in my case)
$ fdisk -l

6. Make sure the ntfs partition is umounted (replace sda2 with your drive)
$ umount /dev/sda2

7. Run gParted
$ gparted

8. Select the ntfs partition and click on "resize"

9. In the resize dialog, move the slider to the left to reduce the existing size

10. Now with your recovered space, create new partitions. Select the free space and click on "new"

11. Typically, you would need 2 partitions. 1 ext2/ext3 primary partition for the "/" and 1 swap. Swap partition should be atmost 2 * your Ram.
Once you have created these 2 partitions, you are ready to roll. Start your linux installation as usual and select these partitions to install your linux and set as swap respectively. You can create additional partition for "/home" etc.
Do rember to check the "/" label partition as primary.

12. Click "apply" to commit your changes. Sit back, drink your coke and wait for the resizing to complete.

If you want to try a non-gui approach, use ntfsresize that comes with the ntfsprogs package. Read this for more details - Resize NTFS partition using ntfstools on Ubuntu Linux Live CD

No comments: