boot loader not installed to target disk

Bug #704763 reported by David Shafer on 2011-01-19
180
This bug affects 25 people
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
High
Unassigned

Bug Description

Binary package hint: casper

Advised by "ubuntu brainstorm" moderator "cheesehead" (please see http://brainstorm.ubuntu.com/idea/26998/) to file this as a "bug report" against the "casper" package of ubuntu release 10.x While I can see similarities between what follows and bug #223428, I am not sure they are the same. At any rate, here goes...

Like many people, I suspect, I wanted to install unbuntu on a physical drive completely separate from the one containing my legacy OS (Windows Vista); in my case, an external hard-drive connected to my computer by USB. After some trial-and-error, I realized that the installation option I should use was the "Erase and use entire disk" option (though this was scary, because at first I didn't know that I would later be presented with a choice of WHICH disk to erase and use). The trouble was, though, that even when I realized I could specify the external disk as the one to which ubuntu should be installed, and did so, the installer STILL overwrote the boot loader of my computer's INTERNAL hard-drive (the one containing Windows Vista) with GRUB. Because of this, I could not boot the computer at all unless my external hard-drive was connected. I finally got around this by going with the "specify partitions manually" installation option, which also gave me the option to specify the location of the boot loader, but not before I had made my computer unbootable (by futzing around with the computer's boot sector) and had to hunt down and create a Windows Vista restore disk just for the purpose of restoring the boot loader stored on the computer's internal hard-drive.

Suggested solutions:
1. Somehow indicate, early on, that the installer (person) will be presented with a CHOICE of which disk will be erased and used entirely (please see the description in the above "idea rationale" section).
2. Write the boot loader (GRUB) to the disk targeted for the ubuntu installation when the "erase and use entire disk" installation option is chosen.

Changed in casper (Ubuntu):
importance: Undecided → High
Jason Schuh (jschuh11) on 2012-03-14
Changed in casper (Ubuntu):
status: New → Incomplete
Gary M (garym) on 2012-03-15
Changed in casper (Ubuntu):
status: Incomplete → New
affects: casper (Ubuntu) → ubiquity (Ubuntu)
Jens Jäschke (jensm1) wrote :

I can confirm this to be still present with 11.10 (didn't test it with 12.04 but will test with 12.10stable).
The bootloader of the primary disk is overwritten to start grub, which is installed on the linux-HDD. This results in problems when the linux-disk gets removed or formatted.

Changed in ubiquity (Ubuntu):
status: New → Confirmed
Dimitri John Ledkov (xnox) wrote :

11.10 will not have a point release with cd-images. Please verify this bug with 12.10 daily and/or 12.04.1 images. There have been changes to boot loader target device selection in 12.10. Then set the bug back to confirmed if you can reproduce it there.

Changed in ubiquity (Ubuntu):
status: Confirmed → Incomplete
Jens Jäschke (jensm1) wrote :

Okay, I'll do that, as soon as the 12.10 stable version is released.

David Mak-Fan (dmakfan) wrote :

Bug is still there in 12.04 LTS.

When doing an install from a USB stick, the installer defaults to putting the boot stuf on the USB stick instead of the harddrive I am installing the OS to.

Gary M (garym) wrote :

(Status change on behalf of dmakfan - 12.04)

Changed in ubiquity (Ubuntu):
status: Incomplete → Confirmed
Robin McCorkell (xenopathic) wrote :

The attached patch fixes the issue, as it allows grub-installer to use the boot device passed to grub_default() when no GRUB installation device is explicitly set like in 'Erase disk and install'. As such, if the target is /dev/sdb, GRUB will no longer try to be installed to /dev/sda (assuming both are non-removable drives), and instead will just install to /dev/sdb.

The attachment "ubiquity-grub.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Phillip Susi (psusi) wrote :

The problem is that the installer has no way of knowing that you intend to remove the other disk from the system and manually boot them separately. It assumes you just have two disks and want to be able to choose which OS to load at boot time. At best it would need some kind of prompt to ask which your intention is rather than just assuming it should install grub to the second disk.

Robin McCorkell (xenopathic) wrote :

The problem with the installer at the moment is that it blindly tries to install GRUB to the first disk in GRUB's device map, regardless of if it can or not (apart from the special removable device code). This causes problems when /dev/sda is a secondary disk that isn't configured at the time of installation, and so because it contains no MBR GRUB fails to install on it. I can see why installing to a drive that is different to the one /boot exists on is beneficial with multiple OSes, but to be honest when one selects 'erase disk and install Ubuntu' they likely do not have or care about any other operating systems on other drives.

Even if another operating system exists on another drive, with this patch GRUB will be installed to the 'secondary' drive, and so to start using it one must simply change the boot order in the BIOS/UEFI. In addition, perhaps the user does not want to overwrite the existing bootloader, say, if GRUB is being managed by a different distribution on the same system. But I just think that if one has another OS installed on a system, they'd probably use the manual partitioning selection which allows them to set the bootloader location manually, rather than the 'automate everything, erase disk and install' option.

Phillip Susi (psusi) wrote :

You make a good point about the erase option, but we still want the side by side option to stick with sda because you don't want people have to figure out that they need to tell their bios to boot from the second drive. Then again, I don't think the side by side option even lets you pick the other disk anyhow so maybe it's a moot point.

Graeme Hewson (ghewson) wrote :

Problem is still there in 16.04 LTS (pre-release).

In my case I have a laptop with one internal disk and I'm installing on an external USB-attached disk (/dev/sda and /dev/sdc respectively).

The result makes no sense to me. If I boot the laptop without the external disk, I end up at a Grub command prompt. I can't boot from the external disk because there's no boot loader on it. Surely I should be able to boot a system from one or the other disk alone.

The internal disk is mounted as /boot/efi, and has EFI/ubuntu/grub.cfg with the content:

search.fs_uuid xxxx root hd2,gpt2
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

where xxxx is the UUID of the root partition on the external disk. So it's quite deliberately requiring both disks to be present.

Let's at least have a warning message that the internal disk will be modified. There is no mention of /dev/sda in the installation, only a warning that /dev/sdc will be changed (see screenshots).

Shih-Yuan Lee (fourdollars) wrote :

I think there are two different symptoms.
One is for legacy BIOS and the other is for UEFI BIOS.
Regarding UEFI BIOS, it may be caused by Bug #1512589.

Jani Alinikula (janialinikula) wrote :

I installed Xubuntu 16.04 from a DVD to a new SDD. I ended up with a system that had no bootloader. I have other disks with earlier Ubuntu releases and thought "Erase and use entire disk" was the safest. I had to re-install using manual partitioning.

Barry Drake (b-drake) wrote :

The release version of xenial trashed the boot sector on the target disk. I've re-installed from the late April testing version.

Barry Drake (b-drake) wrote :

It gets worse!!!! After trying all the suggested ways of restoring the boot sector and failing, I used the live cd to re-install xenial, with the other two internal drives I have, disconnected. Ubiquity on the lat April testing version) - showed grub being installed, and update-grub being run. BUT when re-booting, I got the grub error prompt. It seems the problem's been there for a while!

Graeme Hewson (ghewson) wrote :

I'm using UEFI. I've found that Rod Smith (of rodsbooks.com fame) has written some typically detailed reports about this problem in bug #1571354 and bug #1567534.

Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/704763

tags: added: iso-testing
To post a comment you must log in.