0

First of all, I am total linux noob, so do not judge. I needed Ubuntu for dual-boot, and since I knew that I would not use it that often, I installed it on my other drive. The goal was to not have any GRUB popping up on every PC startup, I just wanted to go straight into Windows, unless I press F8 to go to boot selection and choose HDD when I need Ubuntu (not changing boot priority). Honestly, it is just for one game (kerbal space program anyone? :D) and trying Ubuntu out before installing it on my dads very old computer that is slowly dying, and give it some fresh air.

I have one SSD as my windows drive, and one HDD for storage. I did not want the Ubuntu installation even look at my windows SSD under the installation.

  1. I created a new partition on my HDD for Ubuntu (in windows),
  2. Disconnected the SSD
  3. Booted to LiveCD from a USB and installed Ubuntu on the storage HDD with 2gb swap area and root partition
  4. Selected /dev/sda for boot loader installation

I thought that this should work just fine, and it did until I plugged my SSD back in. I assumed that the boot priority would be the same as before, 1. SSD 2. HDD, but instead to boot from the SSD, it went straight to Ubuntu. When I entered bios to check what's up, there was no SSD in the boot priority list, just the HDD. However, the SSD showed up in the boot menu. So I could boot windows manually. What I did was to disconnect the HDD, boot with just the SSD plugged in, reconnect HDD. Now, only the SSD was in the boot priority list, but both of my drives were in the boot menu thing. What? This accomplished my goal, though. I would boot straight into windows unless I press F8 and select to boot the HDD instead. But it would be nice to have boot priority working. Should I install the ubuntu bootloader on the Ubuntu partition instead? If so, how do I remove GRUB from the HDD, assuming I remove Ubuntu as well. Since SSD MBR works just fine, I don't need any mbrfixes. All of the guides I have seen are just about fixing windows loader that has been goofed by Ubuntu installation. Or am I just completely wrong? :D

  • Sorry, my fault. It is UEFI. So this would not work with UEFI? If I did this, or os-prober together with the grub edit suggested below? Would that be possible? – SputnikPrime Apr 12 '15 at 13:29
  • I am not as familiar with the UEFI. I am not sure if it will work. – user68186 Apr 12 '15 at 16:54

2 Answers2

0

Personally, I think it would be better to have both OS's installed on the same drive, and have that drive be the one that boots. Then boot and when GRUB asks you to choose an OS, make a note of how many spots down the Windows option is but boot Ubuntu.

Once you're in Ubuntu, open a terminal and make it so that you can change the grub file by using the command:

sudo chown me:me /etc/default/grub

Now open it for edit in the terminal with:

sudo nano -b /etc/default/grub

Using arrows, go to where it says GRUB_DEFAULT and change the number after it to be how many spots down the Windows boot is, minus 1. (So if it were 3 spots down, you would use 2, for example.) Now, go to where it says GRUB_HIDDEN_TIMEOUT and change the number after that to 0. Below that, it says GRUB_HIDDEN_TIMEOUT_QUIET, change it so it says "true" after that. (Make sure you're not taking away the colons between each selection and what I've told you to enter, and that you are replacing what was there previously not simply adding to it. That may seem fairly obvious, and you may feel the clarification is unnecessary, but I don't want you accidentally screwing up your grub file beyond repair simply because I was not clear enough.) Now hit Ctrl+X and it will ask you if you want to save. Hit "Y" and it will ask you for a file name to save as. Just hit "Enter". Now you will need to run a final command to finalize this:

sudo update-grub

Now, it should automatically boot into Windows without the GRUB folder showing, and if you ever want to boot Ubuntu instead then as your computer turns on (before it is starting to boot an OS) hold Shift and keep it pressed until the GRUB options show up. You will be able to boot Ubuntu from those GRUB options.

I think this would be the easiest way for it to automatically boot Windows, but have Ubuntu available. I think it's much better than having the two installed on different drives.

  • Did not know that this was possible, but I can not use it atm. My windows drive does not have a lot of free space left (it is a 256gb SSD). And my light use of Ubuntu is not worth the hassle if something went wrong with my windows drive. Maybe I am just too paranoid. However, I will do it this way for my next, proper dual-boot installation that I would actually use. Thanks! – SputnikPrime Apr 12 '15 at 13:09
  • Whereas if done properly, this would not mess up your Windows drive, I completely understand your hesitance. If you're new to Linux/Ubuntu, and there's something you're unsure about, it's best not to risk use of anything super-important. I'm glad I could be of help though! I hope you bookmark this for when you do get that next dual-boot installation up! You're welcome! – Colonel Trogdor Apr 12 '15 at 13:28
  • So I have reinstalled Ubuntu, this time on Windows drive, and tried this grub edit. It did not work very well :D The only thing I had to change was GRUB_DEFAULT. Other than that, everything else on default was the same as you told me to change it to. After playing around a bit, I tried swap the numbers of GRUB_HIDDEN_TIMEOUT and GRUB_TIMEOUT. Then, when I was spamming Shift, "Grub loading" popped up but nothing happened anyway. After searching a bit, I found a simple fix. In /etc/grub.d/30_os-prober change quick_boot="1" to quick_boot="0". Then it works as intended :-) – SputnikPrime Apr 14 '15 at 15:47
  • My sincere apologies that there was another step you needed to do on your system. I've had it set up that way (to boot Ubuntu unless I hit shift at the beginning) for a while now and forgot about the 30_os-prober file. I'm glad you got it to work as intended! – Colonel Trogdor Apr 14 '15 at 18:44
