Bug#820806: grub-pc: GRUB fails to install to USB-stick with BTRFS filesystem

Andreas Glaeser bugs.andreas.glaeser at freenet.de
Tue Apr 12 14:46:09 UTC 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Package: grub-pc
Version: 2.02~beta2-36
Severity: minor

Dear Maintainer,

the information below is actually from my mobile-thin-client, I use to track current
debian-testing software-updates, so it does not have too much to do with the promlem, I
amtrying to address here. I attached three screenshots from the debian-installer, and
also tried to setup GRUB manually to the USB-disk from the thin-client:

> root at m100:/home/andrew# grub-install --boot-directory=/mnt/usb/boot/ /dev/sdb
> Installing for i386-pc platform.
> grub-install: error: hostdisk//dev/sdb appears to contain a ufs2 filesystem which isn't
> known to reserve space for DOS-style boot.  Installing GRUB there could result in
> FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe
> disables this check, use at your own risk). root at m100:/home/andrew# grub-install
> --boot-directory=/mnt/usb/boot/ --skip-fs-probe /dev/sdb Installing for i386-pc
> platform. grub-install: warning: Attempting to install GRUB to a disk with multiple
> partition labels.  This is not supported yet.. grub-install:

There really was FreeBSD on the USB-disk before, but it shouldn't really matter, should
it??
Also, when I install into KVM with virt-manager, and dd the image to USB-disk, it wil not
boot either, see this report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819867

The problem also affects Jessie stable, a non-BTRFS-partition is neccessary there also for
being able to boot from USB-device, it seems to have migrated there.

I would expect GRUB to be installable on USB-devices with any filesystem, supported by
the installer, else I guess, the D-I team would have to disable the option to install to
USB-devices, since they fail to boot afterwards.

- -- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/sda1 / btrfs rw,noatime,nodiratime,compress=lzo,space_cache,subvolid=5,subvol=/ 0 0
/dev/sdb1 /mnt/usb 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 btrfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1
- --hint-baremetal=ahci0,msdos1  1fd1c268-3803-45bf-b597-169e87e17e4a else
  search --no-floppy --fs-uuid --set=root 1fd1c268-3803-45bf-b597-169e87e17e4a
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_GB
  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_msdos
insmod btrfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1
- --hint-baremetal=ahci0,msdos1  1fd1c268-3803-45bf-b597-169e87e17e4a else
  search --no-floppy --fs-uuid --set=root 1fd1c268-3803-45bf-b597-169e87e17e4a
fi
insmod png
if background_image /usr/share/images/desktop-base/lines-grub.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-1fd1c268-3803-45bf-b597-169e87e17e4a' { load_video
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_msdos
	insmod btrfs
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1
- --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  1fd1c268-3803-45bf-b597-169e87e17e4a
else search --no-floppy --fs-uuid --set=root 1fd1c268-3803-45bf-b597-169e87e17e4a
	fi
	echo	'Loading Linux 4.4.0-1-686-pae ...'
	linux	/boot/vmlinuz-4.4.0-1-686-pae
root=UUID=1fd1c268-3803-45bf-b597-169e87e17e4a ro  quiet echo	'Loading initial
ramdisk ...' initrd	/boot/initrd.img-4.4.0-1-686-pae
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option
'gnulinux-advanced-1fd1c268-3803-45bf-b597-169e87e17e4a' { menuentry 'Debian GNU/Linux,
with Linux 4.4.0-1-686-pae' --class debian --class gnu-linux --class gnu --class os
$menuentry_id_option
'gnulinux-4.4.0-1-686-pae-advanced-1fd1c268-3803-45bf-b597-169e87e17e4a' { load_video
insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod
part_msdos insmod btrfs
		set root='hd0,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1
- --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  1fd1c268-3803-45bf-b597-169e87e17e4a
else search --no-floppy --fs-uuid --set=root 1fd1c268-3803-45bf-b597-169e87e17e4a
		fi
		echo	'Loading Linux 4.4.0-1-686-pae ...'
		linux	/boot/vmlinuz-4.4.0-1-686-pae
root=UUID=1fd1c268-3803-45bf-b597-169e87e17e4a ro  quiet echo	'Loading initial
ramdisk ...' initrd	/boot/initrd.img-4.4.0-1-686-pae
	}
	menuentry 'Debian GNU/Linux, with Linux 4.4.0-1-686-pae (recovery mode)' --class
debian --class gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-4.4.0-1-686-pae-recovery-1fd1c268-3803-45bf-b597-169e87e17e4a' { load_video
insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod btrfs
		set root='hd0,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1
- --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  1fd1c268-3803-45bf-b597-169e87e17e4a
else search --no-floppy --fs-uuid --set=root 1fd1c268-3803-45bf-b597-169e87e17e4a
		fi
		echo	'Loading Linux 4.4.0-1-686-pae ...'
		linux	/boot/vmlinuz-4.4.0-1-686-pae
root=UUID=1fd1c268-3803-45bf-b597-169e87e17e4a ro single echo	'Loading initial
ramdisk ...' initrd	/boot/initrd.img-4.4.0-1-686-pae
	}
	menuentry 'Debian GNU/Linux, with Linux 4.3.0-1-686-pae' --class debian --class
gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-4.3.0-1-686-pae-advanced-1fd1c268-3803-45bf-b597-169e87e17e4a' { load_video
insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod btrfs
		set root='hd0,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1
- --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  1fd1c268-3803-45bf-b597-169e87e17e4a
else search --no-floppy --fs-uuid --set=root 1fd1c268-3803-45bf-b597-169e87e17e4a
		fi
		echo	'Loading Linux 4.3.0-1-686-pae ...'
		linux	/boot/vmlinuz-4.3.0-1-686-pae
root=UUID=1fd1c268-3803-45bf-b597-169e87e17e4a ro  quiet echo	'Loading initial
ramdisk ...' initrd	/boot/initrd.img-4.3.0-1-686-pae
	}
	menuentry 'Debian GNU/Linux, with Linux 4.3.0-1-686-pae (recovery mode)' --class
debian --class gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-4.3.0-1-686-pae-recovery-1fd1c268-3803-45bf-b597-169e87e17e4a' { load_video
insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod btrfs
		set root='hd0,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1
- --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  1fd1c268-3803-45bf-b597-169e87e17e4a
else search --no-floppy --fs-uuid --set=root 1fd1c268-3803-45bf-b597-169e87e17e4a
		fi
		echo	'Loading Linux 4.3.0-1-686-pae ...'
		linux	/boot/vmlinuz-4.3.0-1-686-pae
root=UUID=1fd1c268-3803-45bf-b597-169e87e17e4a ro single echo	'Loading initial
ramdisk ...' initrd	/boot/initrd.img-4.3.0-1-686-pae
	}
	menuentry 'Debian GNU/Linux, with Linux 4.2.0-1-686-pae' --class debian --class
gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-4.2.0-1-686-pae-advanced-1fd1c268-3803-45bf-b597-169e87e17e4a' { load_video
insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod btrfs
		set root='hd0,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1
- --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  1fd1c268-3803-45bf-b597-169e87e17e4a
else search --no-floppy --fs-uuid --set=root 1fd1c268-3803-45bf-b597-169e87e17e4a
		fi
		echo	'Loading Linux 4.2.0-1-686-pae ...'
		linux	/boot/vmlinuz-4.2.0-1-686-pae
root=UUID=1fd1c268-3803-45bf-b597-169e87e17e4a ro  quiet echo	'Loading initial
ramdisk ...' initrd	/boot/initrd.img-4.2.0-1-686-pae
	}
	menuentry 'Debian GNU/Linux, with Linux 4.2.0-1-686-pae (recovery mode)' --class
debian --class gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-4.2.0-1-686-pae-recovery-1fd1c268-3803-45bf-b597-169e87e17e4a' { load_video
insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod btrfs
		set root='hd0,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1
