Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub2 on Kernel Raid1
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Mir
n00b
n00b


Joined: 01 Mar 2011
Posts: 1

PostPosted: Tue Mar 01, 2011 2:06 pm    Post subject: Grub2 on Kernel Raid1 Reply with quote

Hello,
probably my question have been already posted, but I cannot find an answer.
I already installed Gentoo several times using the official Handbook without any problem.
I'm trying now to install Gentoo on a new machine using RAID 1 (boot and root in a single partition) and RAID 0 (/home).
I'm trying to use grub2. As far as i understand the guide "Gentoo Linux x86 with Software Raid and LVM2 Quick Install Guide" does not use grub2 (and I think I do not need LVM2).
Up to know I spent several hours and collect only failures.

Reading around I found that Debian is able to boot from raid 1. So I tried to install Debian on / (/dev/md1, raid1, root and boot in the same partition) and /home on /dev/md3 (raid0): the system is running without any problem. Here is the /etc/mtab:

Code:
root@server:/# cat /etc/mtab
/dev/md1 / xfs rw 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
/dev/md3 /home xfs rw 0 0
/dev/sdc1 /home/backup xfs rw 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0

root@server:/# mdadm -D --scan
ARRAY /dev/md/1 metadata=1.2 name=livecd:1 UUID=9d00092b:628c5be0:ed118f08:aaba700d
ARRAY /dev/md/3 metadata=1.2 name=livecd:3 UUID=99f2c4b8:5c31babb:a7615231:f3e86222


However, I failed completely with Gentoo. I did:

mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

So, no --metadata=0.90, because Debian works with version 1.2

Before to chroot I did:

Code:
mount /dev/md1 /mnt/gentoo
mkdir /mn/gentoo/home
mount /dev/md3 /mnt/gentoo/home
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
cp /etc/mdadm.conf /mnt/gentoo/etc/mdadm.conf

...

emerge mdadm
echo "<sys-boot/grub-9999 **" > /etc/portage/package.keywords
emerge grub

This will install grub 1.98 which is (I suppose) able to boot from raid 1 with metadata=1.2

gub-mkconfig always complains about a missing device (md1). Than I added manually in /boot/grub/devices.map and run

grub-install --modules="raid mdraid part_msdos xfs" /dev/sda
grub-install --modules="raid mdraid part_msdos xfs" /dev/sdb

Apparently all is okay. However I cannot boot. During the last attempt grub exit with a message like "device with uuid=xxxx-xxx-xx-xxxxx-xxx not found"
Also, after a new boot from USB the raids are automatically recognised and assigned to new devices: /dev/md126 and /dev/md127 :?

I would greatly appreciate any help!

Moved here to keep the grub sticky for grub1 - also GEntoo does not yet support grub2 offcially.
Edited post, rather than replied so the topic appears in the 'unanswered posts' search
--
NeddySeagoon

Added a link to the aforementioned sticky topic. -- desultory
Back to top
View user's profile Send private message
DawgG
l33t
l33t


Joined: 17 Sep 2003
Posts: 824

PostPosted: Fri Mar 04, 2011 9:46 am    Post subject: Reply with quote

i've recently installed gentoo and grub on sw-raid-1. i've used a separate boot-partition, but i think even without that installing on raid-1 should be no problem.
the "trick" is to install grub-1 NOT onto the md-device but onto each "raw" disk-device, eg /dev/sda1 AND dev/dev/sdb1 (because in sw-raid there is no raid before the kernel has booted).
so when your system is running just install grub1 on both of the devices.
for me this worked but be sure to test it before - especially if there is any valuable data anywhere on that system. this applies ONLY to raid-1.

