Installing Ubuntu on Laptops with single NTFS partition with Windows XP or Vista
Installing Ubuntu on a fresh system is very easy. It is easy on computers that already have Microsoft Windows XP or Vista already installed provided the hard disk has multiple partitions. Laptops that come with Windows XP or Windows Vista pre-installed has a problem in that they normally have only 1 partition (with a second hidden partition storing recovery data). Windows does not allow you to resize the partition on which you have the operating system. So how do you install Ubuntu in such a situation.
In the case of a new system which does not have any operating system installed the process is very simple. In fact it is one of the simplest of all Linux installations. You just boot from the Ubuntu Live CD, select 'Start or install Ubuntu' from the boot menu, boot into the OS, double click on the Install Icon and follow the simple instructions. The only real decision you have to take would be the size of the partitions. Default values should be fine mostly.
Installing Ubuntu on a computer that already has windows XP or Windows Vista is again easy if there are multiple partitions in the disk. All you have to do is to empty one of the partitions by moving files from that partition to another partition and then deleting the partition from the disk manager and then boot from the Ubuntu Live CD and install. Ubuntu will identify the free disk space and install on to the free space accordingly.
The story is slightly different in the case of Laptops and desktops that come with Windows XP and Windows Vista pre-installed. By design or by accident OEM PC and Laptop manufacturers partition the disk into one big partition but for the small recovery partition where they copy the recovery data and install Windows on to it. What they have achieved in this process is not just easy recovery process but also difficult Linux installation.
Ubuntu installation in such cases is still possible but a slightly more longer procedure is needed. Before installing Ubuntu you have to resize the NTFS partition on which the Windows XP or Vista has been installed. Resizing a partition is a two step process. The first step is to resize the file system. This can be done easily with the help of ntfsresize. In dapper this comes with ntfstools package, in edgy it was transitioned to ntfsprogs and in gutsy it comes with ntfsprogs.
Boot into the Live CD. If the required package (ntfstools/ntfsprogs) is not present in the live CD, install it with apt-get. for example for ntfstools
sudo apt-get ntfstools
Using ntfsresize is again simple. Run the following to find out how small can you actually resize the NTFS filesystem to. If your NTFS partition is not /dev/hda1 replace it with the correct device name.
sudo ntfsresize -if /dev/hda1
Now select the size of the partition that you would like to maintain for the NTFS partition and then set this size for the filesystem. Add atleast another 5-15GB free space to the smallest size found from above for the the NTFS partition for use in the Windows OS. Running the following command will resize the NTFS filesystem for you.
sudo ntfsresize -f -s 15G /dev/hda1
Assuming that you did not get any errors in the above process you have successfully resized and shrunk the NTFS filesystem. At this point you can reboot the system (into Windows) and check to see if your filesystem resize was successfully done.
Now the next part is resizing the partition. Boot back into Ubuntu Live CD and you can resize the partition with GNU Partition Editor - gparted. You can access the application from the System >> Administration menu. Alternatively you can use fdisk to delete the existing partition entry from the partition table and create a new entry with the new shrunken size. When you are resizing the partition make sure that the starting cylinder is the same as the original value and also you add around 100MB to the size of the filesystem as the size of the partition.
Make sure that the process was successful by booting into Windows and running chkdsk on C drive.
If everything was fine then boot using the Ubuntu Live CD and install Ubuntu into the newly created free space. If you have any questions regarding this process please use the comment form below to get in touch with us. If you stay in or around Trivandrum give us a call and we can guide you through the process. Additionally if you would prefer to have a service engineer do this for you, give us a call and we will be glad to provide you with this service. Also if you are buying your laptop from Zyxware can get Ubuntu installed on your laptop for free by us.
References:
Resizing NTFS partitions using ntfsresize
ntfsresize man page