|
From: | Pascal Hambourg |
Subject: | Re: grub2 fails to detect partitions if it was installed into file |
Date: | Tue, 17 Jul 2018 20:12:46 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
Hello, Le 17/07/2018 à 18:09, Sergey Naumov a écrit :
I'm trying to prepare an image that I can dd into disk or boot using PXE, so I install basic system + kernel + grub-pc into directory, then create an image file, partition it using sfdisk, mount main partiton (ext4), copy content of the rootfs into it, and then run grub-install and update-grub under chroot. Everything seems OK, grub.cfg detected kernel and initramfs installed into created image, but when I try to boot this image either on real system or using kvm, grub2 can't find device partitions. What could be a reason of it? I posted the question with more detailed explanation here: https://serverfault.com/questions/922319/grub2-fails-to-detect-partitions-if-it-was-installed-into-file
You really could have copied all the relevant information in your post to the list, so subscribers do not have to fetch them on the web.
How did you make the ext4 partition in the image appear as a block device so that it can be mounted ?
AFAIK, GRUB looking for the filesystem containing /boot/grub by UUID means that grub-install believes that it is on a different drive from the boot+core image. So maybe grub-install did not care to embed the MSDOS partition table driver into the core image. You can try to force it with
grub-install --modules=part_msdos <other parameters>
[Prev in Thread] | Current Thread | [Next in Thread] |