bugGNU GRUB - Bugs: bug #39591, grub-mkconfig fails on btrfs raid


You are not allowed to post comments on this tracker with your current authentification level.

bug #39591: grub-mkconfig fails on btrfs raid

Submitted by:  Florian Scandella <fscan>
Submitted on:  Sun 28 Jul 2013 03:29:53 PM UTC  
Votes:  100  
Category: ConfigurationSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: otherReproducibility: Every Time
Planned Release: None

Fri 31 Jul 2015 07:13:03 AM UTC, comment #3:


For some reason I preferred not using UUIDs when setting it up, can't remember why exactly..

Konstantin Svist <fry_kun>
Fri 31 Jul 2015 04:00:52 AM UTC, comment #2:

@Konstantin: Why it tries to use devices in your case? It should be using UUID.

Andrei Borzenkov <arvidjaar>
Project Member
Fri 31 Jul 2015 12:01:32 AM UTC, comment #1:

I'm hitting this problem in Fedora 22 with RAID1 Btrfs

As described by Florian, grub2-mkconfig gets a list of devices in GRUB_DEVICE -- which is subsequently written into generated grub.cfg like so:

linux16 /subvol_root/boot/vmlinuz-4.1.2-200.fc22.x86_64 root=/dev/sda3
/dev/sdb3 ro rootflags=subvol=subvol_root rd.md=0 rd.lvm=0 rd.dm=0 rd.luks=0 quiet rhgb raid=noautodetect
initrd16 /subvol_root/boot/initramfs-4.1.2-200.fc22.x86_64.img

# grub2-mkconfig -v
grub2-mkconfig (GRUB) 2.02~beta2
rpm -q grub2

Konstantin Svist <fry_kun>
Sun 28 Jul 2013 03:29:53 PM UTC, original submission:

using grub-2.00.5043-3 from arch linux testing.

grub-mkconfig line 131:
GRUB_DEVICE="`${grub_probe} --target=device /`"

on a btrfs raid GRUB_DEVICE now holds a list of devices. this fails in several places when generating the grub.cfg.
for example the next line will fail:

GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true

a solution would be to change this to:

GRUB_DEVICE_UUID="`${grub_probe} --target=fs_uuid / 2> /dev/null`" || true

and use GRUB_DEVICE_UUID instead of GRUB_DEVICE everywhere if set.

another quick fix would be:

GRUB_DEVICE="`${grub_probe} --target=device / | head -n 1`"

to only look at the first returned device.

Florian Scandella <fscan>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by arvidjaar (Posted a comment)
  • -unavailable- added by fry_kun (Posted a comment)
  • -unavailable- added by fry_kun (Voted in favor of this item)
  • -unavailable- added by phcoder (Updated the item)
  • -unavailable- added by fscan (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 100 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 31 Jul 2015 12:01:32 AM UTCfry_kunCarbon-Copy-=>Added fry_kun
    Mon 14 Oct 2013 04:30:59 PM UTCphcoderStatusNone=>Fixed

    Back to the top

    Powered by Savane 3.1-cleanup