ContentsBRTableOfContents(2) |
Before you Start
attachment:IconsPage/important.png Before you start fiddling with your partitions, you should make sure that you have ALL IMPORTANT data backed up, preferably on a secondary hard drive (internal or external), a USB flash drive, or a CD-R or DVD-R. Although it is not common for problems to happen during the partitioning process, it is still possible. Actually, the primary cause of data loss is you! Users sometimes get confused and end up deleting the wrong partition, or just forget to backup their family photos and favorite music before they delete partitions. If at any point during this process you get confused or concerned, STOP and ask for help. The best place for this is the [http://ubuntuforums.org Ubuntu Forums].
This guide is designed primarily for users who have a dual boot that now want to fully escape Windows and go purely Ubuntu.
Using the LiveCD to Remove the Windows Partition
attachment:IconsPage/cd.png There are other partition editors available, but GParted is this documentor's favorite and is already available to you if you have an Ubuntu [:LiveCD]. You can also use the [http://gparted-livecd.tuxfamily.org/ GParted LiveCD].
attachment:IconsPage/IconNote.png Please note that although you can install GParted inside your Ubuntu installation, you will be unable to resize your root partition without a LiveCD since you cannot change a partition that is mounted.
Boot the Disc
attachment:IconsPage/IconCDrom.png Place the LiveCD into your CD/DVD drive, and reboot the computer. Each computer is different, but you may need to change your BIOS to have the system boot from the CD drive before the hard disk. Refer to your computer manufacturer's documentation for this.
Run GParted and Locate Windows
attachment:IconsPage/navigate.png On the Ubuntu LiveCD, go to System->Administration->Partition Editor. If you have more than one hard drive on your computer, choose the correct device from the drop down box in the upper right hand corner of the window. Your windows partition will most likely be formatted as NTFS and have a boot flag, which makes it easy to locate. Again, if you are unsure, don't delete it!
Deleting the Windows Partition
Select the correct partition, either from the bar graph representation of your disk, or from the list. Now if you are sure that you want to proceed, press the Delete button at the top with the trash can icon, or right click the partition from the list and choose Delete. When you are finished, click the Apply button.
You will now be asked if you are sure you want to apply the pending operations. After reading the suggestion, click Apply.
Use the Newly Freed Space
Now that you have a section of unallocated space, you can either format it as the filesystem type of your choice to use as a data partition (or something else), or you can resize an adjacent partition to use this space.
Resizing an Existing Partition
Right click the partition that you want to expand into the empty space and select Resize/Move. You can use either the number sizing, or you can graphically drag the arrows on the visualization into the empty space (the numbers will adjust automatically). When you are finished, click the Resize/Move button, then Apply in the GParted window. Again, read the prompt and click Apply. The operation may take awhile, depending on the size of the partition - DO NOT interrupt this process, or you risk losing everything on the partition you are resizing.
Creating a New Partition
If you choose to simply use the newly freed space as a new partition, select the unallocated space and click the New button (or right click). Choose which filesystem you want, then click Add, then Apply, and Apply again.
Since you are not using Windows on this system anymore, ext3 is probably the best choice for your new filesystem. If you plan on sharing this drive with Windows (maybe you have Windows on another drive on this computer), NTFS or FAT32 may be easier to share with.
Reboot
attachment:IconsPage/IconBoot.png You can now reboot your system - go to System->Quit->Restart. Don't forget to take out the LiveCD at the beginning of the boot sequence since you can't remove it while the disc is being used and you don't want to load it again.
Further Operations
Edit GRUB
attachment:IconsPage/IconDevelopment.png Once back in your install, you will probably want to remove Windows from your GRUB menu. Using root privileges and your favorite text editor, open /boot/grub/menu.lst
In Ubuntu, run:
gksudo gedit /boot/grub/menu.lst
In Kubuntu, run:
kdesu kate /boot/grub/menu.lst
Or for a terminal interface, run:
sudo nano /boot/grub/menu.lst
Now scroll down into the file to where it says something similar to
### END DEBIAN AUTOMAGIC KERNELS LIST # This is a divider, added to separate the menu items below from the Debian # ones. title Other operating systems: root # This entry automatically added by the Debian installer for a non-linux OS # on /dev/sda1 title Microsoft Windows XP Professional root (hd0,0) savedefault makeactive chainloader +1
You can place a # in front of each line to "comment out" these entries. If you are comfortable with deleting the entries, you can also do that. After you you save and close, these entries will no longer be available at the GRUB menu.
Edit /etc/fstab
attachment:IconsPage/IconDevelopment.png If you made a data partition, you can have it automatically mount by adding the correct entry to fstab, which you can edit using root privileges.
In Ubuntu, run:
gksudo gedit /etc/fstab
In Kubuntu, run:
kdesu kate /etc/fstab
Or for a terminal interface, run:
sudo nano /etc/fstab
You may also need to change UUIDs in your fstab file if they changed (perhaps due to partition resizing). To see the UUIDs for your partitions, run one of these two commands:
sudo blkid sudo ls -l /dev/disk/by-uuid
For more information regarding fstab, see [:Fstab].
Other Resources
attachment:IconsPage/IconBook-small.png
- [:LiveCD]
- [:Fstab]