Skip to contentSkip to conversation

root in grub for raid1

DISCUSSION Egbert Bouwman 3 participants 3 messages Dec 16, 2016 – Dec 17, 2016 MD RAID

lore
Share & tools
lore
#0 lore raw

Newbie, but this list seems to be for developers. If that is true I'll ask my one question, and then retire.

Actually it is a question about grub, but I think the raid specialists know more about this grub problem than the grubbers do.

Setting up raid1 for /dev/sda and /dev/sdb (actually for missing and /dev/sdb) on /dev/md/data succeeded, but now I have to do a dpkg-reconfigure grub-efi-amd64 and i don't know how to specify root in the two grub lines:

	set root=...

and the linux command line
linux root=
Please note that i chose md/data, and not the common md0.

egbert

Signature · 1 line
Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991
#1 lore raw
Quoted 2 lines · Egbert Bouwman

Newbie, but this list seems to be for developers. If that is true I'll ask my one question, and then retire.

It's for both, so this is fine.

Quoted 10 lines

Actually it is a question about grub, but I think the raid specialists know more about this grub problem than the grubbers do.

Setting up raid1 for /dev/sda and /dev/sdb (actually for missing and /dev/sdb) on /dev/md/data succeeded, but now I have to do a dpkg-reconfigure grub-efi-amd64 and i don't know how to specify root in the two grub lines:

	set root=...

and the linux command line
linux root=
Please note that i chose md/data, and not the common md0.

Here's how Debian's installer automatically set it up on one of our machines, which should help.

df:
/dev/md0 497817 30722 456815 7% /boot

mdadm --detail /dev/md0:

 0       8        1        0      active sync   /dev/sda1
 1       8       17        1      active sync   /dev/sdb1
 2       8       33        2      active sync   /dev/sdc1

blkid:
/dev/sda1: UUID="97dad9d1-ffbd-302a-f0d9-91deb32240d0" UUID_SUB="cf4cfce6-2f61-d15c-2ebf-3aea07f9644c" TYPE="linux_raid_member"

/dev/sdb1: UUID="97dad9d1-ffbd-302a-f0d9-91deb32240d0" UUID_SUB="c879211d-9efa-3f08-6d54-0f2f3249a839" TYPE="linux_raid_member"

/dev/sdc1: UUID="97dad9d1-ffbd-302a-f0d9-91deb32240d0" UUID_SUB="51e0ab31-8fb4-8be3-7626-3ab449732c24" TYPE="linux_raid_member"

/dev/md0: UUID="4e19f8d1-d373-42f1-832b-4da7c1a72930" TYPE="ext3"

And finally, here's the grub.cfg lines:

set root='(mduuid/97dad9d1ffbd302af0d991deb32240d0)'
search --no-floppy --fs-uuid --set=root
4e19f8d1-d373-42f1-832b-4da7c1a72930
echo 'Loading Linux 3.2.0-4-amd64 ...'
linux /vmlinuz-3.2.0-4-amd64
root=UUID=04324b83-7740-49cd-8866-cb88e1a54845 ro quiet radeon.modeset=0

So it appears the first "set root=" line should be the blkid UUID of the underlying partitions (/dev/sdb in your case?), and the second "search --set=root" should be the UUID of the RAID partition (/dev/md/data is your case?).

Works on our machines, anyway. <shrug>

Signature · 1 line
Robert L Mathews, Tiger Technologies, http://www.tigertech.net/
#2 lore raw
In reply to Egbert Bouwman
Quoted 9 lines · Egbert Bouwman

Newbie, but this list seems to be for developers. If that is true I'll ask my one question, and then retire.

Actually it is a question about grub, but I think the raid specialists know more about this grub problem than the grubbers do.

Setting up raid1 for /dev/sda and /dev/sdb (actually for missing and /dev/sdb) on /dev/md/data succeeded, but now I have to do a dpkg-reconfigure grub-efi-amd64 and i don't know how to specify root in the two grub lines:

Quoted 7 lines
	set root=...

and the linux command line
linux root=
Please note that i chose md/data, and not the common md0.

egbert

The first thing I noticed in your post was "grub-efi-amd" - I thought on modern UEFI systems, you used UEFI and not grub to boot linux ...

But, as another datapoint, I boot from almost exactly the same setup as you, two mirrored disks on a GPT/BIOS system. My grub entry is

menuentry 'Gentoo GNU/Linux, with Linux 4.4.6-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option

'gnulinux-4.4.6-gentoo-advanced-ab538350-d249-413b-86ef-4bd5280600b8' {
        load_video
        insmod gzio
        insmod part_gpt
        insmod part_gpt
        insmod diskfilter
        insmod mdraid1x
        insmod ext2
        set root='mduuid/69270eaca840f6e70199064bd5863c5d'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root
--hint='mduuid/69270eaca840f6e70199064bd5863c5d'
ab538350-d249-413b-86ef-4bd5280600b8
        else
          search --no-floppy --fs-uuid --set=root
ab538350-d249-413b-86ef-4bd5280600b8
        fi
        echo    'Loading Linux 4.4.6-gentoo ...'
        linux   /boot/vmlinuz-4.4.6-gentoo

root=UUID=ab538350-d249-413b-86ef-4bd5280600b8 ro domdadm
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-genkernel-x86_64-4.4.6-gentoo
}

Cheers,
Wol