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: manuel@manuelthinkpad:~/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 manuel@manuelthinkpad:~/nas$ sudo losetup -fP --show sdcard.img /dev/loop0 manuel@manuelthinkpad:~/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 manuel@manuelthinkpad:~/nas$ sudo mount /dev/loop0p1 mount manuel@manuelthinkpad:~/nas$ cat mount/boot/grub/device.map (hd0) /dev/loop0 (hd0,1) /dev/loop0p1 manuel@manuelthinkpad:~/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. manuel@manuelthinkpad:~/nas$ sudo mount -o bind /dev mount/dev/ manuel@manuelthinkpad:~/nas$ sudo mount -o bind /sys mount/sys/ manuel@manuelthinkpad:~/nas$ sudo mount -o bind /proc mount/proc/ manuel@manuelthinkpad:~/nas$ sudo chroot mount root@manuelthinkpad:/# 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. _______________________________________________ Help-grub mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-grub
