Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Booting from Raid1 (/ and /boot on the same system) [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Sat Dec 27, 2014 10:49 am    Post subject: Booting from Raid1 (/ and /boot on the same system) [solved] Reply with quote

Hi all

This is my setup.

/dev/md0 100G rootfs (contains / and /boot) Raid1

Grub seems to not find the files on disk as all I get is the grub prompt when booting.

I have installed grub on three of the disks (the fourth one complains about multiple labels and refuses to install grub)

I have tried to point my grub.conf to run the rootfs on both /dev/md0 and /dev/sda1 to no success.

I'm sorry if this is short but I am writing from my laptop and don't have a easy way of transfering the config files to it for you all to investigate.

What steps is needed to make this work? Do I need a custom initramfs to boot from /dev/md0?
_________________
From Gentoo with love


Last edited by Sedrik on Sat Dec 27, 2014 2:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
lagalopex
Guru
Guru


Joined: 16 Oct 2004
Posts: 562

PostPosted: Sat Dec 27, 2014 11:16 am    Post subject: Reply with quote

What filesystem is your / (containing the /boot)?
Raid1 over four disks, nothing else?
MBR or GPT partitioned disks?
"grub legacy" (0.97) or "grub 2"?
"grub promt"... what exact error message? grub loads but it does not find any kernels? have you tried to find the kernels? (perhaps wrong "path"?)

initrd is not necessary as long as your kernel directly includes the needed parts (eg. sata controller, mdraid and filesystem).
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54232
Location: 56N 3W

PostPosted: Sat Dec 27, 2014 11:24 am    Post subject: Reply with quote

Sedrik,

Which version of grub are you using and which version of raid metadata?

With grub2 the raid metadata version does not matter but you need to assemble the raid set before root can be mounted.
grub has no make its own arrangements for finding and reading /boot.

With legacy grub, the raid set where /boot is must be Version : 0.90.00 raid metadata.
$ sudo mdadm -E /dev/sda1:

Password:
/dev/sda1:
          Magic : a92b4efc
        Version : 0.90.00

This is because Version : 0.90.00 raid metadata is at the end of the raid volume and grub legacy just ignores raid. This is why only raid1 works for /boot with legacy grub too.

There is another wrinkle. The kernel raid autodetect only works with 0.90.00 raid metadata. If you use the default, which is 1.2, you will need an initrd to assemble the raid before you can mount root. However, your system is still trying to find /boot, which gets me back to the orignal question.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Sat Dec 27, 2014 1:32 pm    Post subject: Reply with quote

Metadata version is 0.90.00

I use grub 2.02_beta2-r3

/ is a ext4 filesystem

It's 4 primary partitions running Raid1 and 4 primary ones running a Raid5 system (1 of them is a spare). (/dev/md0 is sd[abcd]1 and /dev/md1 is sd[abcd]2)

The error I get when trying to install grub on sdd is
"warning: Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet..
error: embedding is not possible, but this is required for RAID and LVM install."

I get no error when I try to boot the machine from disk only the grub> prompt where it tells me I need to load the kernel before booting (if I try the boot command).

Thanks for all the help.
_________________
From Gentoo with love
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54232
Location: 56N 3W

PostPosted: Sat Dec 27, 2014 1:41 pm    Post subject: Reply with quote

Sedrik,

Lets ignore the sdd issue for now. The grub> prompt means that grub cannot find its configuration file. In this case grub.cfg.

Your original post says
Quote:
I have tried to point my grub.conf to run the rootfs on both /dev/md0 and /dev/sda1 to no success.
which mentions grub.conf.
That file name is for legacy grub. The name and content changed for grub2.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Sat Dec 27, 2014 2:09 pm    Post subject: Reply with quote

Ah, that was something I had completely missed =)

Now it boots but it did not remount / to the raid (rather booted into one of the discs) How can I fix that?
_________________
From Gentoo with love
Back to top
View user's profile Send private message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Sat Dec 27, 2014 2:49 pm    Post subject: Reply with quote

Ok, seems to be me just forgetting to update fstab.

Now everything seems to be working as I want it too =)

Many thanks for all your help!
_________________
From Gentoo with love
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54232
Location: 56N 3W

PostPosted: Sat Dec 27, 2014 2:50 pm    Post subject: Reply with quote

Sedrik,

Your raid will now be out of sync.

I guess you have root=/dev/sda in grub.cfg ?
You need root=/dev/md...

Why do you say it booted to one of the discs?
If that is really what happened, the next and subsequent attempts to assemble the raid will either fail or result in the raid running in degraded mode.
You will need to add the missing element back into the raid set, so it can sync again.

/proc/mdstat will tell you what is going on. I get
cat /proc/mdstat:
 
Personalities : [raid1] [raid6] [raid5] [raid4]
md127 : active raid5 sda6[0] sdd6[3] sdc6[2] sdb6[1]
      2912833152 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
     
md126 : active raid5 sda5[0] sdd5[3] sdc5[2] sdb5[1]
      15759360 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
     
md125 : active raid1 sda1[0] sdd1[3] sdc1[2] sdb1[1]
      40064 blocks [4/4] [UUUU]
     
unused devices: <none>
md125 is my /boot
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Sat Dec 27, 2014 3:29 pm    Post subject: Reply with quote

It seems to be all fine

Code:
sedrik@raider ~ $ cat /proc/mdstat
Personalities : [raid1] [raid10] [raid6] [raid5] [raid4]
md1 : active raid5 sdc2[4] sda2[0] sdd2[3](S) sdb2[1]
      3697048576 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
     
md0 : active raid1 sdd1[3] sda1[0] sdb1[1] sdc1[2]
      104857536 blocks [4/4] [UUUU]
     
unused devices: <none>
sedrik@raider ~ $ df -h
df: ‘/proc/bus/usb’: No such file or directory
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        99G  9.5G   84G  11% /
udev            1.8G     0  1.8G   0% /dev
/dev/md0         99G  9.5G   84G  11% /mnt/md0
shm             1.9G     0  1.9G   0% /dev/shm
/dev/md0         99G  9.5G   84G  11% /mnt/md0
/dev/md1        3.4T  1.9T  1.4T  58% /mnt/md1
sedrik@raider ~ $ ls -l /dev/root
lrwxrwxrwx 1 root root 3 Dec 27 15:57 /dev/root -> md0


I not sure why I thought that it was booting into only one of the discs earlier. After updating my fstab everything seemed fine.
_________________
From Gentoo with love
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54232
Location: 56N 3W

PostPosted: Sat Dec 27, 2014 3:37 pm    Post subject: Reply with quote

Sedrik,

Looks good. Raid5 either works or it doesn't. There is no possibility of it starting on only one disk.
It can and will start on n-1 disks though.

Thats why you run the monitor, so it emails you about nasty things happening to your raid set that don't actually stop it working.
You can still get unlucky. I had two drives kicked out of a raid5 set only 15 minutes apart.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Sat Dec 27, 2014 11:06 pm    Post subject: Reply with quote

Yeah thats why I am running a Spare in it now (ran 4 disks without a spare before this change).

Hopefully I will be able to keep all my data. Will look for a good way of doing of-site backups of the most precious stuff though (images and what not)
_________________
From Gentoo with love
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Tue Jan 06, 2015 1:54 pm    Post subject: Reply with quote

@Sedrik: Can I ask what your fstab looks like? It would be useful for others searching this forum in future.

Thanks,
steveL.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum