Bug#893617: grub-pc: Grub doesn't recognice a btrfs raid1 device as a installable device

Santiago Garcia Mantinan manty at debian.org
Tue Mar 20 13:54:13 UTC 2018


Package: grub-pc
Version: 2.02~beta3-5
Severity: normal

Dear Maintainer,

I created a raid1 btrfs device using: mkfs.btrfs -d raid1 -f /dev/sda3 /dev/sdb3
This btrfs is mounted as /boot, and grub-probe shows both devices as part of /boot
then at usable_partitions()
when partition="$(grub-probe -t device "$path" || true)"
this takes value: /dev/sda3 /dev/sdb3
and here starts the problem, as the device_to_id function on this value will not return
a correct value.

The result is that on this machine I get no installable device.

I'd expect that both sda3 and sdb3 would be listed, and in fact if I manually run:
grub-install /dev/sda3
grub-install /dev/sdb3
both work ok and grub is installed and the machine boots as expected.

I have tested this on 2.02+dfsg1-3 and the result was the same as on the
reported version.

If you need any other info just let me know.

Regards.

-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/md1 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
/dev/sda3 /boot btrfs rw,relatime,space_cache,subvolid=5,subvol=/ 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_msdos
insmod part_msdos
insmod btrfs
set root='hd0,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  --hint-bios=hd1,msdos4 --hint-efi=hd1,msdos4 --hint-baremetal=ahci1,msdos4  f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
else
  search --no-floppy --fs-uuid --set=root f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
fi
    font="/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
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_msdos
insmod part_msdos
insmod btrfs
set root='hd0,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  --hint-bios=hd1,msdos4 --hint-efi=hd1,msdos4 --hint-baremetal=ahci1,msdos4  f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
else
  search --no-floppy --fs-uuid --set=root f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
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/md1' {
	load_video
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_msdos
	insmod part_msdos
	insmod btrfs
	set root='hd0,msdos4'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  --hint-bios=hd1,msdos4 --hint-efi=hd1,msdos4 --hint-baremetal=ahci1,msdos4  f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
	else
	  search --no-floppy --fs-uuid --set=root f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
	fi
	echo	'Loading Linux 4.9.0-6-amd64 ...'
	linux	/vmlinuz-4.9.0-6-amd64 root=/dev/md1 ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initrd.img-4.9.0-6-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-/dev/md1' {
	menuentry 'Debian GNU/Linux, with Linux 4.9.0-6-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.0-6-amd64-advanced-/dev/md1' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod part_msdos
		insmod btrfs
		set root='hd0,msdos4'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  --hint-bios=hd1,msdos4 --hint-efi=hd1,msdos4 --hint-baremetal=ahci1,msdos4  f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
		else
		  search --no-floppy --fs-uuid --set=root f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
		fi
		echo	'Loading Linux 4.9.0-6-amd64 ...'
		linux	/vmlinuz-4.9.0-6-amd64 root=/dev/md1 ro  quiet
		echo	'Loading initial ramdisk ...'
		initrd	/initrd.img-4.9.0-6-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 4.9.0-6-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.0-6-amd64-recovery-/dev/md1' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod part_msdos
		insmod btrfs
		set root='hd0,msdos4'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  --hint-bios=hd1,msdos4 --hint-efi=hd1,msdos4 --hint-baremetal=ahci1,msdos4  f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
		else
		  search --no-floppy --fs-uuid --set=root f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9
		fi
		echo	'Loading Linux 4.9.0-6-amd64 ...'
		linux	/vmlinuz-4.9.0-6-amd64 root=/dev/md1 ro single 
		echo	'Loading initial ramdisk ...'
		initrd	/initrd.img-4.9.0-6-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 ###
