* Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup
@ 2014-05-10 18:53 Martin Steigerwald
2014-06-02 15:39 ` Andrey Borzenkov
0 siblings, 1 reply; 9+ messages in thread
From: Martin Steigerwald @ 2014-05-10 18:53 UTC (permalink / raw)
To: Debian Bug Tracking System
Package: grub2-common
Version: 2.02~beta2-10
Severity: normal
Dear Maintainer,
I am booting my Debian system via a BTRFS RAID 1 which spans a logical
volume on a Crucial MSATA and Intel SATA SSD each.
After running update-grub I am getting this in /boot/grub/grub.cfg:
echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
linux /vmlinuz-3.15.0-rc5-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.15.0-rc5-tp520
update-grub basically adds both devices of the BTRFS RAID 1 device
separated by a line feed. For mounting BTRFS RAID 1 tough one of them
is enough, once btrfs device scan is run, for which I currently use an
script for initramfs-tools as a work-around as it didn´t work out of
the box on my last tests[1].
This behaviour is due to grub-probe which is called by grub-mkconfig
at line 139
138 # Device containing our userland. Typically used for root= parameter.
139 GRUB_DEVICE="`${grub_probe} --target=device /`"
140 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
which is called by update-grub returns both devices with a
linefeed:
merkaba:~> grub-probe --target=device /
/dev/mapper/sata-debian
/dev/mapper/msata-debian
grub-probe is an ELF binary.
The following little change workarounds the issue for me:
merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist /usr/sbin/grub-mkconfig
--- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000 +0200
+++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200
@@ -136,7 +136,7 @@
fi
# Device containing our userland. Typically used for root= parameter.
-GRUB_DEVICE="`${grub_probe} --target=device /`"
+GRUB_DEVICE="`${grub_probe} --target=device / | head -1`"
GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
# Device containing our /boot partition. Usually the same as GRUB_DEVICE.
But I suppose the real fix is to be made in the binary grub-probe.
[1] merkaba:~> cat /etc/initramfs-tools/scripts/local-top/btrfs
#!/bin/sh
PREREQ="lvm"
prereqs()
{
echo $PREREQ
}
case $1 in
prereqs)
prereqs
exit 0;
esac
. /scripts/functions
log_begin_msg "Initializing BTRFS RAID-1."
modprobe btrfs
vgscan
vgchange -ay
btrfs device scan
log_end_msg
See also
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686130#15
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612402#66
Thanks,
Martin
-- Package-specific info:
*********************** BEGIN /proc/mounts
/dev/dm-5 / btrfs rw,noatime,compress=lzo,ssd,space_cache 0 0
/dev/dm-5 /mnt/debian-zeit btrfs rw,noatime,compress=lzo,ssd,space_cache 0 0
/dev/mapper/msata-daten /daten btrfs rw,noatime,compress=lzo,ssd,space_cache 0 0
/dev/dm-0 /mnt/home-zeit btrfs rw,noatime,compress=lzo,ssd,space_cache 0 0
/dev/dm-0 /home btrfs rw,noatime,compress=lzo,ssd,space_cache 0 0
/dev/sdb2 /boot ext4 rw,noatime,stripe=4,data=ordered 0 0
*********************** END /proc/mounts
*********************** BEGIN /boot/grub/device.map
(hd0) /dev/disk/by-id/ata-INTEL_SSDSA2CW300G3_[… serial …]
(hd1) /dev/disk/by-id/ata-Crucial_CT480M500SSD3_[… serial …]
*********************** END /boot/grub/device.map
*********************** 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 lvm
insmod lvm
insmod btrfs
set root='lvmid/2v42d3-vHdl-ld11-SjUa-3yHG-WNaD-yRkXai/JQbRXi-wpSl-w0lf-ceDA-EOm5-vm25-TLdmrD
lvmid/1xnC0C-zJgA-fIZG-7qdM-AWaN-p2P5-zdj4c8/yxVz0I-OYJj-AEO5-vFex-TON0-fzTH-YGUWez'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/2v42d3-vHdl-ld11-SjUa-3yHG-WNaD-yRkXai/JQbRXi-wpSl-w0lf-ceDA-EOm5-vm25-TLdmrD' --hint='lvmid/1xnC0C-zJgA-fIZG-7qdM-AWaN-p2P5-zdj4c8/yxVz0I-OYJj-AEO5-vFex-TON0-fzTH-YGUWez' ebda8c23-2154-4559-be2b-9e9c422658d1
else
search --no-floppy --fs-uuid --set=root ebda8c23-2154-4559-be2b-9e9c422658d1
fi
font="/debian/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=1920x1080
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=-1
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 lvm
insmod lvm
insmod btrfs
set root='lvmid/2v42d3-vHdl-ld11-SjUa-3yHG-WNaD-yRkXai/JQbRXi-wpSl-w0lf-ceDA-EOm5-vm25-TLdmrD
lvmid/1xnC0C-zJgA-fIZG-7qdM-AWaN-p2P5-zdj4c8/yxVz0I-OYJj-AEO5-vFex-TON0-fzTH-YGUWez'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/2v42d3-vHdl-ld11-SjUa-3yHG-WNaD-yRkXai/JQbRXi-wpSl-w0lf-ceDA-EOm5-vm25-TLdmrD' --hint='lvmid/1xnC0C-zJgA-fIZG-7qdM-AWaN-p2P5-zdj4c8/yxVz0I-OYJj-AEO5-vFex-TON0-fzTH-YGUWez' ebda8c23-2154-4559-be2b-9e9c422658d1
else
search --no-floppy --fs-uuid --set=root ebda8c23-2154-4559-be2b-9e9c422658d1
fi
insmod png
if background_image /debian/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 ###
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-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
linux /vmlinuz-3.15.0-rc5-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.15.0-rc5-tp520
}
submenu 'Erweiterte Optionen für Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-ebda8c23-2154-4559-be2b-9e9c422658d1' {
menuentry 'Debian GNU/Linux, mit Linux 3.15.0-rc5-tp520' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.15.0-rc5-tp520-advanced-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
linux /vmlinuz-3.15.0-rc5-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.15.0-rc5-tp520
}
menuentry 'Debian GNU/Linux, with Linux 3.15.0-rc5-tp520 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.15.0-rc5-tp520-recovery-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
linux /vmlinuz-3.15.0-rc5-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro single rootflags=subvol=debian
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.15.0-rc5-tp520
}
menuentry 'Debian GNU/Linux, mit Linux 3.15.0-rc4' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.15.0-rc4-advanced-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.15.0-rc4 wird geladen …'
linux /vmlinuz-3.15.0-rc4 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.15.0-rc4
}
menuentry 'Debian GNU/Linux, with Linux 3.15.0-rc4 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.15.0-rc4-recovery-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.15.0-rc4 wird geladen …'
linux /vmlinuz-3.15.0-rc4 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro single rootflags=subvol=debian
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.15.0-rc4
}
menuentry 'Debian GNU/Linux, mit Linux 3.14.0-tp520' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-tp520-advanced-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.14.0-tp520 wird geladen …'
linux /vmlinuz-3.14.0-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.14.0-tp520
}
menuentry 'Debian GNU/Linux, with Linux 3.14.0-tp520 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-tp520-recovery-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.14.0-tp520 wird geladen …'
linux /vmlinuz-3.14.0-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro single rootflags=subvol=debian
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.14.0-tp520
}
menuentry 'Debian GNU/Linux, mit Linux 3.14.0-rc7-tp520' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-rc7-tp520-advanced-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.14.0-rc7-tp520 wird geladen …'
linux /vmlinuz-3.14.0-rc7-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.14.0-rc7-tp520
}
menuentry 'Debian GNU/Linux, with Linux 3.14.0-rc7-tp520 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-rc7-tp520-recovery-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.14.0-rc7-tp520 wird geladen …'
linux /vmlinuz-3.14.0-rc7-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro single rootflags=subvol=debian
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.14.0-rc7-tp520
}
menuentry 'Debian GNU/Linux, mit Linux 3.14.0-rc6-tp520' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-rc6-tp520-advanced-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.14.0-rc6-tp520 wird geladen …'
linux /vmlinuz-3.14.0-rc6-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.14.0-rc6-tp520
}
menuentry 'Debian GNU/Linux, with Linux 3.14.0-rc6-tp520 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-rc6-tp520-recovery-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.14.0-rc6-tp520 wird geladen …'
linux /vmlinuz-3.14.0-rc6-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro single rootflags=subvol=debian
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.14.0-rc6-tp520
}
menuentry 'Debian GNU/Linux, mit Linux 3.14.0-rc4-tp520' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-rc4-tp520-advanced-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.14.0-rc4-tp520 wird geladen …'
linux /vmlinuz-3.14.0-rc4-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.14.0-rc4-tp520
}
menuentry 'Debian GNU/Linux, with Linux 3.14.0-rc4-tp520 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-rc4-tp520-recovery-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.14.0-rc4-tp520 wird geladen …'
linux /vmlinuz-3.14.0-rc4-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro single rootflags=subvol=debian
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.14.0-rc4-tp520
}
menuentry 'Debian GNU/Linux, mit Linux 3.13.0-tp520' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-tp520-advanced-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.13.0-tp520 wird geladen …'
linux /vmlinuz-3.13.0-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.13.0-tp520
}
menuentry 'Debian GNU/Linux, with Linux 3.13.0-tp520 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-tp520-recovery-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.13.0-tp520 wird geladen …'
linux /vmlinuz-3.13.0-tp520 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro single rootflags=subvol=debian
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.13.0-tp520
}
menuentry 'Debian GNU/Linux, mit Linux 3.13-1-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13-1-amd64-advanced-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.13-1-amd64 wird geladen …'
linux /vmlinuz-3.13-1-amd64 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.13-1-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.13-1-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13-1-amd64-recovery-ebda8c23-2154-4559-be2b-9e9c422658d1' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
echo 'Linux 3.13-1-amd64 wird geladen …'
linux /vmlinuz-3.13-1-amd64 root=/dev/mapper/sata-debian
/dev/mapper/msata-debian ro single rootflags=subvol=debian
echo 'Initiale Ramdisk wird geladen …'
initrd /initrd.img-3.13-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/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
linux16 /memtest86+.bin console=ttyS0,115200n8
}
menuentry "Memory test (memtest86+, experimental multiboot)" {
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
multiboot /memtest86+_multiboot.bin
}
menuentry "Memory test (memtest86+, serial console 115200, experimental multiboot)" {
insmod part_msdos
insmod ext2
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 --hint='hd1,msdos2' 96735182-42db-4a5f-944a-2f91eae1edf1
else
search --no-floppy --fs-uuid --set=root 96735182-42db-4a5f-944a-2f91eae1edf1
fi
multiboot /memtest86+_multiboot.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### 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
Personalities :
unused devices: <none>
*********************** END /proc/mdstat
*********************** BEGIN LVM
--- Volume group ---
VG Name msata
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 446.64 GiB
PE Size 4.00 MiB
Total PE 114340
Alloc PE / Size 97280 / 380.00 GiB
Free PE / Size 17060 / 66.64 GiB
[ this and all further UUIDs removed ]
--- Volume group ---
VG Name sata
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 44
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 278.99 GiB
PE Size 4.00 MiB
Total PE 71421
Alloc PE / Size 49152 / 192.00 GiB
Free PE / Size 22269 / 86.99 GiB
VG UUID 2v42d3-vHdl-ld11-SjUa-3yHG-WNaD-yRkXai
--- Physical volume ---
PV Name /dev/sdb3
VG Name msata
PV Size 446.64 GiB / not usable 1.84 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 114340
Free PE 17060
Allocated PE 97280
PV UUID IG53G4-5aGU-9VqU-ZnqV-5OFO-h33h-drpwml
--- Physical volume ---
PV Name /dev/sda4
VG Name sata
PV Size 278.99 GiB / not usable 2.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 71421
Free PE 22269
Allocated PE 49152
PV UUID hFbNjl-Sf1i-tJnb-7VlB-CHFm-qP7y-Q2aMBn
--- Logical volume ---
LV Path /dev/msata/home
LV Name home
VG Name msata
LV UUID NuB9k6-neH1-hfgT-ggQv-uig7-dzQd-slrngL
LV Write Access read/write
LV Creation host, time merkaba, 2014-03-05 13:08:44 +0100
LV Status available
# open 1
LV Size 150.00 GiB
Current LE 38400
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0
--- Logical volume ---
LV Path /dev/msata/daten
LV Name daten
VG Name msata
LV UUID TDoQgZ-7eLj-DjVS-buxy-qzov-7HYV-pEZ1Cf
LV Write Access read/write
LV Creation host, time merkaba, 2014-03-05 13:09:09 +0100
LV Status available
# open 1
LV Size 200.00 GiB
Current LE 51200
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1
--- Logical volume ---
LV Path /dev/msata/debian
LV Name debian
VG Name msata
LV UUID yxVz0I-OYJj-AEO5-vFex-TON0-fzTH-YGUWez
LV Write Access read/write
LV Creation host, time grml, 2014-03-05 16:28:38 +0100
LV Status available
# open 1
LV Size 30.00 GiB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:2
--- Logical volume ---
LV Path /dev/sata/home
LV Name home
VG Name sata
LV UUID Ltx5KD-5AJR-HAA8-11Za-eFrG-TEtk-OaH6JV
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 150.00 GiB
Current LE 38400
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:3
--- Logical volume ---
LV Path /dev/sata/swap
LV Name swap
VG Name sata
LV UUID mnM6wo-K91m-lTIU-zCas-nvkS-c7di-yzIUr8
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 2
LV Size 12.00 GiB
Current LE 3072
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:4
--- Logical volume ---
LV Path /dev/sata/debian
LV Name debian
VG Name sata
LV UUID JQbRXi-wpSl-w0lf-ceDA-EOm5-vm25-TLdmrD
LV Write Access read/write
LV Creation host, time grml, 2014-03-05 16:28:34 +0100
LV Status available
# open 1
LV Size 30.00 GiB
Current LE 7680
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:5
*********************** END LVM
*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 9 May 10 20:06 ata-Crucial_CT480M500SSD3_[… serial …] -> ../../sdb
lrwxrwxrwx 1 root root 10 May 10 20:06 ata-Crucial_CT480M500SSD3_[… serial …]-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 May 10 20:06 ata-Crucial_CT480M500SSD3_[… serial …]-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 May 10 20:06 ata-Crucial_CT480M500SSD3_[… serial …]-part3 -> ../../sdb3
lrwxrwxrwx 1 root root 9 May 10 20:06 ata-HL-DT-STDVDRAM_GT33N_M6EB3385558 -> ../../sr0
lrwxrwxrwx 1 root root 9 May 10 20:06 ata-INTEL_SSDSA2CW300G3_[… serial …] -> ../../sda
lrwxrwxrwx 1 root root 10 May 10 20:06 ata-INTEL_SSDSA2CW300G3_[… serial …]-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 May 10 20:06 ata-INTEL_SSDSA2CW300G3_[… serial …]-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 May 10 20:06 ata-INTEL_SSDSA2CW300G3_[… serial …]-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 May 10 20:06 ata-INTEL_SSDSA2CW300G3_[… serial …]-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-name-msata-daten -> ../../dm-1
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-name-msata-debian -> ../../dm-2
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-name-msata-home -> ../../dm-0
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-name-sata-debian -> ../../dm-5
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-name-sata-home -> ../../dm-3
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-name-sata-swap -> ../../dm-4
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-uuid-LVM-1xnC0CzJgAfIZG7qdMAWaNp2P5zdj4c8NuB9k6neH1hfgTggQvuig7dzQdslrngL -> ../../dm-0
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-uuid-LVM-1xnC0CzJgAfIZG7qdMAWaNp2P5zdj4c8TDoQgZ7eLjDjVSbuxyqzov7HYVpEZ1Cf -> ../../dm-1
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-uuid-LVM-1xnC0CzJgAfIZG7qdMAWaNp2P5zdj4c8yxVz0IOYJjAEO5vFexTON0fzTHYGUWez -> ../../dm-2
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-uuid-LVM-2v42d3vHdlld11SjUa3yHGWNaDyRkXaiJQbRXiwpSlw0lfceDAEOm5vm25TLdmrD -> ../../dm-5
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-uuid-LVM-2v42d3vHdlld11SjUa3yHGWNaDyRkXaiLtx5KD5AJRHAA811ZaeFrGTEtkOaH6JV -> ../../dm-3
lrwxrwxrwx 1 root root 10 May 10 20:06 dm-uuid-LVM-2v42d3vHdlld11SjUa3yHGWNaDyRkXaimnM6woK91mlTIUzCasnvkSc7diyzIUr8 -> ../../dm-4
lrwxrwxrwx 1 root root 9 May 10 20:06 wwn-[… wwn …] -> ../../sda
lrwxrwxrwx 1 root root 10 May 10 20:06 wwn-[… wwn …]-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 May 10 20:06 wwn-[… wwn …]-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 May 10 20:06 wwn-[… wwn …]-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 May 10 20:06 wwn-[… wwn …]-part4 -> ../../sda4
lrwxrwxrwx 1 root root 9 May 10 20:06 wwn-[… wwn …] -> ../../sdb
lrwxrwxrwx 1 root root 10 May 10 20:06 wwn-[… wwn …]-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 May 10 20:06 wwn-[… wwn …]-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 May 10 20:06 wwn-[… wwn …]-part3 -> ../../sdb3
*********************** END /dev/disk/by-id
*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 May 10 20:06 0940bf03-930d-4494-92e0-5f1cdc597f86 -> ../../sda3
lrwxrwxrwx 1 root root 10 May 10 20:06 29D0-0347 -> ../../sdb1
lrwxrwxrwx 1 root root 10 May 10 20:06 2A15-82CC -> ../../sda2
lrwxrwxrwx 1 root root 10 May 10 20:06 7918274f-e2ec-4983-bbb0-aa93ef95fcf7 -> ../../dm-1
lrwxrwxrwx 1 root root 10 May 10 20:06 96735182-42db-4a5f-944a-2f91eae1edf1 -> ../../sdb2
lrwxrwxrwx 1 root root 10 May 10 20:06 b96c4f72-0523-45ac-a401-f7be73dd624a -> ../../dm-3
lrwxrwxrwx 1 root root 10 May 10 20:06 c0f93369-381c-43d7-948e-14dfbc06ca2b -> ../../dm-4
lrwxrwxrwx 1 root root 10 May 10 20:06 ebda8c23-2154-4559-be2b-9e9c422658d1 -> ../../dm-2
*********************** END /dev/disk/by-uuid
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.15.0-rc5-tp520 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages grub2-common depends on:
ii dpkg 1.17.9
ii grub-common 2.02~beta2-10
ii install-info 5.2.0.dfsg.1-3
ii libc6 2.18-5
ii libdevmapper1.02.1 2:1.02.83-2
ii liblzma5 5.1.1alpha+20120614-2
grub2-common recommends no packages.
grub2-common suggests no packages.
-- no debconf information
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup
2014-05-10 18:53 Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup Martin Steigerwald
@ 2014-06-02 15:39 ` Andrey Borzenkov
2014-07-29 13:12 ` Martin Steigerwald
2014-12-06 11:01 ` Martin Steigerwald
0 siblings, 2 replies; 9+ messages in thread
From: Andrey Borzenkov @ 2014-06-02 15:39 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: Martin, Debian Bug Tracking System
В Sat, 10 May 2014 20:53:34 +0200
Martin Steigerwald <Martin@Lichtvoll.de> пишет:
> Package: grub2-common
> Version: 2.02~beta2-10
> Severity: normal
>
> Dear Maintainer,
>
> I am booting my Debian system via a BTRFS RAID 1 which spans a logical
> volume on a Crucial MSATA and Intel SATA SSD each.
>
> After running update-grub I am getting this in /boot/grub/grub.cfg:
>
> echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
> linux /vmlinuz-3.15.0-rc5-tp520 root=/dev/mapper/sata-debian
> /dev/mapper/msata-debian ro rootflags=subvol=debian init=/bin/systemd resume=/dev/mapper/sata-swap
> echo 'Initiale Ramdisk wird geladen …'
> initrd /initrd.img-3.15.0-rc5-tp520
>
> update-grub basically adds both devices of the BTRFS RAID 1 device
> separated by a line feed. For mounting BTRFS RAID 1 tough one of them
> is enough, once btrfs device scan is run, for which I currently use an
> script for initramfs-tools as a work-around as it didn´t work out of
> the box on my last tests[1].
>
> This behaviour is due to grub-probe which is called by grub-mkconfig
> at line 139
>
> 138 # Device containing our userland. Typically used for root= parameter.
> 139 GRUB_DEVICE="`${grub_probe} --target=device /`"
> 140 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
>
> which is called by update-grub returns both devices with a
> linefeed:
>
> merkaba:~> grub-probe --target=device /
> /dev/mapper/sata-debian
> /dev/mapper/msata-debian
>
> grub-probe is an ELF binary.
>
> The following little change workarounds the issue for me:
>
> merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist /usr/sbin/grub-mkconfig
> --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000 +0200
> +++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200
> @@ -136,7 +136,7 @@
> fi
>
> # Device containing our userland. Typically used for root= parameter.
> -GRUB_DEVICE="`${grub_probe} --target=device /`"
> +GRUB_DEVICE="`${grub_probe} --target=device / | head -1`"
> GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
>
> # Device containing our /boot partition. Usually the same as GRUB_DEVICE.
>
>
> But I suppose the real fix is to be made in the binary grub-probe.
>
No, grub-probe is correct; grub needs to know all devices so it can
have full information which drivers it requires to access them.
See also
https://lists.gnu.org/archive/html/grub-devel/2014-05/msg00005.html
I suggest you discuss it with Colin, but for now I tend to think, fix
should go into 10_linux. May be always use UUID for btrfs.
But this sounds like new can of worms :(
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup
2014-06-02 15:39 ` Andrey Borzenkov
@ 2014-07-29 13:12 ` Martin Steigerwald
2014-08-01 15:43 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-12-06 11:01 ` Martin Steigerwald
1 sibling, 1 reply; 9+ messages in thread
From: Martin Steigerwald @ 2014-07-29 13:12 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: Debian Bug Tracking System, The development of GNU GRUB
Am Montag, 2. Juni 2014, 19:39:22 schrieb Andrey Borzenkov:
> В Sat, 10 May 2014 20:53:34 +0200
>
> Martin Steigerwald <Martin@Lichtvoll.de> пишет:
> > Package: grub2-common
> > Version: 2.02~beta2-10
> > Severity: normal
> >
> > Dear Maintainer,
> >
> > I am booting my Debian system via a BTRFS RAID 1 which spans a logical
> > volume on a Crucial MSATA and Intel SATA SSD each.
> >
> > After running update-grub I am getting this in /boot/grub/grub.cfg:
> > echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
> > linux /vmlinuz-3.15.0-rc5-tp520
> > root=/dev/mapper/sata-debian
> >
> > /dev/mapper/msata-debian ro rootflags=subvol=debian
> > init=/bin/systemd resume=/dev/mapper/sata-swap>
> > echo 'Initiale Ramdisk wird geladen …'
> > initrd /initrd.img-3.15.0-rc5-tp520
> >
> > update-grub basically adds both devices of the BTRFS RAID 1 device
> > separated by a line feed. For mounting BTRFS RAID 1 tough one of them
> > is enough, once btrfs device scan is run, for which I currently use an
> > script for initramfs-tools as a work-around as it didn´t work out of
> > the box on my last tests[1].
> >
> > This behaviour is due to grub-probe which is called by grub-mkconfig
> > at line 139
> >
> > 138 # Device containing our userland. Typically used for root= parameter.
> > 139 GRUB_DEVICE="`${grub_probe} --target=device /`"
> > 140 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE}
> > --target=fs_uuid 2> /dev/null`" || true
> >
> > which is called by update-grub returns both devices with a
> > linefeed:
> >
> > merkaba:~> grub-probe --target=device /
> > /dev/mapper/sata-debian
> > /dev/mapper/msata-debian
> >
> > grub-probe is an ELF binary.
> >
> > The following little change workarounds the issue for me:
> >
> > merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist /usr/sbin/grub-mkconfig
> > --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000
> > +0200
> > +++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200
> > @@ -136,7 +136,7 @@
> >
> > fi
> >
> > # Device containing our userland. Typically used for root= parameter.
> >
> > -GRUB_DEVICE="`${grub_probe} --target=device /`"
> > +GRUB_DEVICE="`${grub_probe} --target=device / | head -1`"
> >
> > GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid
> > 2> /dev/null`" || true
> >
> > # Device containing our /boot partition. Usually the same as
> > GRUB_DEVICE.
> >
> > But I suppose the real fix is to be made in the binary grub-probe.
>
> No, grub-probe is correct; grub needs to know all devices so it can
> have full information which drivers it requires to access them.
>
> See also
> https://lists.gnu.org/archive/html/grub-devel/2014-05/msg00005.html
>
> I suggest you discuss it with Colin, but for now I tend to think, fix
> should go into 10_linux. May be always use UUID for btrfs.
>
> But this sounds like new can of worms :(
Any oppinions here on how to take this forward?
I just applied my patch from above again after a GRUB update.
Colin?
Andrey, what new kind of worms have you in mind? :)
Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup
2014-07-29 13:12 ` Martin Steigerwald
@ 2014-08-01 15:43 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-08-01 16:54 ` Andrey Borzenkov
0 siblings, 1 reply; 9+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-08-01 15:43 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 3621 bytes --]
On 29.07.2014 15:12, Martin Steigerwald wrote:
> Am Montag, 2. Juni 2014, 19:39:22 schrieb Andrey Borzenkov:
>> В Sat, 10 May 2014 20:53:34 +0200
>>
>> Martin Steigerwald <Martin@Lichtvoll.de> пишет:
>>> Package: grub2-common
>>> Version: 2.02~beta2-10
>>> Severity: normal
>>>
>>> Dear Maintainer,
>>>
>>> I am booting my Debian system via a BTRFS RAID 1 which spans a logical
>>> volume on a Crucial MSATA and Intel SATA SSD each.
>>>
>>> After running update-grub I am getting this in /boot/grub/grub.cfg:
>>> echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
>>> linux /vmlinuz-3.15.0-rc5-tp520
>>> root=/dev/mapper/sata-debian
>>>
>>> /dev/mapper/msata-debian ro rootflags=subvol=debian
>>> init=/bin/systemd resume=/dev/mapper/sata-swap>
>>> echo 'Initiale Ramdisk wird geladen …'
>>> initrd /initrd.img-3.15.0-rc5-tp520
>>>
>>> update-grub basically adds both devices of the BTRFS RAID 1 device
>>> separated by a line feed. For mounting BTRFS RAID 1 tough one of them
>>> is enough, once btrfs device scan is run, for which I currently use an
>>> script for initramfs-tools as a work-around as it didn´t work out of
>>> the box on my last tests[1].
>>>
>>> This behaviour is due to grub-probe which is called by grub-mkconfig
>>> at line 139
>>>
>>> 138 # Device containing our userland. Typically used for root= parameter.
>>> 139 GRUB_DEVICE="`${grub_probe} --target=device /`"
>>> 140 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE}
>>> --target=fs_uuid 2> /dev/null`" || true
>>>
>>> which is called by update-grub returns both devices with a
>>> linefeed:
>>>
>>> merkaba:~> grub-probe --target=device /
>>> /dev/mapper/sata-debian
>>> /dev/mapper/msata-debian
>>>
>>> grub-probe is an ELF binary.
>>>
>>> The following little change workarounds the issue for me:
>>>
>>> merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist /usr/sbin/grub-mkconfig
>>> --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000
>>> +0200
>>> +++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200
>>> @@ -136,7 +136,7 @@
>>>
>>> fi
>>>
>>> # Device containing our userland. Typically used for root= parameter.
>>>
>>> -GRUB_DEVICE="`${grub_probe} --target=device /`"
>>> +GRUB_DEVICE="`${grub_probe} --target=device / | head -1`"
>>>
>>> GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid
>>> 2> /dev/null`" || true
>>>
>>> # Device containing our /boot partition. Usually the same as
>>> GRUB_DEVICE.
>>>
>>> But I suppose the real fix is to be made in the binary grub-probe.
>>
>> No, grub-probe is correct; grub needs to know all devices so it can
>> have full information which drivers it requires to access them.
>>
>> See also
>> https://lists.gnu.org/archive/html/grub-devel/2014-05/msg00005.html
>>
>> I suggest you discuss it with Colin, but for now I tend to think, fix
>> should go into 10_linux. May be always use UUID for btrfs.
>>
>> But this sounds like new can of worms :(
>
> Any oppinions here on how to take this forward?
>
While changing grub-probe isn't agood idea: it's GRUB internal tool, we
could filter and leave only one device but I don't think it makes any
sense as multidevice btrfs needs uuid uniqueness in any case. Why didn't
UUID code path kick in?
> I just applied my patch from above again after a GRUB update.
>
> Colin?
>
> Andrey, what new kind of worms have you in mind? :)
>
> Ciao,
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup
2014-08-01 15:43 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2014-08-01 16:54 ` Andrey Borzenkov
0 siblings, 0 replies; 9+ messages in thread
From: Andrey Borzenkov @ 2014-08-01 16:54 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: phcoder
[-- Attachment #1: Type: text/plain, Size: 4491 bytes --]
В Fri, 01 Aug 2014 17:43:03 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> On 29.07.2014 15:12, Martin Steigerwald wrote:
> > Am Montag, 2. Juni 2014, 19:39:22 schrieb Andrey Borzenkov:
> >> В Sat, 10 May 2014 20:53:34 +0200
> >>
> >> Martin Steigerwald <Martin@Lichtvoll.de> пишет:
> >>> Package: grub2-common
> >>> Version: 2.02~beta2-10
> >>> Severity: normal
> >>>
> >>> Dear Maintainer,
> >>>
> >>> I am booting my Debian system via a BTRFS RAID 1 which spans a logical
> >>> volume on a Crucial MSATA and Intel SATA SSD each.
> >>>
> >>> After running update-grub I am getting this in /boot/grub/grub.cfg:
> >>> echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
> >>> linux /vmlinuz-3.15.0-rc5-tp520
> >>> root=/dev/mapper/sata-debian
> >>>
> >>> /dev/mapper/msata-debian ro rootflags=subvol=debian
> >>> init=/bin/systemd resume=/dev/mapper/sata-swap>
> >>> echo 'Initiale Ramdisk wird geladen …'
> >>> initrd /initrd.img-3.15.0-rc5-tp520
> >>>
> >>> update-grub basically adds both devices of the BTRFS RAID 1 device
> >>> separated by a line feed. For mounting BTRFS RAID 1 tough one of them
> >>> is enough, once btrfs device scan is run, for which I currently use an
> >>> script for initramfs-tools as a work-around as it didn´t work out of
> >>> the box on my last tests[1].
> >>>
> >>> This behaviour is due to grub-probe which is called by grub-mkconfig
> >>> at line 139
> >>>
> >>> 138 # Device containing our userland. Typically used for root= parameter.
> >>> 139 GRUB_DEVICE="`${grub_probe} --target=device /`"
> >>> 140 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE}
> >>> --target=fs_uuid 2> /dev/null`" || true
> >>>
> >>> which is called by update-grub returns both devices with a
> >>> linefeed:
> >>>
> >>> merkaba:~> grub-probe --target=device /
> >>> /dev/mapper/sata-debian
> >>> /dev/mapper/msata-debian
> >>>
> >>> grub-probe is an ELF binary.
> >>>
> >>> The following little change workarounds the issue for me:
> >>>
> >>> merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist /usr/sbin/grub-mkconfig
> >>> --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000
> >>> +0200
> >>> +++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200
> >>> @@ -136,7 +136,7 @@
> >>>
> >>> fi
> >>>
> >>> # Device containing our userland. Typically used for root= parameter.
> >>>
> >>> -GRUB_DEVICE="`${grub_probe} --target=device /`"
> >>> +GRUB_DEVICE="`${grub_probe} --target=device / | head -1`"
> >>>
> >>> GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid
> >>> 2> /dev/null`" || true
> >>>
> >>> # Device containing our /boot partition. Usually the same as
> >>> GRUB_DEVICE.
> >>>
> >>> But I suppose the real fix is to be made in the binary grub-probe.
> >>
> >> No, grub-probe is correct; grub needs to know all devices so it can
> >> have full information which drivers it requires to access them.
> >>
> >> See also
> >> https://lists.gnu.org/archive/html/grub-devel/2014-05/msg00005.html
> >>
> >> I suggest you discuss it with Colin, but for now I tend to think, fix
> >> should go into 10_linux. May be always use UUID for btrfs.
> >>
> >> But this sounds like new can of worms :(
> >
> > Any oppinions here on how to take this forward?
> >
> While changing grub-probe isn't agood idea: it's GRUB internal tool, we
> could filter and leave only one device but I don't think it makes any
> sense as multidevice btrfs needs uuid uniqueness in any case. Why didn't
> UUID code path kick in?
Most likely due to
! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"
Currently GRUB_(BOOT)_DEVICE is used as
a) argument for various property probing, where we must know all
individual devices for multi-device file systems
b) as fallback to pass to kernel
may be it makes sense to export both in grub-mkconfig, as
GRUB_KERNEL_DEVICE (which will simply use first in the list; any better
name?)
GRUB_DEVICES (same as GRUB_DEVICE now)
and audit all scripts for usage. Although I was a bit unsure in some
cases, especially for non-Linux.
> > I just applied my patch from above again after a GRUB update.
> >
> > Colin?
> >
> > Andrey, what new kind of worms have you in mind? :)
> >
> > Ciao,
> >
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup
2014-06-02 15:39 ` Andrey Borzenkov
2014-07-29 13:12 ` Martin Steigerwald
@ 2014-12-06 11:01 ` Martin Steigerwald
2014-12-08 20:09 ` Andrei Borzenkov
1 sibling, 1 reply; 9+ messages in thread
From: Martin Steigerwald @ 2014-12-06 11:01 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: Debian Bug Tracking System, The development of GNU GRUB
Am Montag, 2. Juni 2014, 19:39:22 schrieb Andrey Borzenkov:
> В Sat, 10 May 2014 20:53:34 +0200
>
> Martin Steigerwald <Martin@Lichtvoll.de> пишет:
> > Package: grub2-common
> > Version: 2.02~beta2-10
> > Severity: normal
> >
> > Dear Maintainer,
> >
> > I am booting my Debian system via a BTRFS RAID 1 which spans a logical
> > volume on a Crucial MSATA and Intel SATA SSD each.
> >
> > After running update-grub I am getting this in /boot/grub/grub.cfg:
> > echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
> > linux /vmlinuz-3.15.0-rc5-tp520
> > root=/dev/mapper/sata-debian
> >
> > /dev/mapper/msata-debian ro rootflags=subvol=debian
> > init=/bin/systemd resume=/dev/mapper/sata-swap>
> > echo 'Initiale Ramdisk wird geladen …'
> > initrd /initrd.img-3.15.0-rc5-tp520
> >
> > update-grub basically adds both devices of the BTRFS RAID 1 device
> > separated by a line feed. For mounting BTRFS RAID 1 tough one of them
> > is enough, once btrfs device scan is run, for which I currently use an
> > script for initramfs-tools as a work-around as it didn´t work out of
> > the box on my last tests[1].
> >
> > This behaviour is due to grub-probe which is called by grub-mkconfig
> > at line 139
> >
> > 138 # Device containing our userland. Typically used for root= parameter.
> > 139 GRUB_DEVICE="`${grub_probe} --target=device /`"
> > 140 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE}
> > --target=fs_uuid 2> /dev/null`" || true
> >
> > which is called by update-grub returns both devices with a
> > linefeed:
> >
> > merkaba:~> grub-probe --target=device /
> > /dev/mapper/sata-debian
> > /dev/mapper/msata-debian
> >
> > grub-probe is an ELF binary.
> >
> > The following little change workarounds the issue for me:
> >
> > merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist /usr/sbin/grub-mkconfig
> > --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000
> > +0200
> > +++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200
> > @@ -136,7 +136,7 @@
> >
> > fi
> >
> > # Device containing our userland. Typically used for root= parameter.
> >
> > -GRUB_DEVICE="`${grub_probe} --target=device /`"
> > +GRUB_DEVICE="`${grub_probe} --target=device / | head -1`"
> >
> > GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid
> > 2> /dev/null`" || true
> >
> > # Device containing our /boot partition. Usually the same as
> > GRUB_DEVICE.
> >
> > But I suppose the real fix is to be made in the binary grub-probe.
>
> No, grub-probe is correct; grub needs to know all devices so it can
> have full information which drivers it requires to access them.
>
> See also
> https://lists.gnu.org/archive/html/grub-devel/2014-05/msg00005.html
>
> I suggest you discuss it with Colin, but for now I tend to think, fix
> should go into 10_linux. May be always use UUID for btrfs.
>
> But this sounds like new can of worms :(
Any way on how to proceed on this one?
I applied
merkaba:/usr/sbin> diff -u grub-mkconfig.dist grub-mkconfig
--- grub-mkconfig.dist 2014-05-08 14:35:25.000000000 +0200
+++ grub-mkconfig 2014-05-10 20:46:00.380096263 +0200
@@ -136,7 +136,7 @@
fi
# Device containing our userland. Typically used for root= parameter.
-GRUB_DEVICE="`${grub_probe} --target=device /`"
+GRUB_DEVICE="`${grub_probe} --target=device / | head -1`"
GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
# Device containing our /boot partition. Usually the same as GRUB_DEVICE
for a dozen of times meanwhile.
It works for me. I understand that it may not work if the first drive is
not on LVM, while the second is, as I bet grub would not load LVM driver
then. Anyway I still boot of a small Ext4 /boot.
Well I dpkg-diverted the file for now, but this way I risk breakage on
upgrades as changes to the file are not automatically applied.
Maybe above can just to into 10_linux, *just* for the root= kernel command
line.
Or… it could additional devices on kernel command line in that BTRFS syntax, for
non initrd users, but that might break as well as between update-grub and
boot may be changes of device paths.
So either just supplying the first device on kernel command line or the UUID
sounds reasonable to me. Either way BTRFS will require a btrfs device scan
call in initrd, but unless you do add the devices manually on kernel command
line thats just how it is. This is discussed currently in… hmmm, I thought
there was a discussion on BTRFS mailing list, but I do not find it at the
moment.
Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup
2014-12-06 11:01 ` Martin Steigerwald
@ 2014-12-08 20:09 ` Andrei Borzenkov
2014-12-09 17:49 ` Martin Steigerwald
0 siblings, 1 reply; 9+ messages in thread
From: Andrei Borzenkov @ 2014-12-08 20:09 UTC (permalink / raw)
To: Martin Steigerwald
Cc: Debian Bug Tracking System, The development of GNU GRUB
В Sat, 06 Dec 2014 12:01:11 +0100
Martin Steigerwald <Martin@lichtvoll.de> пишет:
> Am Montag, 2. Juni 2014, 19:39:22 schrieb Andrey Borzenkov:
> > В Sat, 10 May 2014 20:53:34 +0200
> >
> > Martin Steigerwald <Martin@Lichtvoll.de> пишет:
> > > Package: grub2-common
> > > Version: 2.02~beta2-10
> > > Severity: normal
> > >
> > > Dear Maintainer,
> > >
> > > I am booting my Debian system via a BTRFS RAID 1 which spans a logical
> > > volume on a Crucial MSATA and Intel SATA SSD each.
> > >
> > > After running update-grub I am getting this in /boot/grub/grub.cfg:
> > > echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
> > > linux /vmlinuz-3.15.0-rc5-tp520
> > > root=/dev/mapper/sata-debian
> > >
> > > /dev/mapper/msata-debian ro rootflags=subvol=debian
> > > init=/bin/systemd resume=/dev/mapper/sata-swap>
> > > echo 'Initiale Ramdisk wird geladen …'
> > > initrd /initrd.img-3.15.0-rc5-tp520
> > >
> > > update-grub basically adds both devices of the BTRFS RAID 1 device
> > > separated by a line feed. For mounting BTRFS RAID 1 tough one of them
> > > is enough, once btrfs device scan is run, for which I currently use an
> > > script for initramfs-tools as a work-around as it didn´t work out of
> > > the box on my last tests[1].
> > >
> > > This behaviour is due to grub-probe which is called by grub-mkconfig
> > > at line 139
> > >
> > > 138 # Device containing our userland. Typically used for root= parameter.
> > > 139 GRUB_DEVICE="`${grub_probe} --target=device /`"
> > > 140 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE}
> > > --target=fs_uuid 2> /dev/null`" || true
> > >
> > > which is called by update-grub returns both devices with a
> > > linefeed:
> > >
> > > merkaba:~> grub-probe --target=device /
> > > /dev/mapper/sata-debian
> > > /dev/mapper/msata-debian
> > >
> > > grub-probe is an ELF binary.
> > >
> > > The following little change workarounds the issue for me:
> > >
> > > merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist /usr/sbin/grub-mkconfig
> > > --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000
> > > +0200
> > > +++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200
> > > @@ -136,7 +136,7 @@
> > >
> > > fi
> > >
> > > # Device containing our userland. Typically used for root= parameter.
> > >
> > > -GRUB_DEVICE="`${grub_probe} --target=device /`"
> > > +GRUB_DEVICE="`${grub_probe} --target=device / | head -1`"
> > >
> > > GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid
> > > 2> /dev/null`" || true
> > >
> > > # Device containing our /boot partition. Usually the same as
> > > GRUB_DEVICE.
> > >
> > > But I suppose the real fix is to be made in the binary grub-probe.
> >
> > No, grub-probe is correct; grub needs to know all devices so it can
> > have full information which drivers it requires to access them.
> >
> > See also
> > https://lists.gnu.org/archive/html/grub-devel/2014-05/msg00005.html
> >
> > I suggest you discuss it with Colin, but for now I tend to think, fix
> > should go into 10_linux. May be always use UUID for btrfs.
> >
> > But this sounds like new can of worms :(
>
> Any way on how to proceed on this one?
>
Try patch below
From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] fix linux kernel root= argument with multidev btrfs
Btrfs may reside on multiple devices, but only one of them should be
passed to root= kernel argument. Add two helper functions:
- get_root_device: select "best" device for the list. For single device
just return it to skip probing; for multiple devices try to find LVM as
before but fall back to the first device if not found.
- find_abstraction: return device with requested abstraction driver from
the given list.
Refactor code to use them and reimplement uses_abstraction on top of
find_abstraction.
Also replace check for LVM with uses_abstraction in 10_kfreebsd.
---
util/grub-mkconfig_lib.in | 50 ++++++++++++++++++++++++++++++++++-----------
util/grub.d/10_kfreebsd.in | 8 +++-----
util/grub.d/10_linux.in | 10 +++++----
util/grub.d/20_linux_xen.in | 10 +++++----
4 files changed, 53 insertions(+), 25 deletions(-)
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 29ef865..ecae264 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -283,21 +283,27 @@ gettext_printf () {
printf "$(gettext "$gettext_printf_format")" "$@"
}
-uses_abstraction () {
- device="$1"
- old_ifs="$IFS"
+find_abstraction () {
+ abstraction="$1"
+ devices="$2"
+ old_IFS="$IFS"
IFS='
'
-
- abstraction="`"${grub_probe}" --device ${device} --target=abstraction`"
- for module in ${abstraction}; do
- if test "x${module}" = "x$2"; then
- IFS="$old_ifs"
- return 0
- fi
+ set $devices
+ IFS="$old_IFS"
+
+ for device in "$@"; do
+ for module in `"${grub_probe}" --device "${device}" --target=abstraction`; do
+ if test "x${module}" = "x${abstraction}"; then
+ printf "%s" "${device}"
+ return
+ fi
+ done
done
- IFS="$old_ifs"
- return 1
+}
+
+uses_abstraction () {
+ test -n "`find_abstraction "$2" "$1"`"
}
print_option_help () {
@@ -368,3 +374,23 @@ grub_add_tab () {
sed -e "s/^/$grub_tab/"
}
+get_root_device() {
+ devices="$1"
+ old_IFS="$IFS"
+ IFS='
+'
+ set $devices
+ IFS="$old_IFS"
+
+ if [ x"$#" = x1 ]; then
+ printf "%s" "$1"
+ return
+ fi
+
+ out="`find_abstraction lvm "$devices"`"
+ if [ x"$out" = x ]; then
+ out="$1"
+ fi
+
+ printf "%s" "$out"
+}
diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in
index 65f6c32..d9d0199 100644
--- a/util/grub.d/10_kfreebsd.in
+++ b/util/grub.d/10_kfreebsd.in
@@ -112,11 +112,9 @@ EOF
load_kfreebsd_module acpi true
- for abstraction in dummy $(${grub_probe} -t abstraction --device ${GRUB_DEVICE}) ; do
- case $abstraction in
- lvm) load_kfreebsd_module geom_linux_lvm false ;;
- esac
- done
+ if uses_abstraction "${GRUB_DEVICE}" lvm; then
+ load_kfreebsd_module geom_linux_lvm false
+ fi
case "${kfreebsd_fs}" in
zfs)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index a2a84dc..68aa1e7 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -44,11 +44,13 @@ case ${GRUB_DEVICE} in
esac
if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
- || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
- || uses_abstraction "${GRUB_DEVICE}" lvm; then
- LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"; then
+ LINUX_ROOT_DEVICE="`get_root_device "${GRUB_DEVICE}"`"
else
- LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+ LINUX_ROOT_DEVICE="`find_abstraction lvm "${GRUB_DEVICE}"`"
+ if [ x"${LINUX_ROOT_DEVICE}" = x ]; then
+ LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+ fi
fi
case x"$GRUB_FS" in
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index de34c8d..b9426e9 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -44,11 +44,13 @@ case ${GRUB_DEVICE} in
esac
if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
- || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
- || uses_abstraction "${GRUB_DEVICE}" lvm; then
- LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"; then
+ LINUX_ROOT_DEVICE="`get_root_device "${GRUB_DEVICE}"`"
else
- LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+ LINUX_ROOT_DEVICE="`find_abstraction lvm "${GRUB_DEVICE}"`"
+ if [ x"${LINUX_ROOT_DEVICE}" = x ]; then
+ LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+ fi
fi
# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
--
tg: (17328db..) u/btrfs-multidev (depends on: master)
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup
2014-12-08 20:09 ` Andrei Borzenkov
@ 2014-12-09 17:49 ` Martin Steigerwald
2014-12-09 18:22 ` Andrei Borzenkov
0 siblings, 1 reply; 9+ messages in thread
From: Martin Steigerwald @ 2014-12-09 17:49 UTC (permalink / raw)
To: Andrei Borzenkov; +Cc: Debian Bug Tracking System, The development of GNU GRUB
Am Montag, 8. Dezember 2014, 23:09:24 schrieb Andrei Borzenkov:
> В Sat, 06 Dec 2014 12:01:11 +0100
>
> Martin Steigerwald <Martin@lichtvoll.de> пишет:
> > Am Montag, 2. Juni 2014, 19:39:22 schrieb Andrey Borzenkov:
> > > В Sat, 10 May 2014 20:53:34 +0200
> > >
> > > Martin Steigerwald <Martin@Lichtvoll.de> пишет:
> > > > Package: grub2-common
> > > > Version: 2.02~beta2-10
> > > > Severity: normal
> > > >
> > > > Dear Maintainer,
> > > >
> > > > I am booting my Debian system via a BTRFS RAID 1 which spans a logical
> > > > volume on a Crucial MSATA and Intel SATA SSD each.
> > > >
> > > > After running update-grub I am getting this in /boot/grub/grub.cfg:
> > > > echo 'Linux 3.15.0-rc5-tp520 wird geladen …'
> > > > linux /vmlinuz-3.15.0-rc5-tp520
> > > > root=/dev/mapper/sata-debian
> > > >
> > > > /dev/mapper/msata-debian ro rootflags=subvol=debian
> > > > init=/bin/systemd resume=/dev/mapper/sata-swap>
> > > >
> > > > echo 'Initiale Ramdisk wird geladen …'
> > > > initrd /initrd.img-3.15.0-rc5-tp520
> > > >
> > > > update-grub basically adds both devices of the BTRFS RAID 1 device
> > > > separated by a line feed. For mounting BTRFS RAID 1 tough one of them
> > > > is enough, once btrfs device scan is run, for which I currently use an
> > > > script for initramfs-tools as a work-around as it didn´t work out of
> > > > the box on my last tests[1].
> > > >
> > > > This behaviour is due to grub-probe which is called by grub-mkconfig
> > > > at line 139
> > > >
> > > > 138 # Device containing our userland. Typically used for root=
> > > > parameter.
> > > > 139 GRUB_DEVICE="`${grub_probe} --target=device /`"
> > > > 140 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE}
> > > > --target=fs_uuid 2> /dev/null`" || true
> > > >
> > > > which is called by update-grub returns both devices with a
> > > > linefeed:
> > > >
> > > > merkaba:~> grub-probe --target=device /
> > > > /dev/mapper/sata-debian
> > > > /dev/mapper/msata-debian
> > > >
> > > > grub-probe is an ELF binary.
> > > >
> > > > The following little change workarounds the issue for me:
> > > >
> > > > merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist
> > > > /usr/sbin/grub-mkconfig
> > > > --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000
> > > > +0200
> > > > +++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200
> > > > @@ -136,7 +136,7 @@
> > > >
> > > > fi
> > > >
> > > > # Device containing our userland. Typically used for root=
> > > > parameter.
> > > >
> > > > -GRUB_DEVICE="`${grub_probe} --target=device /`"
> > > > +GRUB_DEVICE="`${grub_probe} --target=device / | head -1`"
> > > >
> > > > GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE}
> > > > --target=fs_uuid
> > > > 2> /dev/null`" || true
> > > >
> > > > # Device containing our /boot partition. Usually the same as
> > > > GRUB_DEVICE.
> > > >
> > > > But I suppose the real fix is to be made in the binary grub-probe.
> > >
> > > No, grub-probe is correct; grub needs to know all devices so it can
> > > have full information which drivers it requires to access them.
> > >
> > > See also
> > > https://lists.gnu.org/archive/html/grub-devel/2014-05/msg00005.html
> > >
> > > I suggest you discuss it with Colin, but for now I tend to think, fix
> > > should go into 10_linux. May be always use UUID for btrfs.
> > >
> > > But this sounds like new can of worms :(
> >
> > Any way on how to proceed on this one?
>
> Try patch below
>
> From: Andrei Borzenkov <arvidjaar@gmail.com>
> Subject: [PATCH] fix linux kernel root= argument with multidev btrfs
>
> Btrfs may reside on multiple devices, but only one of them should be
> passed to root= kernel argument. Add two helper functions:
>
> - get_root_device: select "best" device for the list. For single device
> just return it to skip probing; for multiple devices try to find LVM as
> before but fall back to the first device if not found.
>
> - find_abstraction: return device with requested abstraction driver from
> the given list.
>
> Refactor code to use them and reimplement uses_abstraction on top of
> find_abstraction.
>
> Also replace check for LVM with uses_abstraction in 10_kfreebsd.
>
> ---
> util/grub-mkconfig_lib.in | 50
> ++++++++++++++++++++++++++++++++++----------- util/grub.d/10_kfreebsd.in |
> 8 +++-----
> util/grub.d/10_linux.in | 10 +++++----
> util/grub.d/20_linux_xen.in | 10 +++++----
> 4 files changed, 53 insertions(+), 25 deletions(-)
>
> diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
This looks like it needs to be applied to grub sources instead a installed
grub.
> # Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
[…]
> tg: (17328db..) u/btrfs-multidev (depends on: master)
Or I can use some version control branch?
I don´t see the branch on
http://git.savannah.gnu.org/cgit/grub.git/refs/heads
Where can I clone it?
And then I just build it and copy over the generated files from the files the
patch changed manually to my installed grub to test?
I have grub-pc 2.02~beta2-17 debian package installed.
Thanks,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup
2014-12-09 17:49 ` Martin Steigerwald
@ 2014-12-09 18:22 ` Andrei Borzenkov
0 siblings, 0 replies; 9+ messages in thread
From: Andrei Borzenkov @ 2014-12-09 18:22 UTC (permalink / raw)
To: Martin Steigerwald
Cc: Debian Bug Tracking System, The development of GNU GRUB
В Tue, 09 Dec 2014 18:49:21 +0100
Martin Steigerwald <Martin@lichtvoll.de> пишет:
>
> This looks like it needs to be applied to grub sources instead a installed
> grub.
>
You are posting to grub-devel, right? :)
> > # Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
>
> […]
>
> > tg: (17328db..) u/btrfs-multidev (depends on: master)
>
> Or I can use some version control branch?
>
> I don´t see the branch on
>
> http://git.savannah.gnu.org/cgit/grub.git/refs/heads
>
> Where can I clone it?
>
Just apply on top of master.
git clone git://git.savannah.gnu.org/grub.git
cd grub
git am e-mail-with-patch
> And then I just build it and copy over the generated files from the files the
> patch changed manually to my installed grub to test?
>
I do not know what other patches Debian has, so using upstream directly
may lose Debian specific changes. Also you would need to build using
correct configure options.
I would suggest to build it for different prefix, like
./autogen.sh
./configure --prefix=/usr/local/grub-test
make
make install
then run /usr/local/grub-test/sbin/grub-mkconfig and examine generated
configuration.
> I have grub-pc 2.02~beta2-17 debian package installed.
>
I myself do not use Debian, sorry.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-12-09 18:22 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-10 18:53 Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup Martin Steigerwald
2014-06-02 15:39 ` Andrey Borzenkov
2014-07-29 13:12 ` Martin Steigerwald
2014-08-01 15:43 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-08-01 16:54 ` Andrey Borzenkov
2014-12-06 11:01 ` Martin Steigerwald
2014-12-08 20:09 ` Andrei Borzenkov
2014-12-09 17:49 ` Martin Steigerwald
2014-12-09 18:22 ` Andrei Borzenkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).