0

As you mention in a comment that your computer uses EFI, you should be aware that BIOS assumptions (which you used in your installation plan) often fail miserably on EFI-based computers. Contrary to what most people seem to think, EFI is a completely new boot system, not some minor tweak or add-on to BIOS. That's one reason why I cringe every time I see somebody refer to an EFI as a BIOS, or even as an "EFI BIOS;" referring to an EFI as a BIOS encourages applying BIOS assumptions where they don't belong.

That said, most EFI-based computers include a Compatibility Support Module (CSM), which enables them to boot just like BIOS-based computers. Thus, even an EFI-based computer might be booting in BIOS/CSM/legacy mode, so what I wrote about BIOS assumptions not applying might be completely wrong for a specific computer that's configured in a particular way. You must assess your actual boot mode to determine whether this is the case. See this page for details. In brief, though, if the /sys/firmware/efi directory exists under Ubuntu, Ubuntu is booting in EFI mode; if it's absent, you're booting in BIOS/CSM/legacy mode. Under Windows, boot mode is tied to partition table type; if the disk uses GPT, you're booting Windows in EFI mode, and if it's MBR, you're booting in BIOS mode. Note that you might be booting one OS in one mode and the other OS in another mode. Such a cross-mode installation complicates things a great deal.

Assuming you're booting both OSes in EFI mode, to achieve your desired goal, you must boot one OS and create an NVRAM entry for the other OS. In Linux, you can do this with the efibootmgr tool. Unfortunately, I don't know of a good and comprehensive tutorial about it. You can read its man page (man efibootmgr) or read how to accomplish various specific tasks on various sites, including this one:

Search and you'll find more.

I'm less familiar with Windows tools, but you might look into the third-party EasyUEFI, which is a GUI tool for managing EFI boot entries.

If you're booting both OSes in BIOS mode, my suspicion is that you're running into subtle differences between the way a true BIOS and your EFI's CSM are detecting bootable disks. I've run into this myself; CSMs tend to be less thorough in creating BIOS/CSM/legacy-mode boot entries than do BIOSes. If so, your best option is probably to rely on GRUB. Yes, I know you say you don't want to do that, but you can configure GRUB with a short timeout and to boot Windows by default, as described in this question and answer.

If you're booting one OS in BIOS/CSM/legacy mode and the other in EFI mode, I strongly recommend that you re-install or re-configure so that they're both booting in the same mode. Cross-mode configurations are awkward at best, so I don't recommend you use them unless you must and you're an expert. Update your question with details, or better yet, post a new question with details, if this is the case.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • Well, I have not thought about it. Rather I did not know that running two different modes would create problems, especially when they are on two separate drives. I did reinstall Ubuntu, as it was a fresh install anyway, this in the correct mode. But it did not fix it, I still can't see the Ubuntu drive in my boot priority list. So I guess there is something else that is causing it. Cba trying to fix. It's not a big deal, I can live with it. But thanks for the help! I've learned something new :-) – SputnikPrime Apr 12 '15 at 15:51