install reports unable to install grub to /dev/sdb

Bug #1414124 reported by Eric Fontaine
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

first, I don't know if this is a new bug, but I don't know what bug it matches. The latest testing kubuntu installer almost finished, then report grub error could not install grub to /dev/sdb. However, I then used terminal to sudo grub-install --root-directoyr=/mnt/ /dev/sdb
which didn't report errors, and I assume will boot, but just reporting because installer did not work correctly out of box.

My labtop (Dell M4500) specs: https://gist.github.com/anonymous/7102aceb5c082f15553c

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: grub2 (not installed)
ProcVersionSignature: Ubuntu 3.18.0-9.10-generic 3.18.2
Uname: Linux 3.18.0-9-generic x86_64
ApportVersion: 2.15.1-0ubuntu2
Architecture: amd64
CasperVersion: 1.349
CurrentDesktop: KDE
Date: Fri Jan 23 13:48:49 2015
LiveMediaBuild: Kubuntu 15.04 "Vivid Vervet" - Alpha amd64 (20150123)
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
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/1414124

tags: added: iso-testing
Revision history for this message
Phillip Susi (psusi) wrote :

The installer should have automatically filed a bug report with the proper logs attached when this failed, but it looks like you instead filed this manually. We will need the /var/log/syslog from the install, which should have been copied to /var/log/installer on the hard disk if it got that far.

Changed in grub2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

I can't find any syslog file or install directory in my /dev/sdb1 /var/log folder strangely. I've attached a tar.gz of the entire log folder (after I chmod -R +r the contents).

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

In the meantime I was able to do a successful install to /dev/sda, so I also attached the syslog for that now, which I realize won't be useful for you now. But right now I'm going to retry the installation to /dev/sdb and I won't reboot or do anything when the install fails, and will try to grab the syslog at that point if it exists. Wait 30 minutes for me to try reinstall.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

I did the reinstall to to /dev/sdb. This was an "OEM" install, and I selected use entire disk /dev/sdb. Interestingly everything succedded, but I'm inspecting this syslog (attached) and I notice that this time grub install actually installed to /dev/sda according to this line:

Jan 23 21:28:42 kubuntu grub-installer: info: Installing grub on '/dev/sda'

For clarification, the very first install (unsucessful) was not an "OEM" install (but was a regular install using entire disk /dev/sdb). The second install (successful) was "OEM" into use entire disk /dev/sda. This thrid one (successful) was "OEM" install to /dev/sdb (however, as I stated earlier grub was installed to /dev/sda infact). I'm going to try to investigate why the bug originally failed to /dev/sdb. For clarification, my m4500 labtop has /sda as a 2.5-in sata connection with a 1tb mechanical drive in currently (which can be removed or replaced), while /sdb has a built-in 64gb mini-SSD card which. This next time I'm going to try to force the "OEM" install to the SSD card by disconnecting the 2.5-in drive (note that in the past year I've been using arch linux install to the ssd card with syslinux as the installer...I can't remember why I did syslinux but it may have been because grub failed at that time). Wait 30 minutes more for this new test.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

I disconnected the 2.5-in drive that was in sda and did reinstall as "OEM" settings and it succedded somehow (syslog attached, but note that sda now refers to the ssdcard).

I'm going to try some more to reproduce the original error. These last few sucessful installs have been booting the kubunt iso in EFI mode...I can't remember if the first time when it failed if was because I was booting the dvd in legacy mode. I'm going to try legacy mode boot now and install to the ssd to see if that causes the error (and now I'm wondering in that case that the error is not with grub2 itself but with settings passed to grub2 or with the computer's boot-mode...although in the past when I had sucessful arch and a few other sucessful installs, I'm almost certain it was in legacy mode).

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

Strangely, legacy non-oem install to minissd card only setup completed sucessfully (syslog attached).

I'm wondering now if maybe I need to dd if=zero of=(the ssdcard) now because maybe these sucessful installs have been just reusing the sucessful grub-install that I manually did the first time around. Then I'll try again to reporduce my same inital steps. Any other advice?

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

Finally I am able to regenerate my original failure with syslog (attached). Here's what I did:

-put 1tb mech drive into /dev/sda (so that means my minissd card is in /dev/sdb)
-boot kubuntu 15.04 testing iso in legacy mode
-wrote 0's to first 1gb of each drive
-did regular install using entire disk (and selected my sdd card /dev/sdb)
-try to complete kubuntu install
-when almost complete, I'm presented with popup "Unable to install GRUB in /dev/sda" with text "Executing 'grub-install /dev/sda' failed. This is a fatal error."

