Bug#841772: grub-common: grub-mkconfig generates root= with empty UUID, making system unbootable

Klaus Schneider-Zapp klaus_snd at web.de
Sun Oct 23 11:51:53 UTC 2016


Package: grub-common
Version: 2.02~beta3-1
Severity: important

After the most recent upgrade, grub-mkconfig generates an incorrect grub.cfg
with a root= line with empty UUID. In /etc/grub.d/10_linux, l. 68,
uses_abstraction generates an error and returns false, therefore the empty 
UUID in ${GRUB_DEVICE_UUID} is accepted and used.

# /usr/sbin/grub-probe --device /dev/mapper/larus_vg-root --target=abstraction
/usr/sbin/grub-probe: error: disk `lvmid/22gcC4-S1nG-73eR-J097-sq3j-0Oly-wg4g2I/iNky0F-bFml-277M-dAuH-0Q2L-6aCh-AXU4ws' not found.

/dev/mapper/larus_vg-root is an LVM inside a crypt device.

If I remove 
 && uses_abstraction "${GRUB_DEVICE}" lvm
in 10_linux, then grub-mkconfig uses the device name and booting works.

What I don't understand:
 Why does grub-probe not work?
 Why does 10_linux accept empty UUIDs if uses_abstraction returns false?


-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/mapper/larus_vg-root / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
/dev/mapper/larus_vg-usr /usr ext4 rw,relatime,data=ordered 0 0
/dev/sda2 /boot ext2 rw,relatime,block_validity,barrier,user_xattr,acl 0 0
/dev/sda1 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/mapper/larus_vg-home /home ext4 rw,relatime,data=ordered 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
else
  search --no-floppy --fs-uuid --set=root ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
fi
    font="/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=de_DE
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
else
  search --no-floppy --fs-uuid --set=root ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
fi
insmod png
if background_image /grub/.background_cache.png; then
  set color_normal=white/black
  set color_highlight=black/white
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-/dev/mapper/larus_vg-root' {
	load_video
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
	else
	  search --no-floppy --fs-uuid --set=root ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
	fi
	echo	'Linux 4.7.0-1-amd64 wird geladen …'
	linux	/vmlinuz-4.7.0-1-amd64 root=UUID= ro  quiet
	echo	'Initiale Ramdisk wird geladen …'
	initrd	/initrd.img-4.7.0-1-amd64
}
submenu 'Erweiterte Optionen für Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-/dev/mapper/larus_vg-root' {
	menuentry 'Debian GNU/Linux, mit Linux 4.7.0-1-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.7.0-1-amd64-advanced-/dev/mapper/larus_vg-root' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		else
		  search --no-floppy --fs-uuid --set=root ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		fi
		echo	'Linux 4.7.0-1-amd64 wird geladen …'
		linux	/vmlinuz-4.7.0-1-amd64 root=UUID= ro  quiet
		echo	'Initiale Ramdisk wird geladen …'
		initrd	/initrd.img-4.7.0-1-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 4.7.0-1-amd64 (sysvinit)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.7.0-1-amd64-init-sysvinit-/dev/mapper/larus_vg-root' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		else
		  search --no-floppy --fs-uuid --set=root ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		fi
		echo	'Linux 4.7.0-1-amd64 wird geladen …'
		linux	/vmlinuz-4.7.0-1-amd64 root=UUID= ro  quiet init=/lib/sysvinit/init
		echo	'Initiale Ramdisk wird geladen …'
		initrd	/initrd.img-4.7.0-1-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 4.7.0-1-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.7.0-1-amd64-recovery-/dev/mapper/larus_vg-root' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		else
		  search --no-floppy --fs-uuid --set=root ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		fi
		echo	'Linux 4.7.0-1-amd64 wird geladen …'
		linux	/vmlinuz-4.7.0-1-amd64 root=UUID= ro single 
		echo	'Initiale Ramdisk wird geladen …'
		initrd	/initrd.img-4.7.0-1-amd64
	}
	menuentry 'Debian GNU/Linux, mit Linux 4.3.0-1-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.3.0-1-amd64-advanced-/dev/mapper/larus_vg-root' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		else
		  search --no-floppy --fs-uuid --set=root ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		fi
		echo	'Linux 4.3.0-1-amd64 wird geladen …'
		linux	/vmlinuz-4.3.0-1-amd64 root=UUID= ro  quiet
		echo	'Initiale Ramdisk wird geladen …'
		initrd	/initrd.img-4.3.0-1-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 4.3.0-1-amd64 (sysvinit)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.3.0-1-amd64-init-sysvinit-/dev/mapper/larus_vg-root' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		else
		  search --no-floppy --fs-uuid --set=root ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		fi
		echo	'Linux 4.3.0-1-amd64 wird geladen …'
		linux	/vmlinuz-4.3.0-1-amd64 root=UUID= ro  quiet init=/lib/sysvinit/init
		echo	'Initiale Ramdisk wird geladen …'
		initrd	/initrd.img-4.3.0-1-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 4.3.0-1-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.3.0-1-amd64-recovery-/dev/mapper/larus_vg-root' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		else
		  search --no-floppy --fs-uuid --set=root ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5
		fi
		echo	'Linux 4.3.0-1-amd64 wird geladen …'
		linux	/vmlinuz-4.3.0-1-amd64 root=UUID= ro single 
		echo	'Initiale Ramdisk wird geladen …'
		initrd	/initrd.img-4.3.0-1-amd64
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
*********************** END /boot/grub/grub.cfg

*********************** BEGIN /proc/mdstat
cat: /proc/mdstat: No such file or directory
*********************** END /proc/mdstat

*********************** BEGIN LVM
  --- Volume group ---
  VG Name               larus_vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               238.33 GiB
  PE Size               4.00 MiB
  Total PE              61013
  Alloc PE / Size       61013 / 238.33 GiB
  Free  PE / Size       0 / 0   
  VG UUID               22gcC4-S1nG-73eR-J097-sq3j-0Oly-wg4g2I
   
  --- Physical volume ---
  PV Name               /dev/mapper/larus_crypt
  VG Name               larus_vg
  PV Size               238.33 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              61013
  Free PE               0
  Allocated PE          61013
  PV UUID               1v8MQA-Lhf8-J4Es-w3Wr-5H6O-IJgW-LMxGKe
   
  --- Logical volume ---
  LV Path                /dev/larus_vg/swap
  LV Name                swap
  VG Name                larus_vg
  LV UUID                ehV5tO-UjMn-MmpN-G0e7-J2Q4-xQiR-0aNNCq
  LV Write Access        read/write
  LV Creation host, time larus, 2014-03-08 23:06:54 +0100
  LV Status              available
  # open                 2
  LV Size                4.19 GiB
  Current LE             1072
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1
   
  --- Logical volume ---
  LV Path                /dev/larus_vg/root
  LV Name                root
  VG Name                larus_vg
  LV UUID                iNky0F-bFml-277M-dAuH-0Q2L-6aCh-AXU4ws
  LV Write Access        read/write
  LV Creation host, time larus, 2014-03-08 23:07:03 +0100
  LV Status              available
  # open                 1
  LV Size                11.18 GiB
  Current LE             2861
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:2
   
  --- Logical volume ---
  LV Path                /dev/larus_vg/usr
  LV Name                usr
  VG Name                larus_vg
  LV UUID                haLRBg-jewf-uCiK-nePd-ecPq-knxD-UxpcDW
  LV Write Access        read/write
  LV Creation host, time larus, 2014-03-08 23:07:11 +0100
  LV Status              available
  # open                 1
  LV Size                17.69 GiB
  Current LE             4529
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3
   
  --- Logical volume ---
  LV Path                /dev/larus_vg/home
  LV Name                home
  VG Name                larus_vg
  LV UUID                2S31Fh-Hxlo-UVIQ-PCce-YJZj-dwVa-JXW8Hy
  LV Write Access        read/write
  LV Creation host, time larus, 2014-03-08 23:07:16 +0100
  LV Status              available
  # open                 1
  LV Size                205.28 GiB
  Current LE             52551
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:4
   
*********************** END LVM

*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Oct 23 12:40 ata-SanDisk_SDSSDHP256G_135177401576 -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 23 12:40 ata-SanDisk_SDSSDHP256G_135177401576-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 23 12:40 ata-SanDisk_SDSSDHP256G_135177401576-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 23 12:40 ata-SanDisk_SDSSDHP256G_135177401576-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-name-larus_crypt -> ../../dm-0
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-name-larus_vg-home -> ../../dm-4
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-name-larus_vg-root -> ../../dm-2
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-name-larus_vg-swap -> ../../dm-1
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-name-larus_vg-usr -> ../../dm-3
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-uuid-CRYPT-PLAIN-larus_crypt -> ../../dm-0
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-uuid-LVM-22gcC4S1nG73eRJ097sq3j0Olywg4g2I2S31FhHxloUVIQPCceYJZjdwVaJXW8Hy -> ../../dm-4
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-uuid-LVM-22gcC4S1nG73eRJ097sq3j0Olywg4g2IehV5tOUjMnMmpNG0e7J2Q4xQiR0aNNCq -> ../../dm-1
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-uuid-LVM-22gcC4S1nG73eRJ097sq3j0Olywg4g2IhaLRBgjewfuCiKnePdecPqknxDUxpcDW -> ../../dm-3
lrwxrwxrwx 1 root root 10 Oct 23 12:40 dm-uuid-LVM-22gcC4S1nG73eRJ097sq3j0Olywg4g2IiNky0FbFml277MdAuH0Q2L6aChAXU4ws -> ../../dm-2
lrwxrwxrwx 1 root root 10 Oct 23 12:40 lvm-pv-uuid-1v8MQA-Lhf8-J4Es-w3Wr-5H6O-IJgW-LMxGKe -> ../../dm-0
lrwxrwxrwx 1 root root  9 Oct 23 12:40 wwn-0x5001b44a84c870e8 -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 23 12:40 wwn-0x5001b44a84c870e8-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 23 12:40 wwn-0x5001b44a84c870e8-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 23 12:40 wwn-0x5001b44a84c870e8-part3 -> ../../sda3
*********************** END /dev/disk/by-id

*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Oct 23 12:40 07519aeb-2c76-4307-9266-08f96e7ead1d -> ../../dm-4
lrwxrwxrwx 1 root root 10 Oct 23 12:40 3f740db1-fa92-41a4-b17b-ff6b83477afc -> ../../dm-3
lrwxrwxrwx 1 root root 10 Oct 23 12:40 83575e69-9a7f-4360-bb0b-9b056394d559 -> ../../dm-1
lrwxrwxrwx 1 root root 10 Oct 23 12:40 A347-E0EB -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 23 12:40 ad0ce2a4-4956-4eb8-ab83-6a2eb4720dc5 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 23 12:40 ec078a16-0636-42dd-9dce-7fbd18b8795e -> ../../dm-2
*********************** END /dev/disk/by-uuid

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.7.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages grub-common depends on:
ii  gettext-base        0.19.8.1-1
ii  libc6               2.24-3
ii  libdevmapper1.02.1  2:1.02.133-1
ii  libfreetype6        2.6.3-3+b1
ii  libfuse2            2.9.7-1
ii  liblzma5            5.2.2-1.2

Versions of packages grub-common recommends:
ii  os-prober  1.71

Versions of packages grub-common suggests:
ii  console-setup  1.152
ii  desktop-base   8.0.2
pn  grub-emu       <none>
pn  multiboot-doc  <none>
pn  xorriso        <none>

-- no debconf information



More information about the Pkg-grub-devel mailing list