0

I installed a second hard drive (actually a SSD) onto my Windows 7 machine for the purpose of using Ubuntu via virtual machine -- and hated that. So, I tried to install Ubuntu to the second drive and after running boot-repair numerous times I got it running pretty well.

But the GRUB was installed on the C drive, and I don't want to wait the 10 seconds for the GRUB to come up, because I might need to take out the second hard drive and replace the DVD space it is taking. Can't I just boot either straight into Windows, or have the option of Ubuntu or Windows depending on the BIOS setting?

I fixed the Windows 7 boot loader on the C: drive by following the directions on another post, but now I can't seem to get my second hard drive to become bootable by itself, that is, when I set it highest in boot priority.

How do I make the second hard (containing Linux) bootable without having to choose an OS every time I boot up? I'd like my machine to look and behave like a straight Ubuntu machine when the second hard drive is put highest in boot priority, and I'd like my machine to go straight into Windows when the first hard drive is highest. But, I've already installed Ubuntu, and it doesn't seem to boot, even when the priority is set to it. I'm guessing because it previously depended on GRUB?

The only way I can even look at my second hard drive is by booting up via an Ubuntu flash drive. All of the answers refer to GRUB. Isn't there any way to make a drive bootable without GRUB?

It seems that what I'm trying to do is a less-traveled road, but actually a simpler road. Is there a command to make a disk that has Ubuntu already installed bootable?

I ran Boot-Repair again to create a boot-info-summary, here is the report: http://paste2.org/UabY55xE

1 Answers1

0

It appears that you have two HDD's, on one HDD Windows7 is installed and on the other HDD Ubuntu is installed. It also appears that your system is set up in legacy-mode. On the drive where Windows is installed you reinstalled Windows boot-loader in the MBR of the drive already. Now you need to install Grub to the MBR of the drive, where Ubuntu is installed.

To do that you have to boot from a live USB, choose Try Ubuntu, then open a terminal and run the following commands:

sudo mount /dev/sdb1 /mnt
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
sudo chroot /mnt
sudo grub-install /dev/sdb
sudo update-grub
exit
sudo reboot

Note that in this commands sdb1 means the partition, where Ubuntu is installed and sdb means the HDD where Ubuntu is installed. You have to examine your system and change these values accordingly.

After Grub has been installed, boot to BIOS-setup and change the boot-order to the Ubuntu-drive in the first place and the Windows-drive in the second place.

Related: How can I repair grub? (How to get Ubuntu back after installing Windows?)

Edit

The boot-info-summary looks good so far, found a small bug in line 416 (this is related to /etc/fstab and sdb6. Compare with line 516). Fact is, that Grub is now installed in the MBR of the second drive, and when we boot to this drive, Grub should be booted (even if Grub is not correctly configured or, for example, the Ubuntu-partition was deleted), in the worst case it should boot to Grub-rescue.

I think, booting to the MBR of a HDD on the slot the drive is connected to is just not supported by your BIOS. I've been confronted with this on several laptops. Check manual of your hardware if you can find any information. If this is the case, you can't achieve the bootloader-configuration you described, you will need the boot-loader in the MBR of sda and this boot-loader needs to be able to boot both Os's. This is normally Grub.

IF you keep your current partition-layout and install Grub on the first drive (sda) you will boot to Grub-rescue as soon as you removed the second drive because Grub can't find it's configuration-files which are stored on the removed drive. You would need an external DVD which you connect via USB if you need to work with DVD.

The other way around is to change the partition-layout and install both OS's on the first drive (sda), using the second drive as a pure data-storage. This way you are independent from the second drive during boot, you could replace the second drive with your DVD.

However, you can configure Grub in many ways (default-boot, hidden menu,...). The configuration is stored in /etc/default/grub and you can edit this file with root-privileges (i.g. sudo nano /etc/default/grub). Look for the lines with