And now I'm writing you. The crucial error in the attached syslog seems to be:

grub-install: error: unable to identify a filesystem in hostdisk//dev/sda; safety check can't be performed.

Please advise how I should proceed with this (whether I should forward to ubuntu install people or something else...although I do consider it a bug even though there is a work around because a new user would not know what to do).

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

I'll wait a couple hours before rebooting incase you ask me for more diagnosis info. (Note: I remember if I press OK and try to install grub to /dev/sdb I remember getting presented with the same error.)

Revision history for this message
Phillip Susi (psusi) wrote :

Interesting... grub says it can't identify any partitions on /dev/sda. Can you post the output of blkid and grub-probe -vvv -d /dev/sda -t partmap?

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

I had to reboot my computer in the meantime...but I just rebooted the kubuntu 15.04 testing iso. Here is output for sudo grub-probe -vvv -d /dev/sda -t partmap:

grub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-probe: info: /dev/sda is not present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: /dev/sda is present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: /dev/sda is present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: opening hostdisk//dev/sda.
grub-core/kern/disk.c:196: Opening `hostdisk//dev/sda'...
grub-probe: info: drive = 0.
grub-probe: info: the size of hostdisk//dev/sda is 1953525168.
grub-probe: info: no partition map found for hostdisk//dev/sda.
grub-core/kern/disk.c:295: Closing `hostdisk//dev/sda'.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

gnome disk manager is describing /dev/sda as 1.0 TB, contents Unknown, not displaying any partition information. Attached is the dd of the first 1MB of /dev/sda incase that info helps diagnos.

Could the issue have been earlier in the partition table setup, and not grub's fault?

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

here's sudo blkid:

/dev/sdb1: UUID="17f2bb43-6413-4218-9643-98ad8be92d26" TYPE="ext4" PARTUUID="f3a7e6ed-01"
/dev/sr0: UUID="2015-01-23-05-37-28-00" LABEL="Kubuntu 15.04 amd64" TYPE="iso9660" PTUUID="23e03ae8" PTTYPE="dos"
/dev/loop0: TYPE="squashfs"
/dev/sdb5: UUID="44a7b82d-a953-47ad-943b-80b0cfd2cdfe" TYPE="swap" PARTUUID="f3a7e6ed-05"

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

I'm opening /dev/sda in hexedit and see 0's for the first 0x3FFFFFF0 bytes. Which is exactly the result of dd 1gb of zeros into /dev/sda before starting the install this previous time. Seems installer didn't write any partition table. I'm going to restart the install now that I've booted into the system with a blank partition table on /dev/sda (I'm thinking maybe the installer was working off partition info read at boot. But I don't think this would be the cause of my initial failure as I have initially had a previous partition table on sda I believe and didn't dd any zeros).

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

