Bug#717720: grub-pc: grub-install/update-grub and btrfs.mod disagree about root path
Tobias Gruetzmacher
tobias-debian at 23.gs
Wed Jul 24 09:15:00 UTC 2013
Package: grub-pc
Version: 2.00-15
Severity: normal
Dear Maintainer,
testing btrfs I came across a situation where grubn is unable to boot the
system with the configuration it generated. My btrfs is set up like this:
$ sudo btrfs subvolume list /
ID 257 gen 11785 top level 5 path root
ID 258 gen 11785 top level 5 path home
$ mount
[...]
/dev/sda1 on / type btrfs (rw,relatime,compress=lzo,ssd,space_cache)
/dev/sda1 on /home type btrfs (rw,relatime,compress=lzo,ssd,space_cache)
The home directory is mounted with subvol=/home, which you can't see in the
mount output.
As you can see, the btrfs has 2 subvolumes. subvolume /root was set as default.
I think there lies the problem. btrfs.mod considers the btrfs default and
searches everything from the /root subvolume, but grub's userspace tools
generate all paths from the root of the btrfs filesystem.
I don't know which side is in error, but I would lean more in the direction of
btrfs.mod, so you can access any subvolume from grub.
Best regards, Tobias
PS: grub currently just boots into rescue mode, to get to normal mode, I just
fix the prefix variable (set prefix=(hd0,msdos1)/boot/grub/i386-pc) and then
load (insmod normal) and start (normal) normal mode. After that I still have to
fix the kernel command line...
PPS: I think it worked in 1.99, maybe?
-- Package-specific info:
*********************** BEGIN /proc/mounts
/dev/sda1 / btrfs rw,relatime,compress=lzo,ssd,space_cache 0 0
/dev/sda1 /home btrfs rw,relatime,compress=lzo,ssd,space_cache 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
load_env
fi
set default="0"
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 93d8a4bf-d419-4398-8275-cf36e31db859
else
search --no-floppy --fs-uuid --set=root 93d8a4bf-d419-4398-8275-cf36e31db859
fi
font="/root/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=1024x768
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=de_DE
insmod gettext
fi
terminal_output gfxterm
set timeout=5
### 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 93d8a4bf-d419-4398-8275-cf36e31db859
else
search --no-floppy --fs-uuid --set=root 93d8a4bf-d419-4398-8275-cf36e31db859
fi
insmod png
if background_image /root/usr/share/images/desktop-base/joy-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 ###
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-93d8a4bf-d419-4398-8275-cf36e31db859' {
load_video
set gfxpayload=keep
insmod gzio
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 93d8a4bf-d419-4398-8275-cf36e31db859
else
search --no-floppy --fs-uuid --set=root 93d8a4bf-d419-4398-8275-cf36e31db859
fi
echo 'Loading Linux 3.10-1-amd64 ...'
linux /root/boot/vmlinuz-3.10-1-amd64 root=UUID=93d8a4bf-d419-4398-8275-cf36e31db859 ro rootflags=subvol=root init=/bin/systemd quiet fastboot
echo 'Loading initial ramdisk ...'
initrd /root/boot/initrd.img-3.10-1-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-93d8a4bf-d419-4398-8275-cf36e31db859' {
menuentry 'Debian GNU/Linux, with Linux 3.10-1-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10-1-amd64-advanced-93d8a4bf-d419-4398-8275-cf36e31db859' {
load_video
set gfxpayload=keep
insmod gzio
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 93d8a4bf-d419-4398-8275-cf36e31db859
else
search --no-floppy --fs-uuid --set=root 93d8a4bf-d419-4398-8275-cf36e31db859
fi
echo 'Loading Linux 3.10-1-amd64 ...'
linux /root/boot/vmlinuz-3.10-1-amd64 root=UUID=93d8a4bf-d419-4398-8275-cf36e31db859 ro rootflags=subvol=root init=/bin/systemd quiet fastboot
echo 'Loading initial ramdisk ...'
initrd /root/boot/initrd.img-3.10-1-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.9-1-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.9-1-amd64-advanced-93d8a4bf-d419-4398-8275-cf36e31db859' {
load_video
set gfxpayload=keep
insmod gzio
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 93d8a4bf-d419-4398-8275-cf36e31db859
else
search --no-floppy --fs-uuid --set=root 93d8a4bf-d419-4398-8275-cf36e31db859
fi
echo 'Loading Linux 3.9-1-amd64 ...'
linux /root/boot/vmlinuz-3.9-1-amd64 root=UUID=93d8a4bf-d419-4398-8275-cf36e31db859 ro rootflags=subvol=root init=/bin/systemd quiet fastboot
echo 'Loading initial ramdisk ...'
initrd /root/boot/initrd.img-3.9-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
*********************** END LVM
*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 9 Jul 24 10:13 ata-VBOX_CD-ROM_VB1-1a2b3c4d -> ../../sr0
lrwxrwxrwx 1 root root 9 Jul 24 10:13 ata-VBOX_HARDDISK_VB88d1fd94-dcccde4a -> ../../sda
lrwxrwxrwx 1 root root 10 Jul 24 10:13 ata-VBOX_HARDDISK_VB88d1fd94-dcccde4a-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul 24 10:13 ata-VBOX_HARDDISK_VB88d1fd94-dcccde4a-part2 -> ../../sda2
lrwxrwxrwx 1 root root 9 Jul 24 10:13 scsi-SATA_VBOX_HARDDISK_VB88d1fd94-dcccde4a -> ../../sda
lrwxrwxrwx 1 root root 10 Jul 24 10:13 scsi-SATA_VBOX_HARDDISK_VB88d1fd94-dcccde4a-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul 24 10:13 scsi-SATA_VBOX_HARDDISK_VB88d1fd94-dcccde4a-part2 -> ../../sda2
*********************** END /dev/disk/by-id
*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Jul 24 10:13 547886e6-d0da-40ab-98ab-252621672b2d -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul 24 10:13 93d8a4bf-d419-4398-8275-cf36e31db859 -> ../../sda1
*********************** END /dev/disk/by-uuid
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.10-1-amd64 (SMP w/1 CPU core)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages grub-pc depends on:
ii debconf [debconf-2.0] 1.5.50
ii grub-common 2.00-15
ii grub-pc-bin 2.00-15
ii grub2-common 2.00-15
ii ucf 3.0027+nmu1
grub-pc recommends no packages.
grub-pc suggests no packages.
-- debconf information:
grub-pc/kopt_extracted: false
grub2/kfreebsd_cmdline:
grub2/device_map_regenerated:
* grub-pc/install_devices: /dev/disk/by-id/ata-VBOX_HARDDISK_VB88d1fd94-dcccde4a
grub-pc/postrm_purge_boot_grub: false
grub-pc/install_devices_failed_upgrade: true
grub-pc/disk_description:
* grub2/linux_cmdline:
grub-pc/install_devices_empty: false
grub2/kfreebsd_cmdline_default: quiet
grub-pc/partition_description:
grub-pc/install_devices_failed: false
* grub-pc/install_devices_disks_changed: /dev/disk/by-id/ata-VBOX_HARDDISK_VB708f1f3e-12482856
* grub2/linux_cmdline_default: init=/bin/systemd quiet
grub-pc/chainload_from_menu.lst: true
grub-pc/mixed_legacy_and_grub2: true
More information about the Pkg-grub-devel
mailing list