(also, i had some problems with raid-devices created from the running gentoo-system: the initial devices it is installed on were created with an (old?) systemrescue-cd, but the new ones created from the running system (amd_64, about 201011) had "strange" and changing names like md126, md127 on every reboot. after i created them with an older version of mdadm they worked. for this i had to pass an "old version"-option to the mdadm-command like this:
Code:
mdadm -C /dev/md7 -vv -e0.90 -l 1 --raid-devices=2 /dev/sda3 /dev/sdb3

(it's the -e0.90)
GOOD LUCK!
_________________
DUMM KLICKT GUT.
Back to top
View user's profile Send private message
kkretsch
n00b
n00b


Joined: 24 Jan 2005
Posts: 13
Location: Munich, Germany

PostPosted: Fri Mar 04, 2011 10:55 am    Post subject: Re: Grub2 on Kernel Raid1 Reply with quote

Mir wrote:
So, no --metadata=0.90, because Debian works with version 1.2

Debian has patched grub2 to support metadata 1.x, Gentoo has not. Too see for yourself, look in disk/mdraid_linux.c
Code:
  /* FIXME: Also support version 1.0. */
  if (sb.major_version != 0 || sb.minor_version != 90)
    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
                       "unsupported RAID version: %d.%d",
                       sb.major_version, sb.minor_version);

Debian squeeze’s diff contains
Code:
--- grub2-1.98+20100804.orig/debian/patches/linux_mdraid_1x.patch
+++ grub2-1.98+20100804/debian/patches/linux_mdraid_1x.patch
@@ -0,0 +1,307 @@
+Description: Support mdraid 1.x
+Author: Robert Millan <rmh@debian.org>
+Forwarded: not-needed, patch from upstream
+Last-Update: 2010-11-04
Back to top
View user's profile Send private message
Cephas
n00b
n00b


Joined: 25 Mar 2011
Posts: 10

PostPosted: Fri Mar 25, 2011 8:00 am    Post subject: Reply with quote

Does the 0.90 metadata limitation apply to the 1.99-rc1 ebuild as well?

Thanks
Back to top
View user's profile Send private message
kkretsch
n00b
n00b


Joined: 24 Jan 2005
Posts: 13
Location: Munich, Germany

PostPosted: Mon Mar 28, 2011 1:12 pm    Post subject: Reply with quote

Cephas wrote:
Does the 0.90 metadata limitation apply to the 1.99-rc1 ebuild as well?

I think 1.99-rc1 does support 1.x metadata. The source archive has a file named
Code:
grub-core/disk/mdraid1x_linux.c

that handles that. However i have only looked at the code and not tried it yet.
Back to top
View user's profile Send private message
ciaala
n00b
n00b


Joined: 28 Mar 2011
Posts: 1

PostPosted: Mon Mar 28, 2011 10:56 pm    Post subject: Reply with quote

Today i started a fresh installation with the latest iso and stage3.
I created /dev/md127 as a raid1 of 4 disks (sda1 sdb1 ...) with metadata 1.2 and formatted with ext2, also i created md126 as a raid10, ext4 with metadata 1.2 with sda3...

I have tried to install grub2=1.99rc1 grub-probe had a lot of problems to identify the filesystem / partition disk in the end i forced the path in the /boot/grub/devicemap
(md126) ... /dev/disk/by-id/md-uuid/.....
(md126) ... /dev/disk/by-id/md-uuid/.....
I installed grub-1.99 on every raw disk in this way
Code:
for i in sda sdb sdc sdd; do grub-install --modules="raid mdraid1x ext2 part_msdos" --no-floppy /dev/$i; done


At boot grub2 just shows the rescue prompt and is unable to recognize the filesystem in the any partitions.
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 961
Location: halmstad

PostPosted: Thu Mar 31, 2011 9:03 pm    Post subject: Reply with quote

ciaala wrote:

At boot grub2 just shows the rescue prompt and is unable to recognize the filesystem in the any partitions.

try another filesystem and about grub2.isnt it like grub,like when type grub,you will come to
a setup menu and make,like this ?

root (hd 0,0)
setup (hd 0)


and so on?
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sat Apr 02, 2011 9:58 pm    Post subject: Reply with quote

Grub2 supports 0.9 metadata and 1.x metadata just fine.

It is the kernel that requires 0.9 metadata if you want to boot without using an initrd/initramfs.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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