Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There are many threads around about having both OS's but most seem to only refer to using one HDD. I might be wrong. I am currently building a new PC and I want to put Ubuntu on one drive and have Windows 7 on the other, and be given to option on which one to boot from (if possible).
Can I follow the general directions around the internet that state it is usually better to install windows first, then do ubuntu, or would it not even matter.
It's matter. If install windows after ubuntu then mbr will be rewritten on master hdd.
Just install windows first, then do ubuntu. ubuntu will do the rest (add item windows in grub).
Damn, all right that's what I thought was going to happen. I wanted Ubuntu first lol.
When I turn on the computer it will ask me which to boot right?
If you want to install Ubuntu first, that is only a small problem. Windows install will probably trash the Linux connection to the MBR. But there are instructions available to boot again from your Ubuntu liveCD and fix the Linux connection to the MBR.
You can configure things so you would use your BIOS's boot menu to select which hard drive to boot, and each OS would boot from the MBR of its own hard drive.
You can configure things so that Linux owns the MBR of the hard drive that the BIOS boots by default and the grub menu during Linux boot offers the choice between Linux and Windows. If you install Windows first and Linux second, the Ubuntu installer sets it up that way by default so you don't need to "configure" anything. Otherwise, instructions are posted in many places and configuring this isn't very hard manually.
You can configure things so that Windows owns the MBR of the hard drive that the BIOS boots by default and the Windows loader offers the choice to chain load to Linux. That is also a manual setup with instructions available in various places.
To be precise, the Windows installer will overwrite whatever was in the MBR. (without giving you a choice.) Linux plays nice and lets you decide if something should be installed in the MBR.
To be precise, the Windows installer will overwrite whatever was in the MBR.
With one drive, that is true. With two drives, it is probably true, but I didn't want to exclude the possibility that the OP accidentally or intentionally tweaks BIOS drive settings in such a way as to cause the Windows installer to overwrite only the MBR of the drive that won't end up as the default bootable drive.
Without knowing lots of BIOS details and other info, I couldn't tell the OP how to make that happen. I just wasn't totally ruling out the possibility that it could be done without my instructions.
For example, on at least one computer this worked:
1) Install Linux on the first drive.
2) Tell the BIOS to disable the first drive.
3) Install Windows on the second drive, which the BIOS will now tell the Windows installer is the first/only drive.
4) Tell the BIOS to enable the first drive.
5) Edit /boot/grub/menu.lst to add an entry so that grub can reverse the identities of the two drives and chainload to Windows.
So when you select Windows from the grub menu, it boots up thinking it is on the first drive and Linux is on the second. But when you select Linux from the grub menu, it boots up correctly seeing that it is on the first drive and Windows is on the second. You get the added advantage that if you remove either drive, the other is still valid and bootable.
Hmmm---I think Windows seizes the MBR on whatever drive it is being installed on. Windows never asks where to put the bootloader, much less asks your permission to install it at all.
I think I get it. I have two drives and ideally I want drive one to be Ubuntu and drive two to be Windows. I am only going to boot into Windows for gameplay so Ubuntu will be my primary OS for everything else.
So say linux is installed first. I install Windows to the second drive which in turn is going to mess with GRUB and not allow me to boot into Ubuntu anymore. I pop in the livecd and can fix what windows did to the mbr from that? Once that is done I can freely boot into either OS from start-up as I want? Or no?
Say if windows is on first drive, and then I install linux on second drive, the installation from the live cd will work nicely with windows and do the hard work for me? But now Windows will be on the first and ubuntu on the second?
I install Windows to the second drive which in turn is going to mess with GRUB and not allow me to boot into Ubuntu anymore.
If you install Windows to the second drive without disabling the first drive in the BIOS, I'm not sure which MBR Windows will overwrite. If the BIOS lets you disable the first drive during the Windows install, that is a cleaner choice for installing Windows second.
Quote:
I pop in the livecd and can fix what windows did to the mbr from that? Once that is done I can freely boot into either OS from start-up as I want? Or no?
Whether you need to fix an MBR or not after installing Windows, you do need to edit the Linux boot menu to add the choice to boot Windows. That can only be avoided by installing Linux after Windows.
Quote:
Say if windows is on first drive, and then I install linux on second drive, the installation from the live cd will work nicely with windows and do the hard work for me? But now Windows will be on the first and ubuntu on the second?
Regardless of which drive you install Windows on, as long as you install Linux after installing Windows, the Ubuntu installer should see the Windows install and edit the boot menu for you. The Ubuntu installer should also offer you the choice to take over the MBR of the first hard regardless of which drive you install Linux on.
re reading your steps john, how would I go about doing step 5?
I'm not sure these instructions are up to date. They may be assuming an older version of Ubuntu. In that case, hopefully someone with current Ubuntu experience will correct me.
Edit the file /boot/grub/menu.lst
Add the following lines. If you don't have a good understanding of where in the file to put them, the very end of the file is probably OK
Code:
title Windows
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,0)
makeactive
chainloader +1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.