help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"the device.map entry `hd0, 1' is invalid" when trying to install grub i


From: Manuel Wagesreither
Subject: "the device.map entry `hd0, 1' is invalid" when trying to install grub in loopback device
Date: Mon, 03 Jul 2017 21:56:08 +0200

Hello all,

I would like to install grub into a loopback device. The host machine is debian 
stretch with grub '2.02~beta3-4' and running EFI, the image file I would like 
to install grub into contains debian stretch with grub '2.02~beta3-5' and 
regular non-EFI BIOS-boot.

I did my best to research how to do that properly and came up with the 
following commands. Unfortunately, when running `grub-install', it tells me 
that a device map entry is incorrect.

Thanks a lot!

P.S.: This is the first time I'm using a mailling list. I hope I did everything 
correct.


These are the commands I ran:

address@hidden:~/nas$ ll
total 366192
drwxr-xr-x 2 manuel manuel      4096 Jun 29 16:48 mount
-rw-r--r-- 1 manuel manuel 536870912 Jul  3 21:00 sdcard.img

address@hidden:~/nas$ sudo losetup -fP --show sdcard.img 
/dev/loop0

address@hidden:~/nas$ sudo fdisk -l /dev/loop0
Disk /dev/loop0: 512 MiB, 536870912 bytes, 1048576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc72358f1

Device       Boot Start     End Sectors  Size Id Type
/dev/loop0p1      20480 1048575 1028096  502M 83 Linux

address@hidden:~/nas$ sudo mount /dev/loop0p1 mount

address@hidden:~/nas$ cat mount/boot/grub/device.map 
(hd0)   /dev/loop0
(hd0,1) /dev/loop0p1

address@hidden:~/nas$ sudo grub-install 
--grub-mkdevicemap=/home/manuel/nas/mount/boot/grub/device.map 
--root-directory=/home/manuel/nas/mount/ /dev/loop0
Installing for x86_64-efi platform.
grub-install: warning: the device.map entry `hd0,1' is invalid. Ignoring it. 
Please correct or delete your device.map.
grub-install: error: /home/manuel/nas/mount/ doesn't look like an EFI partition.

address@hidden:~/nas$ sudo mount -o bind /dev mount/dev/
address@hidden:~/nas$ sudo mount -o bind /sys mount/sys/
address@hidden:~/nas$ sudo mount -o bind /proc mount/proc/

address@hidden:~/nas$ sudo chroot mount

address@hidden:/# grub-install --grub-mkdevicemap=/boot/grub/device.map 
--root-directory=/ /dev/loop0 
Installing for i386-pc platform.
grub-install: warning: the device.map entry `hd0,1' is invalid. Ignoring it. 
Please correct or delete your device.map.
Installation finished. No error reported.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]