Install Windows on secondary hard drive after Ubuntu is installed

Hi experts,

I've just replaced my notebook hard drive with an SSD an I'm going to get an optical drive caddy to put my old HDD back in for extra storage. There are a few (very rare) instances where I need to boot in to Windows so I have it installed on the first partition of my old HDD. When I get the caddy how can I set up grub etc to ensure that Ubuntu on the SSD loads by default but Windows is still available from the HDD?
LVL 10
mstrelanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

torimarCommented:
I assume you are running a more recent Ubuntu (9.04 or newer) with Grub2 as bootloader?

Then there are basically two possible methods:

1. Let the Grub OS-prober autodetect the Windows installation

--- make sure the Windows drive is connected and running
--- in /etc/default/grub make sure "GRUB_DISABLE_OS_PROBER=false" is set; if true, set it to false.
--- then run 'sudo update-grub'
--- if no joy, reboot, run 'sudo os-prober', then 'sudo update-grub'

If still no success, try method

2. manually insert the Grub menu entry

--- in /etc/default/grub make sure "GRUB_DISABLE_OS_PROBER=true" is set; if false, set it to true.
--- open the file /etc/grub.d/40_custom
--- add the following text:
menuentry "Microsoft Windows XP" {
        set root=(hd1,1)
        chainloader +1
}
--- save and run 'sudo update-grub'

You may first want to make sure, by running GParted on Ubuntu, that the system actually sees the Ubuntu drive as the first, the Windows drive as the second one. If not, the code above needs changing to "set root=(hd0,1)"

All this presupposes that the Windows drive, when connected the way you intend to, will be considered bootable; but I don't see why it shouldn't be.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WolfhereCommented:
Ubuntu has no problem with reading another drive and its files (Windows in this case). You just need to know what it is identified by. Using partition manager (gparted) you can see your old drive (sdb1, sdc1, etc). Then mount : sudo mount /dev/sdb1.....

As for setting up your grub - https://help.ubuntu.com/community/WindowsDualBoot - This is a pretty good guide. Assuming you are on 10.04
mstrelanAuthor Commented:
Sorry people, I'm still waiting for my optical drive caddy to arrive in the mail so I can't accept a solution just quite yet. Should be soon
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.