Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] grub error I've never seen in many installs

103 views
Skip to first unread message

Harry Putnam

unread,
Jul 10, 2017, 4:10:04 PM7/10/17
to
Installing from install-amd64-minimal-20170706.iso into vbox vm

I've done this many times and never saw this grub error:

Attempting to run grub-install /dev/sda I get:

grub-install /dev/sda Installing for i386-pc platform.
grub-install: error: cannot find a GRUB drive for /dev/sda1. Check
your device.map.

When I started googling I find hits all of which are involved with efi
drives.

I don't really even know for sure what an `efi' drive is and certainly
never had any dealings with it when installing gentoo in a vbox vm.

(Even after googling efi ... still didn't really understand what it
is. Other than what it stands for. wikipaedia talks about a fat file
system being involved... .. all news to me)

I found something even more curious... I tried unmounting boot
(dev/sda1) and recreating the ext2 file system.

I left the computer for a bit, and when I came back I forgot I had
not remounted boot, and ran `grub-install /dev/sda' again with /dev/sda1
unmounted.

It ran with no errors and created a grub directory on / (/dev/sda4)

I don't understand why grub is looking for a GRUB drive on /dev/sda1
when I asked it to install on /dev/sda

The error tells me to check `device.map'. But gives no clue where it
might be found.

Where might I find `device.map'... it isn't part of grub2. At least
grep doesn't find it with `qlist grub'

Near as I can tell I've done things ... so far in the same way I have
before several times... probably within 4 to 6 mnths. So I may be
forgetting something important... but I know I have never run across
this error before.

And I have followed the handbook at least mostly.

Arve Barsnes

unread,
Jul 10, 2017, 5:00:05 PM7/10/17
to
On 10 July 2017 at 22:06, Harry Putnam <rea...@newsguy.com> wrote:
 grub-install /dev/sda Installing for i386-pc platform.
grub-install: error: cannot find a GRUB drive for /dev/sda1.  Check
your device.map.

Where might I find `device.map'... it isn't part of grub2.  At least
grep doesn't find it with `qlist grub'

As far as I understand it, grub2 will dynamically create the device.map when it needs it, so it doesn't actually exist as a file. On my grub legacy system it is installed as /boot/grub/device.map, with the only contents being "(hd0)   /dev/sda".

How you would feed grub this information *before* it is installed I'm not sure, but maybe look into the USE=device-mapper flag, maybe it installs the grub-mkdevicemap executable.

Arve

Harry Putnam

unread,
Jul 12, 2017, 6:00:04 PM7/12/17
to
Yeah, I tried that before posting.. setting USE=device-mapper then
reinstalled grub2... same result as without the flag. Same error
message.

I've always .. on many installs (over time) and mostly into a vbox vm,
created a disk, then when booting the install media I carve it up with
fdisk.
/dev/sda1=boot
/dev/sda2=swap
/dev/sda3=home
/dev/sda4=/

Has something changed regarding using that kind of technique?

I can't figure out why grub would be looking for a GRUB drive on

Hinnerk van Bruinehsen

unread,
Jul 12, 2017, 6:40:05 PM7/12/17
to
Did you mount /boot from inside the chroot environment? IIRC I got a
similar failure when mounting /boot from outside the chroot...

Harry Putnam

unread,
Jul 14, 2017, 11:00:04 AM7/14/17
to
Hinnerk van Bruinehsen <h.v.bru...@fu-berlin.de> writes:

>> Has something changed regarding using that kind of technique?
>>
>> I can't figure out why grub would be looking for a GRUB drive on
>> /dev/sda1 as the error says:
>>
>> grub-install: error: cannot find a GRUB drive for /dev/sda1
>
>
> Did you mount /boot from inside the chroot environment? IIRC I got a
> similar failure when mounting /boot from outside the chroot...

Egad, that is almost certainly what is going on.

However, before seeing your post I came up with what I thought might
be a way to get around the whole problem presented in the errors.

I preserved my install on the initial disk created in vbox for the
install.

Shutdown the vbox vm, created a set of new disks but this time using
whole disks rather than carving up partitions.

So instead of 1 disk carved up... I now had 4 disks in the same sizes
as the original partitions.

Booted the install media.. copied the installed OS over to the new
disks. But this time I was asking grub to intall itself on a disk
with a single whole disk partition.

It all worked, ... but I think now, after your comment, I probably
mounted boot in the proscribed way this time around. That is, from
inside a chrooted terminal.

Probably didn't need all the disk switching and copying at all.

Thanks for your input...

I'll know not to think I remember all about how to do this and pay
more attention to the install instructions. Even though I have done
this quite a few times... its usually been separated by along enough
time period that I might will have forgotten some of the necessary
steps.

Thanks again for taking time to post your thoughts.
0 new messages