- --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  1fd1c268-3803-45bf-b597-169e87e17e4a
else search --no-floppy --fs-uuid --set=root 1fd1c268-3803-45bf-b597-169e87e17e4a
		fi
		echo	'Loading Linux 4.2.0-1-686-pae ...'
		linux	/boot/vmlinuz-4.2.0-1-686-pae
root=UUID=1fd1c268-3803-45bf-b597-169e87e17e4a ro single echo	'Loading initial
ramdisk ...' initrd	/boot/initrd.img-4.2.0-1-686-pae
	}
}

### 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 /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Apr 12 15:35 ata-CF_Card_2BDA07581F0100008062 -> ../../sda
lrwxrwxrwx 1 root root 10 Apr 12 15:35 ata-CF_Card_2BDA07581F0100008062-part1
- -> ../../sda1 lrwxrwxrwx 1 root root 10 Apr 12 15:35
ata-CF_Card_2BDA07581F0100008062-part2 -> ../../sda2 lrwxrwxrwx 1 root root  9 Apr 12
15:55 usb-SanDisk_SanDisk_Ultra_A200476A92056043-0:0 -> ../../sdb lrwxrwxrwx 1 root root
10 Apr 12 15:55 usb-SanDisk_SanDisk_Ultra_A200476A92056043-0:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Apr 12 15:55
usb-SanDisk_SanDisk_Ultra_A200476A92056043-0:0-part2 -> ../../sdb2 lrwxrwxrwx 1 root root
10 Apr 12 15:55 usb-SanDisk_SanDisk_Ultra_A200476A92056043-0:0-part5 -> ../../sdb5
*********************** END /dev/disk/by-id

*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Apr 12 15:35 1fd1c268-3803-45bf-b597-169e87e17e4a -> ../../sda1
lrwxrwxrwx 1 root root 10 Apr 12 15:55 563228a77cd001ae -> ../../sdb2
lrwxrwxrwx 1 root root 10 Apr 12 15:55 6395291d-49b6-4213-938b-5d3c0a67afe3 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Apr 12 15:55 83855bde-8a9b-4d76-959b-61f97943e47c -> ../../sdb5
lrwxrwxrwx 1 root root 10 Apr 12 15:35 d6de6033-738d-4c69-8ced-d46fa1977b66 -> ../../sda2
*********************** END /dev/disk/by-uuid

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

Kernel: Linux 4.4.0-1-686-pae (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
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.59
ii  dpkg                   1.18.4
ii  grub-common            2.02~beta2-36
ii  grub-pc-bin            2.02~beta2-36
ii  grub2-common           2.02~beta2-36
ii  ucf                    3.0036

grub-pc recommends no packages.

grub-pc suggests no packages.

- -- debconf information:
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/partition_description:
* grub2/linux_cmdline:
  grub-pc/install_devices_disks_changed:
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/mixed_legacy_and_grub2: true
  grub-pc/install_devices_failed: false
  grub-pc/timeout: 5
  grub-pc/install_devices_empty: false
  grub2/device_map_regenerated:
  grub-pc/hidden_timeout: false
* grub-pc/install_devices: /dev/disk/by-id/ata-CF_Card_2BDA07581F0100008062
* grub2/linux_cmdline_default: quiet
  grub-pc/postrm_purge_boot_grub: false
  grub2/kfreebsd_cmdline:
  grub-pc/kopt_extracted: false
  grub-pc/disk_description:
  grub2/force_efi_extra_removable: false
  grub-pc/chainload_from_menu.lst: true
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlcNCjcACgkQ5+rBHyUt5wvX9ACfWqNdMl8yNSEeD2qkEpMGmBKp
IDcAn0ghzVC8AEHWsKt1DVzRsGpm9viZ
=eCQa
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub-install-failure-00.JPG
Type: image/jpeg
Size: 54110 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20160412/09cc10cd/attachment-0003.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub-install-failure-01.JPG
Type: image/jpeg
Size: 45022 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20160412/09cc10cd/attachment-0004.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub-install-failure-02.JPG
Type: image/jpeg
Size: 133241 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20160412/09cc10cd/attachment-0005.jpe>


More information about the Pkg-grub-devel mailing list