LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   gentoo grub cant resolve root using raid1 (https://www.linuxquestions.org/questions/gentoo-87/gentoo-grub-cant-resolve-root-using-raid1-4175535335/)

dannyk1 02-27-2015 08:59 PM

gentoo grub cant resolve root using raid1
 
Hi Guys.

Trying to setup a new system on Raid 1.

I followed the handbook and This site and now I cant boot the system.

I get the error unable to resolve root: UUID XXX

The install works as I rsynced it onto a spare HDD with a ext4 partition, plugged it into sda slot (removed other), reconfigured grub and other configs and it boots fine.

I am using Grub2 boot loader following instructions from the handbook
Quote:

grub2-mkconfig -o /boot/grub/grub.cfg
I tried downgrading grub to grub:0 and manually setup my conf file with similar non booting results.

Here are some of my configs (or useful bits)

/etc/mdadm.conf
Quote:

ARRAY /dev/md0 metadata=0.90 UUID=799f745c:7b24cc72:25c9ef3c:aa4e42c9
This came from the command mdadm --detail --scan >> /etc/mdadm.conf

/etc/fstab
Quote:

/dev/md0 / ext4 noatime,user_xattr 0 1
and from grub.cfg

Quote:

linux /vmlinuz-3.18.7-gentoo root=UUID=23b7cbb0-a3c5-4e85-89dd-23e6b9e1c637 ro
initrd /initramfs-genkernel-x86-3.18.7-gentoo
I did notice the UUID's didn't match so during testing, I changed them to be the same with the same results.

If I change the grub config from UUID to /dev/md0, I get the same results.


Any help would be great.

Danny

colorpurple21859 03-01-2015 07:46 AM

Are you using grub2 or grub legacy? For grub legacy the line should be
Code:

kernel /vmlinuz-3.18.7-gentoo root=UUID=23b7cbb0-a3c5-4e85-89dd-23e6b9e1c637 ro

dannyk1 03-01-2015 02:04 PM

Grub2.

I just followed the handbook which now uses grub2 (which I've never used before). I may have to downgrade grub and try what you said.

colorpurple21859 03-01-2015 04:15 PM

the post you mention is for legacy grub, maybe these will help for grub2. I know they are for other distros, but they may help.
https://ritter.vg/blog-grub2_raid_boot.html
https://bbs.archlinux.org/viewtopic.php?id=160322
http://www.howtoforge.com/how-to-set...n-ubuntu-10.04

dannyk1 03-02-2015 04:20 AM

Thanks for the help. Happy to reply that I got it working after many many hours trial and error taking suggestions from those listed links.

In the end I think I needed grub2 emerged with -device-mapper use flag and also the auto config from grub wasn't picking the right UUID. When I manually changed it to what was in mdadm.conf, it booted fine.

dannyk1 03-02-2015 04:46 AM

May have spoken too soon

Now during the boot process I can see an error

Quote:

EXT3-fs (sda4): error: couldn't mount because of unsupported optional features (240)
sda4 is the location of my md0 and is my / partition. It was formatted ext4. (Boot is on sda2 and only ext2)


Now the operating system loads and works ok but the command cat /proc/mdstat returns

Quote:

cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] [linear] [multipath]
unused devices: <none>
There is also no md device in /dev. mdadm --detail /dev/md0 can't find anything.

It seems to be running off an array but isn't aware of it.

I think grub must be still missing something.

colorpurple21859 03-02-2015 05:33 AM

Quote:

I think grub must be still missing something.
This is most lilely has nothing to do with grub, once the system boots grub is out of the picture.
Quote:

Now the operating system loads and works ok but the command cat /proc/mdstat returns
Code:

cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] [linear] [multipath]
unused devices: <none>
There is also no md device in /dev. mdadm --detail /dev/md0 can't find anything.


It is most likely a kernel or configuration file adjustment.

dannyk1 03-02-2015 06:10 AM

Strange that the system will pick up raid devices from other disk if I put them in. Or if I boot the system from a live cd, then mount the md0, it works fine.

My brain is hurting too much now. I'll look at tomorrow after work.
May still even give up on grub2 and go back to legacy.

dannyk1 03-03-2015 05:34 AM

I have spent so many hours trying to figure this out with no luck

I went back over my kernel config and made sure all drivers for raid were in the kernel.

Still no luck so I removed grub2 and went grub legacy. Following above instructions, it boots with the same issues eg. cant find md0 but the operating system still works.

I followed these tutorials a few years ago on another machine and it worked great. I cant figure out what I am doing different.

I'm running kernel 3.18. I may have to try downgrading to a lower version.

dannyk1 03-06-2015 09:49 PM

Bit of an update for anyone interested.

I copied a kernel from another machine I setup a few years ago to this machine (/usr/src/linux-3.3.8) including its config and recompiled it on the new machine.

This kernel boots up fine (with no initrd) and everything works fine. (using root=/dev/md0)

I tried booting one of the newer kernels (3.18.7) with no initrd and it wont boot.

My question is what has changed since 3.3.8 that makes raid behave so differently.

syg00 03-06-2015 10:03 PM

Config_md_autodetect ?

dannyk1 03-06-2015 10:07 PM

CONFIG_MD_AUTODETECT=y

dannyk1 03-07-2015 12:55 AM

2 Attachment(s)
Not sure what I have done but I copied the .config from the working 3.3.8 kernel to the new 3.18.7 and re rolled the kernel.

Works great with no initrd and root=/dev/md0
/proc/mdstat and mdadm --detail both show working raid arrays.

I have attached the working config and non-working config.

If anyone can see the difference that stops it booting from raid, I would love to have it pointed out to me for the future.


All times are GMT -5. The time now is 05:16 PM.