Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Grub won't boot from GPT RAID (gave up waiting for root dev)

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Uriel32
Posts: 1
Joined: 2017-01-20 16:30

Grub won't boot from GPT RAID (gave up waiting for root dev)

#1 Post by Uriel32 »

I'm having problems with booting a Debian 8 system on which I migrated the root partition from a single hard drive to a RAID1 (mdraid).

On every boot I get the following grub error:

Code: Select all

Gave up waiting for root device. Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
   - Check root= (did the system wait for the right device?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/disk/by-uuid/2ab18cb4-a23d-4e5c-b37d-cbd3077b878c does not exist.
Dropping to a shell!
modprobe: module ehci-orion not found in modules.dep

(initramfs)
/dev/md0 is not started, so it can't find the root partition:

Code: Select all

(initramfs) ls /dev/md*
ls: /dev/md*: No such file or directory
(initramfs)
I can however start the raid manually just fine:

Code: Select all

(initramfs) mdadm --assemble --scan
mdadm: /dev/md0 has been started with 2 drives.
(initramfs) ls /dev/md*
/dev/md0
The System will only boot if I manually create the directory /dev/disk/by-uuid and link md0:
(shouldn't at least /dev/disk/by-uuid already exist?)

Code: Select all

(initramfs) mkdir /dev/disk/by-uuid
(initramfs) ln -s /dev/md0 /dev/disk/by-uuid/2ab18cb4-a23d-4e5c-b37d-cbd3077b878c
I hope someone can help me figure out why grub doesn't start the md device by itself. I searched the internet and tried about everything I could find but no luck. I'm really lost right now.

Additional info:

(I want to boot via BIOS-legacy, not UEFI)

The only two connected hard drives (SSD!) are formated with a GPT partition table and the following partitions:
(grub-pc needs the first partition to boot from GPT drives)

Code: Select all

1      1049kB  2097kB  1049kB                     bios_grub
2      2150MB  12,9GB  10,7GB  ext4               raid
The Raid1 (v0.90 metadata) is formated directly as ext4.

Through a live system chroot I installed grub-pc to /dev/sda and /dev/sdb, changed my fstab, ran update-grub and update-initramfs -u -k all.
blkid:

Code: Select all

/dev/sda2: UUID="b59d3baf-346b-568d-03a2-8b26060640c5" TYPE="linux_raid_member" PARTUUID="0609ba5b-9065-41f8-80ed-6832e3236ec9"
/dev/sdb2: UUID="b59d3baf-346b-568d-03a2-8b26060640c5" TYPE="linux_raid_member" PARTUUID="24ee1040-02dd-4867-b4da-5be11d59bdcd"
/dev/md0: UUID="2ab18cb4-a23d-4e5c-b37d-cbd3077b878c" TYPE="ext4"
/dev/sda1: PARTUUID="df5161cf-b5b3-422c-9ed2-90a7750ac265"
/dev/sdb1: PARTUUID="7d20b55b-ba50-4187-b05e-ae1f18b21de3"
mdadm.conf contains (only!) the content from mdadm --detail --scan:

Code: Select all

ARRAY /dev/md0 metadata=0.90 UUID=b59d3baf:346b568d:03a28b26:060640c5
Here is an excerpt from my /boot/grub/grub.cfg:

Code: Select all

load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod part_gpt
insmod diskfilter
insmod mdraid09
insmod ext2
set root='mduuid/b59d3baf346b568d03a28b26060640c5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='mduuid/b59d3baf346b568d03a28b26060640c5'  2ab18cb4-a23d-4e5c-b37d-cbd3077b878c
else
  search --no-floppy --fs-uuid --set=root 2ab18cb4-a23d-4e5c-b37d-cbd3077b878c
fi
echo        'Linux 3.16.0-4-amd64 wird geladen …'
linux       /boot/vmlinuz-3.16.0-4-amd64 root=UUID=2ab18cb4-a23d-4e5c-b37d-cbd3077b878c ro  rootdelay=20
echo        'Initiale Ramdisk wird geladen …'
initrd      /boot/initrd.img-3.16.0-4-amd64
I can reproduce this in a virtual machine:
  • - Create GPT partition table on disk
    - Install Debian to disk
    - Create two slightly larger virtual disks with RAID on them
    - Copy partitions to RAID
    - Install grub on both RAID members
    - Update initramfs

Post Reply