grub-devel
[Top][All Lists]
Advanced

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

grub-install fails with nbd device


From: listsb
Subject: grub-install fails with nbd device
Date: Sat, 20 Jun 2020 16:40:07 -0400

hi-

i'd recently posted this to help-grub, but was asked to post here as well.

i'm attempting to install grub to an esp partition on an nbd device, but it 
fails, and says "error: cannot find a GRUB drive for /dev/nbd0p1" [see below].  
this is a qcow2 image, presented to the system as /dev/nbd0 [e.g. qemu-nbd 
--connect ...].  i also have another "traditional" disk connected as /dev/vdd, 
partitioned identically, and this works as expected.

i've tried --removable, --no-nvram, with and without device.map files, all with 
the same result.  i did find that if i run kpartx against the device, it 
creates devices in /dev/mapper/, and those work, but i don't understand why.  
with or without running kpartx, it seems to me the kernel has awareness of the 
device partitions, since i can work with them as expected in any other way 
using the traditional /dev/ nodes.  it seems to just be grub that has an issue.

i've also tested this with just a simple raw image file, and a loop device 
[below as well].  i get the same result there.  this is just another example of 
the same problem though, and not what i'm aiming to do.

what makes grub decide it's not a grub drive?

here's some hopefully relevant info - thanks!:

=== with an nbd device ===
>parted /dev/nbd0 print
Model: Unknown (unknown)
Disk /dev/nbd0: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size   File system  Name  Flags
1      1049kB  105MB   104MB  fat32        esp   boot, esp
2      105MB   1073MB  968MB               pv1   lvm

>cat 
>/opt/build/operating_systems/alpine/work/imagetest-c5676f32-412a-4ef4-b617-962b932b8ef2/boot/grub/device.map
(hd0)                   /dev/nbd0

>grub-install \
--verbose \
--removable \
--target=x86_64-efi \
--bootloader-id=alpine \
"--efi-directory=/opt/build/operating_systems/alpine/work/imagetest-c5676f32-412a-4ef4-b617-962b932b8ef2/boot/efi"
 \
"--boot-directory=/opt/build/operating_systems/alpine/work/imagetest-c5676f32-412a-4ef4-b617-962b932b8ef2/boot"
Installing for x86_64-efi platform.
grub-install: info: cannot open 
`/opt/build/operating_systems/alpine/work/imagetest-c5676f32-412a-4ef4-b617-962b932b8ef2/boot/grub/device.map':
 No such file or directory.
grub-install: info: /dev/nbd0p1 is not present.
grub-install: info: Looking for /dev/nbd0p1.
grub-install: info: /dev/nbd0 is a parent of /dev/nbd0p1.
grub-install: info: /dev/nbd0p1 is present.
grub-install: info: Looking for /dev/nbd0p1.
grub-install: info: /dev/nbd0 is a parent of /dev/nbd0p1.
grub-install: info: /dev/nbd0p1 is present.
grub-install: info: Looking for /dev/nbd0p1.
grub-install: info: /dev/nbd0 is a parent of /dev/nbd0p1.
grub-install: error: cannot find a GRUB drive for /dev/nbd0p1.  Check your 
device.map.

=== with a loop device ===
>qemu-img create -f raw grubtest.img '500m'
>losetup --verbose /dev/loop0 grubtest.img

>parted /dev/loop0 print
Model: Loopback device (loopback)
Disk /dev/loop0: 524MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  105MB  104MB  fat32        esp   boot, esp
 2      105MB   523MB  418MB  ext4         root

>grub-install \
>   --verbose \
>   --removable \
>   --target=x86_64-efi \
>   --bootloader-id=alpine
Installing for x86_64-efi platform.
grub-install: info: cannot open `/boot/grub/device.map': No such file or 
directory.
grub-install: info: /dev/loop0p1 is not present.
grub-install: info: Looking for /dev/loop0p1.
grub-install: info: /dev/loop0 is a parent of /dev/loop0p1.
grub-install: info: /dev/loop0p1 is present.
grub-install: info: Looking for /dev/loop0p1.
grub-install: info: /dev/loop0 is a parent of /dev/loop0p1.
grub-install: info: /dev/loop0p1 is present.
grub-install: info: Looking for /dev/loop0p1.
grub-install: info: /dev/loop0 is a parent of /dev/loop0p1.
grub-install: error: cannot find a GRUB drive for /dev/loop0p1.  Check your 
device.map.

=== with a virtio device ===
>grub-install \
--removable \
--target=x86_64-efi \
--bootloader-id=alpine \
"--efi-directory=/opt/build/operating_systems/alpine/work/imagetest-1e909864-b820-4939-9dff-b4918184c632/boot/efi"
 \
"--boot-directory=/opt/build/operating_systems/alpine/work/imagetest-1e909864-b820-4939-9dff-b4918184c632/boot"
Installing for x86_64-efi platform.
File descriptor 4 (/dev/vdd1) leaked on vgs invocation. Parent PID 10249: 
grub-install
You have a memory leak (not released memory pool):
[0x7fcace1b3f80] dtree
Internal error: Unreleased memory pool(s) found.
File descriptor 4 (/dev/vdd1) leaked on vgs invocation. Parent PID 10249: 
grub-install
You have a memory leak (not released memory pool):
[0x7fcace1b3f80] dtree
Internal error: Unreleased memory pool(s) found.
Installation finished. No error reported.


reply via email to

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