16

I have an old Vista laptop that I partitioned and installed Ubuntu on, with dual-boot. I've now decided to switch entirely to Ubuntu. What's the best way to achieve this?

My current partitions:

+-------+--------------------+---------------+------------------------------+
| WinRE | C: (dual bootable) | D:            | Extended                     |
|       |                    |               +-----------+------------------+
|       |                    |               + Ubuntu    | Swap             |
+-------+--------------------+---------------+-----------+------------------+

I'd like to change this to:

+-------+-------------------------------------------------------------------+
| WinRE | Extended                                                          |
|       +------------------------------------------------+------------------+
|       | Ubuntu (bootable)                              | Swap             |
+-------+------------------------------------------------+------------------+

(I'd like to keep the Windows Recovery partition in case I ever want to sell the laptop).

I'm not sure whether the Ubuntu partition currently has a boot-loader on it. I also don't want to lose my Ubuntu installation/data. (I'm happy to trash the Windows partitions completely - I have backed everything up from those).

Update: Having checked my bootloader, I've deleted the Windows partitions and I now have free space. Unfortunately it looks like I can't resize the existing / (root) partition because it's mounted. Can I get around this, or do I have to re-install?

6
  • What is windows Recovery partition? Nov 1, 2010 at 10:33
  • It's basically a recovery disk for Windows, but held on the hard-drive. You can boot into it and it will reformat and reinstall Windows.
    – stusmith
    Nov 1, 2010 at 11:04
  • Before you do anything with your partitions please check exactly where your Grub2 is installed. Most Information you can get from running this script: sourceforge.net/projects/bootinfoscript. Post the results so that we can give you a more precise answer.
    – Takkat
    Nov 1, 2010 at 12:14
  • @user3940 - will do. I'll check it tonight and post more info tomorrow.
    – stusmith
    Nov 1, 2010 at 12:58
  • @stusmith: I bet you have a backup, have you ;-)?. You can resize unmounted partitions only. Just boot from a live CD and start GParted.
    – Takkat
    Nov 1, 2010 at 22:07

6 Answers 6

9

If you need to expand the current partitions, the new free space after deleting the old Windows partitions should be right next to them. Also this has to be done with a lot of care, otherwise you may screw up the whole system. My advice is to delete the Windows partitions and turn them into EXT4 partitions which you can use from Ubuntu to store stuff, like movies, etc.

For this you need to use the utility called GParted. Install it from the Software Center if you haven't installed already. When you start GParted, it lists the partitions in your hard disk. They will be denoted in \dev\sda1 etc. You may be able to easily distinguish the Windows partitions from their file systems and mount points.

Delete the Windows partitions using the menu which appears when you right click.

The partition will now be marked as an unallocated space. Right click again and choose New. Choose the format you want to partition it into and click on the Apply All Operations tool button.

Read this tutorial if you're new to GParted.

3
  • I did have a look at gparted, however: (a) I'd like to increase the size of / as it's a little small, and (b) the bootloader is actually on the "C:" drive - so if I wipe that I won't be able to boot. I guess part of my question is "how do I install a suitable bootloader on my existing / partition? And does it go on the ext4 bit or the overall extended bit?"
    – stusmith
    Nov 1, 2010 at 11:07
  • Don't worry, Ubuntu boots nicely from ext4, be it on extended partition or not.
    – Extender
    Nov 1, 2010 at 11:18
  • @stusmith: your worries are entirely correct, see above. /ext4 is needed for Grub2.
    – Takkat
    Nov 1, 2010 at 12:18
6

In standard installations GRUB is probably not located in Windows partitions but it would be wise to check this first by running the BootInfo script before you end up with an unbootable machine after having deleted a partition.

Once you have backuped all your important data you can then boot from a LiveCD and start GParted as mentioned already. Note that deleting or resizing partitions is possible for unmounted partitions only.

1
  • 4
    ...and note that LiveCD automatically mounts swap partitions, so you'll need to 'swapoff' (using gparted) before it will let you move the,
    – stusmith
    Nov 4, 2010 at 11:41
1

Your bootloader (GRUB2) is really not in C: but in /dev/sda. So you can go ahead and delete windows partitions in gparted, booted from Live-CD. Check that Ubuntu will boot. After that, boot LiveCD again and grow your Ubuntu / partition via mouse in gparted.

6
  • 1
    @Extender: you don't really know yet if Grub is installed in /sda or somewhere else.
    – Takkat
    Nov 1, 2010 at 12:16
  • I turn telepathic mode on :) Seriously, what another place of GRUB may be? If Ubuntu was installed after Windows, and dual-boot is working now? BTW, I have similar configuration on my notebook.
    – Extender
    Nov 1, 2010 at 14:58
  • 1
    @ Extender: Telepathic mode - that's a good one. Most likely you're right with /sda but what would be if not? I've seen quite strange locations for grub. IMO a major advantage of grub is to be able to put it almost anywhere. Better double check things before making changes to partitions ;-)
    – Takkat
    Nov 1, 2010 at 15:50
  • 1
    You are right. He must sudo grub-install /dev/sda for sure under Ubuntu session.
    – Extender
    Nov 1, 2010 at 16:09
  • How do you delete a partition from a LiveCD??? Nov 1, 2010 at 22:14
0

Whichever method you use to accomplish this, you run a risk of losing some or all of your data. I think the least risky option is firstly to do a backup (eg rsync), followed by some sort of verification. Then perform a fresh install, creating whichever partitions you require. Then restore your backed-up data. Lastly reinstall your full complement of packages (perhaps using aptoncd; it should be available in the repositories).

0

Regarding backups: If you have some extra space available on another external disk, the most robust option would be to make a full disk image using CloneZilla before you start tweaking anything. After that, you can reformat the NTFS partition as ext4/reiserfs/whatever and either a) mount that as part of the filesystem by editing your fstab (for automatically mounting) or b) use gparted to expand your existing installation into the empty space. Having a disk image will give you peace of mind; but it takes up a lot of space and time to make one. If you move any partitions around you'll have to reinstall GRUB (the disk sector it needs to jump to in order to boot will have moved.) To do that, as mentioned above, use sudo install-grub /dev/<disk name>. It should update grub automatically, if I recall correctly... If you don't move any partitions, just reboot into your Ubuntu install, and run sudo update-grub to have grub re-scan your disk for bootable partitions (removing the Windows option).

0

Don't make it too complicated. It's very simple...pop in the Ubuntu CD and restart. When you go through the install process, select the option to erase and use all space from your hard drive. It will delete all partitions, reformat and install. It does everything for you. When everything is said and done, it should work like new minus any extra configuration you choose to do.

1
  • OP wants to keep his existing data and recovery partition, not wipe the drive. Oct 27, 2012 at 20:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .