You are not logged in.

#1 2013-03-26 18:50:45

wagner-felix
Member
Registered: 2013-03-26
Posts: 11

Raid + Grub2

Hello,

today i tried installing arch on my pc however I'm stuck at installing grub.

My setup:

I first created a Raid 1 with two disks:

mdadm -C /dev/md0 -l1 -n2 -e0.9 /dev/sda /dev/sdb

then I created two gpt partitions on md0 after it got synced:
so i got /dev/md0p1 and /dev/md0p2.

the 2nd partition is intended for a lvm. the 1st partition is intended as the / partition.

so i went on to install the system. created the hooks and modules for initcpio and so on.

then I wanted to install grub
so I first marked /dev/md0p1 as bootable
and then went on to install grub:

grub-install --recheck /dev/md0

went just fine
then I created a config

grub-mkconfig -o /boot/grub/grub.cfg
also went fine

obviously i also wrote the raid config to mdadm.conf however if i reboot
I only get a: GRUB

no bootmenu, etc. what am i doing wrong?

Offline

#2 2013-03-26 23:19:43

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Raid + Grub2

This?

I don't use grub... nor do I trust my /boot on anything but a normal partition (which I guess means I don't trust grub wink ).

Offline

#3 2013-03-27 01:09:29

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: Raid + Grub2

You say you used GPT partitioning, but you recreated the steps to install grub on mbr, that probably is the problem. You need to read the correct part of the wiki

https://wiki.archlinux.org/index.php/Gr … _Partition

Last edited by s1ln7m4s7r (2013-03-27 01:10:22)

Offline

#4 2013-03-27 09:13:03

wagner-felix
Member
Registered: 2013-03-26
Posts: 11

Re: Raid + Grub2

Ok now what I have is:

One raid device /dev/md0 consisting of /dev/sda and /dev/sdb

On the /dev/md0 the first partition: /dev/md0p1 is where arch is installed.
The second partition: /dev/md0p2 is home
and then I created a third partition with:

"parted /dev/md0 set 3 bios_grub on"

which is a bios boot partition taht starts at 17.4KB and ends at 1049kB.

I then mounted the arch installation:

"mount /dev/md0p1 /mnt"

Change rootet to it:

"arch-chroot /mnt /bin/bash"

and tried:

"grub-install --recheck --debug /dev/md0"

which reported no error.
I then went on to create a grub.fg:

"grub-mkconfig -o /boot/grub/grub.cfg"

also no error.

then I exit the chroot envoronment and unmount /mnt
and reboot.

But I still get the same error: It only shows: GRUB

Offline

#5 2013-03-27 21:22:05

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Raid + Grub2

Wait... you are trying to put the bios boot partition on the RAID array?!?! 

The bios boot partition is there because grub requires more space than the area that makes up the boot sector of the drive.  So when using MBR partitioning, it would then take the space between the MBR itself and the start of the first partition (this is actually really not a good idea for reasons I will not get into here). When you partition in GPT format, this area is now being used to store the partition information.  So in order to have ebough space for grub, you need to create a small partition for the rest of this information. 

What is held in this area is the stuff needed to read things like LVM and RAID.  So if you put this partition on the RAID array, and that is the part that is used to read teh RAID array... well, yeah.  That's not going to work.

Offline

#6 2013-03-27 22:28:15

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: Raid + Grub2

...
and tried:
"grub-install --recheck --debug /dev/md0"
which reported no error.
I then went on to create a grub.fg:
"grub-mkconfig -o /boot/grub/grub.cfg"
also no error.
...

I've been reading that it may take a different approach wen handling with grub2 and raid (because grub doesn't have built-in support for RAID), check these out:

http://travishegner.com/2012/02/boot-ar … VN4MxwYxp0

https://bbs.archlinux.org/viewtopic.php?id=123698

NEW EDIT (TEST STEPS):

To be able to install grub on RAID you'll need to redo everything from scratch. These are the steps that you need to make different for it to work:

Setting up partitions and create RAID:

parted /dev/sda mklabel gpt
parted /dev/sda print
parted /dev/sda mkpart primary 0 2
parted /dev/sda set 1 bios_grub on
parted /dev/sda mkpart primary 2 <end of partition>
parted /dev/sda set 2 raid on
parted /dev/sdb mklabel gpt
parted /dev/sdb print
parted /dev/sdb mkpart primary 0 2
parted /dev/sdb set 1 bios_grub on
parted /dev/sdb mkpart primary 2 <end of partition>
parted /dev/sdb set 2 raid on
mdadm --create /dev/md0 --raid-devices=2 --level=1 /dev/sda2 /dev/sdb2

Installing GRUB:

grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sda
grub-install /dev/sdb

NOTE: If you don't want to have all this work and if you don't really need grub, i recommend installing syslinux, it is a lot simpler to install (you can use what you already have, just install and setup)

https://wiki.archlinux.org/index.php/Syslinux

Last edited by s1ln7m4s7r (2013-03-28 00:44:50)

Offline

#7 2013-03-30 17:47:19

wagner-felix
Member
Registered: 2013-03-26
Posts: 11

Re: Raid + Grub2

Yeah, actually my setup works as well and as you also pointed out
if I install grub on sda and sdb it boots.

grub-install /dev/sda
grub-install /dev/sdb

However I also have windows installed on a dynamic disk and everytime
I boot into windows I first have to create the raid from scratch because somehow the mdadm superblock gets erased by windows any idea

Offline

#8 2013-03-31 22:33:32

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: Raid + Grub2

Have you created "/etc/mdadm.conf" file and have "mdadm_udev" hook on "/etc/mkinitcpio.conf"?

Offline

#9 2013-04-01 22:08:22

wagner-felix
Member
Registered: 2013-03-26
Posts: 11

Re: Raid + Grub2

Yes I have created them. Now there is only one issue that I have:

Every time I boot Windows 7 I have to recover the gpt partition on /dev/md0 which is my raid device (/dev/sda + /dev/sdb).

Just to clarify:

/dev/sda + /dev/sdb is raid 1 → /dev/md0
/dev/md0 has GPT → /dev/md0p1 /dev/md0p2 /dev/md0p3 (/dev/md0p1 is boot_grub, /dev/md0p2 is /)
/dev/sdc2 is normal MBR with windows 7 installed on it

Last edited by wagner-felix (2013-04-01 22:12:46)

Offline

#10 2013-04-01 23:12:42

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: Raid + Grub2

Before you installed arch, were any of those disks also used as windows dynamic volumes???

Last edited by s1ln7m4s7r (2013-04-01 23:51:24)

Offline

#11 2013-04-10 09:58:51

wagner-felix
Member
Registered: 2013-03-26
Posts: 11

Re: Raid + Grub2

Yes, however after installing arch i reinstalled windows with a normal partitioning scheme (without dynamic disks) and i also deleted the last bit on the drives that contained the dynamic disk metadata.3

Somehow windows is interacting with the gpt partition tables on the raid device, why ??

Last edited by wagner-felix (2013-04-10 09:59:36)

Offline

Board footer

Powered by FluxBB