failure reproduced. I booted legacy mode kubuntu testing DVD (this time I verified that /dev/sda had 0's for first 1gb), and did the same install, telling it to use entire drive /dev/sdb and near ending of install, I get unable to install grub in /dev/sda popup error again.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

hexview of /dev/sda still show all zeros. I'm attaching the syslog.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

failure syslog

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

I just now pressed OK and the error window closed, then the kubuntu installer seemed to send a bug report, and the installer closed.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

right now I remounted the partition of the newly installed partition and tried the following:

sudo grub-install --root-directory=/media/kubuntu/5e9eb943-238e-451f-b029-18b24bdaac0c/ /dev/sda

Installing for i386-pc platform.
grub-install: error: unable to identify a filesystem in hostdisk//dev/sda; safety check can't be performed.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

And now just tried to /dev/sdb and it works: sudo grub-install --root-directory=/media/kubuntu/5e9eb943-238e-451f-b029-18b24bdaac0c/ /dev/sdb

Installing for i386-pc platform.
Installation finished. No error reported.

So that works (as I originally reported in the description at the top of this bug report, although maybe I poorly titled this bug as the error is with installing grub to sda, while sdb is the ubuntu install drive):

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

I went ahead and used gnome-disk-utility to create 1tb ext4 partition on /dev/sda then retried:

sudo grub-install --root-directory=/media/kubuntu/5e9eb943-238e-451f-b029-18b24bdaac0c/ /dev/sda
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: error: embedding is not possible, but this is required for cross-disk install.

Then used gnome-disk-utility to create a gpt partition on /dev/sda then retried:

sudo grub-install --root-directory=/media/kubuntu/5e9eb943-238e-451f-b029-18b24bdaac0c/ /dev/sda
Installing for i386-pc platform.
grub-install: error: unable to identify a filesystem in hostdisk//dev/sda; safety check can't be performed.

Then creted mbr on /dev/sda then retried:

sudo grub-install --root-directory=/media/kubuntu/5e9eb943-238e-451f-b029-18b24bdaac0c/ /dev/sda
Installing for i386-pc platform.
grub-install: error: unable to identify a filesystem in hostdisk//dev/sda; safety check can't be performed.

then manually made a partition /dev/sda1 and did sudo mkfs -t ext4 /dev/sda1 and then the grub install succedded:

sudo grub-install --root-directory=/media/kubuntu/5e9eb943-238e-451f-b029-18b24bdaac0c/ /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.

So I'm thinking now that grub's earlier refusal to install on the blank /dev/sda is a deliberate feature, in which case the problem is really with the ubuntu installer in that it won't provide user with a recourse action to install grub on /dev/sdb in the case that the user installs ubuntu to /dev/sdb but has an empty partition table in /dev/sda. I'm going to try a lubuntu testing install onto /dev/sdb with a blank /dev/sda partition table to determie if this issue affects more ubuntus than just kubuntu.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

just verified that I was able to boot into both /dev/sda and /dev/sdb which presented me with a grub recovery console, at which point I was sucessfuly able to set root, linux, initrd and boot into the new kubuntu testing install.

Now i'm going to zero the /dev/sda partition table and reboot into lubuntu testing iso and try to install lubuntu to /dev/sdb and see what happens with grub install.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

Ok, so I wrote 0's to /dev/sda/ and then rebooted into lubuntu test iso (on an usb) and told it to erase & install to /dev/sdb. Just nearing completion, I get popup: "Unable to install GRUB in /dev/sda" with text "Executing 'grub-install /dev/sda' failed. This is a fatal error." and then lubuntu presented me with recourse to select other drive to install bootloader to, so I tried sdb, but then get same popup for sdb "Unable to install GRUB in /dev/sdb" with text "Executing 'grub-install /dev/sdb' failed. This is a fatal error." I've attached the syslog.

So I think there is definately a bug with installing any ubuntu into sdb when there is a blank partition table on sda. Can you correctly categorize this bug and forward to appropriate people? Let me know if you want me to do any more tests.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :
Download full text (4.1 KiB)

I see from syslog there may be some issue with grub probe. Here is verbose output from both drives:

lubuntu@lubuntu:~$ sudo grub-probe -v -d /dev/sda
grub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-probe: info: /dev/sda is not present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: /dev/sda is present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: /dev/sda is present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: opening hostdisk//dev/sda.
grub-probe: info: drive = 0.
grub-probe: info: the size of hostdisk//dev/sda is 1953525168.
grub-probe: error: unknown filesystem.

lubuntu@lubuntu:~$ sudo grub-probe -v -d /dev/sdb
grub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-probe: info: /dev/sdb is not present.
grub-probe: info: Looking for /dev/sdb.
grub-probe: info: /dev/sdb is a parent of /dev/sdb.
grub-probe: info: /dev/sdb is present.
grub-probe: info: Looking for /dev/sdb.
grub-probe: info: /dev/sdb is a parent of /dev/sdb.
grub-probe: info: /dev/sdb is present.
grub-probe: info: Looking for /dev/sdb.
grub-probe: info: /dev/sdb is a parent of /dev/sdb.
grub-probe: info: opening hostdisk//dev/sdb.
grub-probe: info: drive = 0.
grub-probe: info: the size of hostdisk//dev/sdb is 125045424.
grub-probe: error: unknown filesystem.

lubuntu@lubuntu:~$ sudo grub-probe -vvv -d /dev/sda -t partmap
grub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-probe: info: /dev/sda is not present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: /dev/sda is present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: /dev/sda is present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: opening hostdisk//dev/sda.
grub-core/kern/disk.c:196: Opening `hostdisk//dev/sda'...
grub-probe: info: drive = 0.
grub-probe: info: the size of hostdisk//dev/sda is 1953525168.
grub-probe: info: no partition map found for hostdisk//dev/sda.
grub-core/kern/disk.c:295: Closing `hostdisk//dev/sda'.

lubuntu@lubuntu:~$ sudo grub-probe -vvv -d /dev/sdb -t partmap
grub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-probe: info: /dev/sdb is not present.
grub-probe: info: Looking for /dev/sdb.
grub-probe: info: /dev/sdb is a parent of /dev/sdb.
grub-probe: info: /dev/sdb is present.
grub-probe: info: Looking for /dev/sdb.
grub-probe: info: /dev/sdb is a parent of /dev/sdb.
grub-probe: info: /dev/sdb is present.
grub-probe: info: Looking for /dev/sdb.
grub-probe: info: /dev/sdb is a parent of /dev/sdb.
grub-probe: info: opening hostdisk//dev/sdb.
grub-core/kern/disk.c:196: Opening `hostdisk//dev/sdb'...
grub-probe: info: drive = 0.
grub-probe: info: the size of hostdisk//dev/sdb is 125045424.
grub-probe: info: no partition map found for hostdisk//dev/sdb.
grub-core/kern/disk.c:295: Cl...

Read more...

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

I wanted to test if booting kubuntut testing dvd in efi mode and doing oem install to /dev/sdb with the /dev/sda starting with zeros, and it failed. Interestingly the syslog says grub installed, but then after that says cant find partition info on /dev/sda and the kubuntu installer reported a failure. So it seems this bug doesn't affect just legacy mode boot.

Revision history for this message
Eric Fontaine (ericrfontaine) wrote :

and in case you ask for it:

kubuntu@kubuntu:~$ sudo grub-probe -vvv -d /dev/sda -t partmap
grub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-probe: info: /dev/sda is not present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: /dev/sda is present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: /dev/sda is present.
grub-probe: info: Looking for /dev/sda.
grub-probe: info: /dev/sda is a parent of /dev/sda.
grub-probe: info: opening hostdisk//dev/sda.
grub-core/kern/disk.c:196: Opening `hostdisk//dev/sda'...
grub-probe: info: drive = 0.
grub-probe: info: the size of hostdisk//dev/sda is 1953525168.
grub-probe: info: no partition map found for hostdisk//dev/sda.
grub-core/kern/disk.c:295: Closing `hostdisk//dev/sda'.

kubuntu@kubuntu:~$ sudo grub-probe -vvv -d /dev/sdb -t partmap
grub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-probe: info: /dev/sdb is not present.
grub-probe: info: Looking for /dev/sdb.
grub-probe: info: /dev/sdb is a parent of /dev/sdb.
grub-probe: info: /dev/sdb is present.
grub-probe: info: Looking for /dev/sdb.
grub-probe: info: /dev/sdb is a parent of /dev/sdb.
grub-probe: info: /dev/sdb is present.
grub-probe: info: Looking for /dev/sdb.
grub-probe: info: /dev/sdb is a parent of /dev/sdb.
grub-probe: info: opening hostdisk//dev/sdb.
grub-core/kern/disk.c:196: Opening `hostdisk//dev/sdb'...
grub-probe: info: drive = 0.
grub-probe: info: the size of hostdisk//dev/sdb is 125045424.
grub-probe: info: no partition map found for hostdisk//dev/sdb.
grub-core/kern/disk.c:295: Closing `hostdisk//dev/sdb'.

kubuntu@kubuntu:~$ sudo blkid
/dev/sdb1: UUID="C629-FD8B" TYPE="vfat" PARTUUID="f26666ef-3524-4046-b86d-4674b331a2ce"
/dev/sr0: UUID="2015-01-23-05-37-28-00" LABEL="Kubuntu 15.04 amd64" TYPE="iso9660" PTUUID="23e03ae8" PTTYPE="dos"
/dev/sdb2: UUID="6c6dce51-2e5c-4abf-8f0a-28ae2ffb5f06" TYPE="ext4" PARTUUID="5c8ccf09-fdb7-4547-acbe-7253905f9451"
/dev/sdb3: UUID="44a7b82d-a953-47ad-943b-80b0cfd2cdfe" TYPE="swap" PARTUUID="459ea891-d0ec-41a9-89a1-0d83b1ef8d17"
/dev/loop0: TYPE="squashfs"

Revision history for this message
Phillip Susi (psusi) wrote :

Ok, so you intentionally left /dev/sda blank. You need to create a partition table there to install grub, or choose to install grub to /dev/sdb instead.

Changed in grub2 (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
oldfred (oldfred) wrote :

I have tried installing all versions thru 17.04 to sdb and to sdb's ESP. Every one overwrote my main working installs /EFI/ubuntu folder in sda. I quickly learned to back that folder up, so I could reset main working install as default boot.

Same happens when I do a full install to flash drive, it overwrites my main working installs /EFI/ubuntu on sda. But if flash drive grub/shim also needs to be /EFI/Boot/bootx64.efi. And this bug report covers that, although related. https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1173457 and since Debian grub related https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746662

To post a comment you must log in.