stretch and grub on LVM

Markus Wigge markus at cultcom.de
Wed Aug 10 18:33:31 CEST 2016


Hi there,

I'm trying to install a stretch VM with more or less the same settings I
have for jessie (same config directory).

Almost everything works quite fine but grub is not able to find my root
on LVM as it was before.

#disk_config:
> disk_config disk1 disklabel:msdos bootable:1
> primary -		100%	-	-
> 
> disk_config lvm
> vg	vg1	disk1.1
> vg1-root	/	1G-10G	ext4	errors=remount-ro	createopts="-m 2 -L root"
> vg1-swap	swap	2G	swap	sw


#shell.log
=====   shell: GRUB_PC/10-setup   =====
ainsl: appending to /target/etc/default/grub: GRUB_DISABLE_OS_PROBER=true
Installing for i386-pc platform.
Installation finished. No error reported.
Grub installed on /dev/sda = (hd3)
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.6.0-1-amd64
Found initrd image: /boot/initrd.img-4.6.0-1-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
done
GRUB_PC/10-setup     OK.


looks fine so far...

What I had to do for jessie is a small workaround inside the script:

--- /usr/share/doc/fai-doc/examples/simple/scripts/GRUB_PC/10-setup
2015-12-02 15:36:34.000000000 +0100
+++ GRUB_PC/10-setup	2016-08-10 11:59:02.698768970 +0200
@@ -14,6 +14,12 @@
 # disable os-prober because of #788062
 ainsl /etc/default/grub 'GRUB_DISABLE_OS_PROBER=true'

+if [[ $BOOT_DEVICE =~ 'vg1' ]]
+then
+	BOOT_DEVICE=$(echo $disklist | cut -d " " -f 1)
+	export BOOT_DEVICE=/dev/$BOOT_DEVICE
+fi
+
 # skip the rest, if not an initial installation
 if [ $FAI_ACTION != "install" ]; then
     $ROOTCMD update-grub


But when I try to boot that VM after the installation finished I always
get the following errors:

error: failure reading sector 0x0 from 'fd0'
error disk 'lvmid/.........../.............' not found.
Entering rescue mode...
grub rescue>


When I boot into "grml", chroot to the LV and run "dpkg-reconfigure
grub-pc" afterwards everything is booting fine.

Can anyone give me a hint where to look for the problem?

After finishing the installation I tried the following inside the
running fai chroot on tty2:
"chroot /target"
"unset DEBIAN_FRONTEND"
"dpkg-reconfigure grub-pc"

unfortunately without success, I got the same grub errors. Only the grml
chroot worked.

FAI Version is the current 5.1.2 on the server and inside the chroot.


Regards,
Markus


More information about the linux-fai mailing list