Dual boot, Windows and Centos

Associate
Joined
12 Jan 2010
Posts
104
I am preparing my next built, and hoping to setup a dual boot. What's the easiest way to get this done? Should I get 2 SSDs? Any advice would be welcome!
 
It's easiest to use two individual drives. Also safer.

Each OS has a boot loader. Which is installed in an MBR. Windows boot loader only sees Windows. Linux boot loader (Grub) features "chain loading" which means it can boot, see the Windows boot loader and then hand off boot loading to the Windows MBR if you select the Windows install.

If you install each on separate disks, just make sure that you set the disk with Linux installed on it to boot first in BIOS so that the chain loading functionality works. As I said, Windows can't (or intentionally by design won't) do it. It's possible to make the Windows boot loader see Linux installs, but it requires a lot of registry hacking and stuff, it's just much easier to change the boot order of the disks in BIOS.

That's the way I used to do it, and it would be the way I'd do it now if I still dual booted.

You can always install both on the same disk, but at the end of the day, Grub still ends up dominating the MBR so that chain loading (and single disk dual booting) works. But then you have multiple partitions on the same disk and there's a danger of over writing or losing data if you're messing around / experimenting and pass the wrong command. Sure you can still do the same if you're using two disks.... but it's easier to remember that sda = Windows disk and sdb = Linux disk than sda1 = Windows partition and sda2 = Linux parition.
 
Alternatively if you are using one drive the situation is quite a bit better with the newer EFI/UEFI system with the drive partitioned as GPT instead of MBR... In that case you can have an actual 3rd party boot-loader which can be used to select which OS you want to boot (and a host of other options)... I personally use a boot manager called "rEFInd" which has been working really well... usually I do it like this:

1. Install windows - it's easiest to do that part first, since as mentioned above any windows boot stuff is going to be limited and so we don't care about clobbering it

2. Use a Linux liveCD (Gparted or otherwise) to shrink the partition Windows was installed onto to create space for your Linux install

3. Install your Linux distro of choice into the space you just created - in doing so the Windows boot loader will get overwritten as described above and you won't be able to boot into Windows (temporarily)

4. You then need to install rEFInd - I think they provide a way to do it via a live CD/USB, but you can also install it through a package manager in the Linux distro you just installed

5. rEFInd has a setup script or something which is clever enough to examine the partitions on the drive and locate any which are bootable, as well as what OS they represent, and it'll use this to build its little graphical menu (you can tweak it further if you want to adjust what appears etc.)

That's it... dead easy to do... By default rEFInd assumes you want to re-boot in the same OS you were last using (unless you interrupt it during the 10 second countdown it gives), but I think it can be customised to do something different if you prefer (I think a lot of users make it so a reboot in Linux will switch to Windows and visca-versa)

Edit: Just to say if I were to add a step 6. it would be that as soon as I've done that - my 2 OS and bootloader, I usually boot again into CloneZilla and take a disk-image which I can use to restore to a blank slate if I decide I want to in the future. Since CloneZilla skips blank sectors on the disk I usually find this bare minimum install doesn't require a particularly large image to hold it all (I can't remember how much but I think it's like ~10Gb - 20gb at the very most) - stick that onto a portable hard-drive or in my case CloneZilla can write it straight to an NFS store on my NAS for safekeeping...
 
Last edited:
Guys thanks a lot for all the info, had to read a couple of times to digest it! I am inclined for the 2 disk solution, it seems cleaner in my head at least :)
 
Or consider using one os in a virtual machine hosted by the other. If you are using windows for games then let it host so it gets the native graphics card access.

That way there is no issues with wiping an install by mistake.
 
Back
Top Bottom