GRUB_DEFAULT=
GRUB_TIMEOUT=
and change the values for this entries to set the default menu-entry to boot and/or hide the Grub-menu (`GRUB_TIMEOUT=0). See detailed information in the Grub Manual.
mook765
  • 15,925
  • Thanks much for your attention, mook765. I tried the commands, and it didn't quite work. I tried them again, everything except the exit/reboot and I see very clearly there is an error: "grub-install: error: failed to get canonical path of '/cow'." I even retried the command after sudo su, and got exactly the same error. I thought the mounting commands were specifically intended to fix the weirdness that comes with working on a Try-Ubuntu session? If you have any insight as to why I'm getting the /cow error, I'd love to hear it. I really like Ubuntu so far! :-) – Thomas Adkins Mar 29 '17 at 02:00
  • Minor update. After doing a bit more research, I tried inserting the command "sudo chroot /mnt" just before the "sudo grub-install /dev/sdb". This produced what looked like promising results. No error. But when I try rebooting, it still comes up Windows! I've checked and rechecked the BIOS settings at least 10 times. I've even verified using "sudo grub-install --verify /dev/sdb" and I'm starting to wonder if my BIOS works correctly, except that I've never seen a BIOS boot order screw up. – Thomas Adkins Mar 29 '17 at 02:47
  • You are right, missed that command, edited already. Sorry for that. Could you please run Boot-Repair to create a boot-info summary and provide the link to the summary. – mook765 Mar 29 '17 at 10:30
  • I have run boot-repair and the summary is at http://paste2.org/UabY55xE -- Thomas – Thomas Adkins Mar 30 '17 at 02:01
  • I edited my answer, should be clear now... – mook765 Apr 01 '17 at 12:14
  • Thank you so much for explaining as much as you did. I have to accept that it is very likely I cannot just change the boot order of my bios and have it work. This makes some sense -- how many people actually use that feature? What about using a flash to boot to Ubuntu, but then transfer over to the second drive. Would THAT be possible? Or would you suggest I bite the bullet and put GRUB back on the C drive? – Thomas Adkins Apr 02 '17 at 06:11
  • What about swapping the drives? System would boot to Grub then and you can choose OS in Grub-menu. – mook765 Apr 02 '17 at 11:26
  • Here some additional ideas: http://www.techspot.com/downloads/3112-easybcd.html, http://askubuntu.com/questions/139966/how-can-i-add-an-entry-for-ubuntu-to-the-windows-7-boot-menu – mook765 Apr 02 '17 at 11:31
  • Hi mook765, I realize that since my laptop was not sold with a second hard drive, it seems likely the manufacturer configured the BIOS to not boot from a second hard drive either as a security "feature" or bug. I cannot (yet) swap the drives, but I'm now willing to live with the boot screen every time my computer wakes up (because Ubuntu is worth it!). That being said, I ran boot-repair to install GRUB2 and now get the emergency boot screen. I have a paste-bin located at http://paste2.org/cjY6BFfw. Can I fix what is wrong here without reinstalling Ubuntu? – Thomas Adkins Apr 10 '17 at 01:27
  • Reinstall grub to sda, you can use the given commands, change only the command sudo grub-install /dev/sdb to sudo grub-install /dev/sda. Remind that this will overwrite Windows boot-loader. Also remind that the second drive has to be connected. There is still a faulty line in your /etc/fstab-file: UUID=BA42-7406 /windows vfat utf8,umask=007,gid=46 0 1 is wrong, it has wrong UUID and wrong file-system. You should comment (prefix#) or delete this line or adapt to correct UUID=11BE854F5F2F4DD7 and use ntfs instead of vfat. – mook765 Apr 10 '17 at 08:53
  • Success! Now, the changes you suggested seem to relate to the Windows partition (ntfs, /windows on the line). Why would the windows entry prevent Ubuntu from starting, as it did? I see myself in the future having mad skills like you. – Thomas Adkins Apr 10 '17 at 17:18
  • I think Grub decides to abort the boot-sequence whenever a fstab-entry fails to mount. Grub can't know what the consequences of a failed mount would be and which of the entries are important and which not. So it's maybe precaution to prevent an unnecessary boot which would lead to a system-crash because of a failed mount. You can add option nofail to the fstab-entry (see man fstab), this will boot even if this entry fails to mount, make sense for external drives which are not always connected. – mook765 Apr 10 '17 at 18:54