Dual Boot
This page has been migrated to a document on Free Geek's Google Drive. Information remaining behind may no longer be relevant. MIGRATOR: When you have tagged this page as migrated, (Link to new page immediately below.) |
editting Dual Boot
This page provides help setting up a dual boot environment with Ubuntu and Windows. Since we do not support Windows, this document will not provide help setting up Windows (beyond specifying the partition to install it to). It also does not deal with Windows bootloader as a means of selecting the boot OS.
We avoid Ubuntu's "side-by-side" installation method--except in a specific instance--because running linux using the ntfs-3g driver is as slow as running it off of a FAT32 filesystem.
Filesystem and Size Information
This is something you will want to get from the user when they bring their box in or over the phone. You will use this information to write down a note to yourself such as:
Win7, 40GB
Ubuntu, 40GB, ext4
Storage, 20GB, ext3
The minimum recommended size for an Ubuntu partition is 5GB (5120MB). This gives you all the room you need for core programs plus some extras to be installed later by the user. This does NOT include the recommended 10GB+ for the /home folder.
If your user is only rarely going to use Ubuntu for officework or if they are going to use only Windows (and are keeping Ubuntu around as a backup OS that they have tech support for), I recommend reserving 9GB (9216MB) for Ubuntu and giving the rest to Windows.
If they are going to use both alternately, I recommend assigning 40GB (40960MB) to Windows, 9GB (9216MB) to Ubuntu, and any extra space to a separate storage partition.
If you are using Lucid, you want an ext4 filesystem for Ubuntu. For Hardy, you should use ext3 for compatibility.
Windows has been using ntfs natively since NT, and there is no good reason to use FAT32 anymore unless you're installing 98 or below.
If you have one, you should format the storage partition with ext3. ext3 has good rw function on Windows using open-source, community-written drivers like those found at http://www.ext2fsd.com/ that work well all the way down to Windows 95 and all the way up to Windows 7.
Setting Up Dual Booting
From Scratch
Only use this method if you want to install from scratch/wipe the drive
This method will go the quickest for blank hard drives or those with a fresh install of Ubuntu. However, you may find it to be the easiest even for a drive that has a customer's data on it.
WARNING: Back up the user's /home folder before using this method with a drive that has personal data on it. You will copy this data back onto the Ubuntu partition at the end of this method.
- Boot off of the liveCD for the version of Ubuntu we will be installing.
- Choose to install Ubuntu.
- When prompted to select a partitioning scheme, opt to set one up manually.
- Delete all partitions on the drive.
- Create a new primary partition in the unallocated space for Windows.
For Vista and 7 only, leave 110MB unpartitioned at the beginning of the drive (edit where the partition starts).
If it is easier, you can switch to another terminal using ALT+CTRL+F1 and use sudo fdisk /dev/<whole disk>
where <whole disk> is the name of the hard drive without the partition number. For example, if your Ubuntu partition is sda3, the whole disk is sda.
Make sure the format box is unchecked.
- Create a new primary partition in the unallocated space for Ubuntu to reside in and give it the amount of space you wrote down MINUS 2GB (2048MB).
Make sure the format box is checked. Set this partition to mount as / We will use the extra 2GB for swap in a moment.
- Create a new primary partition using all of the unallocated space and make it extended.
- Create a new partition in the extended space and give it 2GB (2048MB).
Make sure the format box is checked. The filesystem will be swap.
- If you are going to create a storage partition to use the rest of the unallocated space, do so now, in the extended area.
Make sure the format box is checked. Set this partition to mount as /home
- Hit okay. THIS WILL WIPE THE HARD DRIVE. The new partitioning scheme should show up as you preferred one.
- Hit next to install Ubuntu as normal.
- If applicable, copy the user's /home folder back onto their drive via the backup machine
The user will now be reaponsible for installing Windows on their own. Make sure you let them know that they are to use the Windows CD to create a new partition in the unpartitioned space, format it, and install.
Afterwards, Windows will use its own bootloader and assume it is the only OS on the drive. For users that only want to use Windows, this is fine. Just make sure that they remember to tell the staff that they have a hidden Ubuntu install if they ever bring in the computer for support. For users who want to dual boot using the Windows bootloader to choose their OS, they are on their own. For users who want to use grub to choose their OS, they will have to bring their box back in after they install Windows. At this time, refer to the section Reinstalling Grub below.
Resize Method
Use this method if you have Ubuntu installed and have at least 40GB of free space on Ubuntu partition.
This method is for users who have been using Ubuntu and now want to start using Windows as well. It preserves their Ubuntu install and personal data exactly the way they are; it only takes space from Ubuntu and allots it to a fresh install of Windows.
- Download and burn a LiveCD (or write a bootable USB stick using unetbootin) of gparted: http://gparted.sourceforge.net/
- Open the partition editor.
- Select the Ubuntu partition and select resize.
- Enter the new size.
- Apply.
- Shut down.
The user will now be reaponsible for installing Windows on their own. Make sure you let them know that they are to use the Windows CD to create a new partition in the unpartitioned space, format it, and install.
Afterwards, Windows will use its own bootloader and assume it is the only OS on the drive. For users that only want to use Windows, this is fine. Just make sure that they remember to tell the staff that they have a hidden Ubuntu install if they ever bring in the computer for support. For users who want to dual boot using the Windows bootloader to choose their OS, they are on their own. For users who want to use grub to choose their OS, refer to the section Reinstalling Grub below.
Side-by-Side Method
Use this method to install Ubuntu on an existing Windows partition.
This method is for users who have been using Windows of their own volition and now want to use Ubuntu again for whatever reason. It is recommended only if they have assigned their full drive to Windows already.
- Boot off an Ubuntu LiveCD and opt to install.
- For partitioning options, select "side-by-side" install.
- The rest should be automated. You can reboot after the install finishes and enjoy a dual boot environment.
Reinstalling Grub
This section has instructions for using an Ubuntu LiveCD to add a Windows boot option to grub and restore grub to the MBR.
For only instructions on how to add a boot option under Hardy, see: https://help.ubuntu.com/community/MultiOSBoot under Changing Main GRUB Boot Menu Settings For only instructions on how to add a boot option under Lucid, see: http://ubuntuforums.org/showthread.php?t=1195275 sections 5, 6, and 7 For only instructions on how to restore grub to the MBR, see https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows For only instructions on how to automatically mount Windows partitions, see: https://help.ubuntu.com/community/MountingWindowsPartitions
WARNING: It is NOT recommended to talk a user through this over the phone. Since we use commands that could potentially erase their system should they mistype something (fdisk) or make them unable to boot (grub-install) and edit files that change mount points permanently (fstab) and the boot list permanently (menu.lst), it is only safe to do this at Free Geek.
- Boot off an Ubuntu LiveCD in "try it" mode
- Open a terminal
- So that you're sure of your partitioning scheme, do:
sudo fdisk -l
- Do the following to access the Ubuntu installation on the drive:
sudo mkdir /ubuntu sudo mount /dev/<ubuntu partition> /ubuntu sudo mount -o bind /dev /ubuntu/dev sudo mount -t proc proc /ubuntu/proc sudo chroot /ubuntu /bin/bash
For that terminal window only, you will now be inside the Ubuntu installation on the hard drive. You have just changed the location that terminal sees as / to the location we mounted the Ubuntu partition on the hard drive. In other words, it is as if you have logged onto the Ubuntu installation on the drive and opened a terminal. This is necessary because we need to generate an accurate list of mountpoints in /proc/mounts and because we will need to call the grub installation on the hard drive. From now on, the password you will use for sudo will be the one you set during the installation.
- Lucid only: Refer to http://ubuntuforums.org/showthread.php?t=1195275 sections 5, 6, and 7 for directions on adding Windows as a boot option
Do NOT follow the instructions in section 13 of that FAQ.
Make sure you sudo update-grub
after this.
- Hardy only: do
sudo nano -w /etc/default/grub
and add the following lines between## ## END DEFAULT OPTIONS ## ##
andtitle Ubuntu
:
title Windows root (where /boot resides) makeactive chainloader +1
(Where /boot resides) refers to a location such as (hd0,0), which means "first hard disk, first partition." IDE drives and SATA drives are both called hd in grub. For example, /dev/sda1 is (hd0,0) and /dev/sdb3 is (hd1,2).
- Refer to https://help.ubuntu.com/community/MountingWindowsPartitions for how to set the windows partition to mount automatically when Ubuntu starts
- Before overwriting the MBR, we need to make sure grub knows where the partitions in its list are:
sudo cp -fv /proc/mounts /etc/mtab
- We can now install grub to the MBR:
sudo grub-install /dev/<whole disk>
where <whole disk> is the name of the hard drive without the partition number. For example, if your Ubuntu partition is sda3, the whole disk is sda.
- Reboot and enjoy! (Remember to remove the LiveCD.)