menuentry 'Windows 10 (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-A412FC3012FC0956' {
	insmod part_msdos
	insmod ntfs
	set root='hd0,msdos2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  A412FC3012FC0956
	else
	  search --no-floppy --fs-uuid --set=root A412FC3012FC0956
	fi
	parttool ${root} hidden-
	drivemap -s (hd0) ${root}
	chainloader +1
}
menuentry 'Windows 10 (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-A412FC3012FC0956' {
	insmod part_msdos
	insmod ntfs
	set root='hd1,msdos2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2  A412FC3012FC0956
	else
	  search --no-floppy --fs-uuid --set=root A412FC3012FC0956
	fi
	parttool ${root} hidden-
	drivemap -s (hd0) ${root}
	chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_otheros ###

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
menuentry "Windows Vista" {
	set root=(hostdisk//dev/sda,msdos1)
	search --no-floppy --fs-uuid --set=root A412FC3012FC0956
	drivemap -s (hd0) $root
	chainloader +1
}

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1
menuentry "Windows Vista" {
	set root=(hostdisk//dev/sdb,msdos1)
	search --no-floppy --fs-uuid --set=root A412FC3012FC0956
	drivemap -s (hd0) $root
	chainloader +1
}
### END /etc/grub.d/30_otheros ###

### 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
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] 
md127 : active (auto-read-only) raid1 sda5[0] sdb5[1]
      9525248 blocks super 1.2 [2/2] [UU]
      
md1 : active raid1 sda4[2] sdb4[0]
      322135040 blocks super 1.2 [2/2] [UU]
      bitmap: 0/3 pages [0KB], 65536KB chunk

unused devices: <none>
*********************** END /proc/mdstat

*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494056 -> ../../sda
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494056-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494056-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494056-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494056-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494056-part5 -> ../../sda5
lrwxrwxrwx 1 root root  9 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494072 -> ../../sdb
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494072-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494072-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494072-part3 -> ../../sdb3
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494072-part4 -> ../../sdb4
lrwxrwxrwx 1 root root 10 Mar 20 14:59 ata-SAMSUNG_HD502HJ_S20BJ90B494072-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 11 Mar 20 14:59 md-name-pc4c:0 -> ../../md127
lrwxrwxrwx 1 root root  9 Mar 20 14:59 md-name-pc4c:1 -> ../../md1
lrwxrwxrwx 1 root root  9 Mar 20 14:59 md-uuid-1538e631:d6d02c67:889ef65d:3f5c4f3a -> ../../md1
lrwxrwxrwx 1 root root 11 Mar 20 14:59 md-uuid-373969df:c1e20e19:fc7e6940:b33b8622 -> ../../md127
lrwxrwxrwx 1 root root  9 Mar 20 14:59 wwn-0x50024e92050dfa2c -> ../../sda
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa2c-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa2c-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa2c-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa2c-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa2c-part5 -> ../../sda5
lrwxrwxrwx 1 root root  9 Mar 20 14:59 wwn-0x50024e92050dfa3d -> ../../sdb
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa3d-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa3d-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa3d-part3 -> ../../sdb3
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa3d-part4 -> ../../sdb4
lrwxrwxrwx 1 root root 10 Mar 20 14:59 wwn-0x50024e92050dfa3d-part5 -> ../../sdb5
*********************** END /dev/disk/by-id

*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 11 Mar 20 14:59 9098a177-df03-4c30-b376-6e6cd59d6210 -> ../../md127
lrwxrwxrwx 1 root root 10 Mar 20 14:59 A412FC3012FC0956 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 20 14:59 D0FAFE0CFAFDEF1A -> ../../sdb2
lrwxrwxrwx 1 root root 10 Mar 20 14:59 f3c3fee0-0e58-47ac-b2af-8c5b8b3a5fd9 -> ../../sda3
lrwxrwxrwx 1 root root  9 Mar 20 14:59 fefb6300-2e45-4164-871e-fb2acd7afe23 -> ../../md1
*********************** END /dev/disk/by-uuid

-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-6-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968), LANGUAGE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]  1.5.61
ii  dpkg                   1.18.24
ii  grub-common            2.02~beta3-5
ii  grub-pc-bin            2.02~beta3-5
ii  grub2-common           2.02~beta3-5
ii  ucf                    3.0036

grub-pc recommends no packages.

grub-pc suggests no packages.

-- debconf information:
  grub-pc/partition_description:
  grub-pc/install_devices_failed_upgrade: true
* grub-pc/install_devices_empty: true
  grub2/device_map_regenerated:
* grub-pc/install_devices:
  grub-pc/install_devices_disks_changed:
  grub-pc/timeout: 5
  grub2/kfreebsd_cmdline:
* grub2/linux_cmdline_default: quiet
  grub2/update_nvram: true
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/install_devices_failed: false
  grub-pc/kopt_extracted: false
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/disk_description:
  grub-pc/chainload_from_menu.lst: true
* grub2/linux_cmdline:
  grub-pc/hidden_timeout: false
  grub2/force_efi_extra_removable: false
  grub-pc/mixed_legacy_and_grub2: true



More information about the Pkg-grub-devel mailing list