Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] installing with raid1, grub not finding stage1
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
dwhoman
n00b
n00b


Joined: 11 Dec 2009
Posts: 13

PostPosted: Sun Jan 23, 2011 9:35 am    Post subject: [SOLVED] installing with raid1, grub not finding stage1 Reply with quote

I am having trouble installing Gentoo on a new system. This is my fifth Gentoo box, but my first one using raid. I have two sata hdd, both 2 TB. I followed the guide at http://en.gentoo-wiki.com/wiki/RAID/Software for setting up raid. All the partitions are raid1 and <2TB. The file-system type id for sda1-4 and sdb1-4 are fd. The md file system types are ext2 for md1, swap for md2, and ext4 for md3 and md4. The two hard drives have finished syncing. I do have a symbolic link in boot called boot which points to . and the sym link menu.lst in /boot/grub/ which points to grub.conf. The bios does not have raid enabled. So I am at the part in the guide where I am supposed to install grub on both disks, but when I go into grub and type
Code:
find /boot/grub/stage1
, I get error 15: file not found. Additionally, when I continue and enter
Code:
device (hd0) /dev/sda
then
Code:
root (hd0,0)
I get "Filesystem type is ext2fs, partition type 0xfd". However, when I type
Code:
setup (hd0)
I get "
  • Checking if "/boot/grub/stage1" exists... no
  • Checking if "/grub/stage1" exists... no
  • Error 2: Bad file or directory type
I then tried
Code:
device (hd0) /dev/sdb
then
Code:
root (hd0,0)
I get "Filesystem type unknown, partition type 0xfd". I'm not sure why it doesn't know sdb's fs type since I did
Code:
sfdisk -d /dev/sda | sfdisk /dev/sdb
just as the guide showed and fdisk -l shows that both sda and sdb have the same setup.

Device Boot Start End ... Id System
/dev/sda1 * 1 3 ... fd Linux raid autodetect
/dev/sda2 4 2093 ... fd Linux raid autodetect
/dev/sda3 2094 15148 ... fd Linux raid autodetect
/dev/sda4 15149 243201 ... fd Linux raid autodetect

mdadm --detail [device] shows clean, persistent, active, and working devices, each having two partitions (one of the four sda and sdb partitons) which are in an active sync state for all of the devices. Also, after I rebooted to check my bios, when I got back to the live cd environment 'fdisk -l' showed the raid partitions as md124, md126, md127, and md125 instead of md1, md2, md3, and md4 respectively. I'm not sure how to change this back if it can or what fstab should be; md1..4 or md124..127. I also setup my grub.conf file as shown in the guide. Another difference is that I compiled grub using the regular gcc and not the vanilla gcc, which I couldn't figure out how to get it anyway (I tried recompiling grub with the vanilla flag but still didn't get multiple profiles and the one profile was still the same as before). I also did not use the '-e 0.90' when creating the superblocks and instead used mdadm's default.


Last edited by dwhoman on Wed Jan 26, 2011 8:21 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Jan 23, 2011 3:53 pm    Post subject: Reply with quote

dwhoman,

Try
Code:
mdadm -E /dev/sda1
and look at the first few lines of output
Code:
/dev/sda1:
          Magic : a92b4efc
        Version : 0.90.00
Version is important. If its not 0.9, grub won't work from that partition. Also, raid auto assemble is only supported on version 0.9 raid superblocks.

raid superblock 0.9 is no longer the default. A change means destroying all the data on the raid volume that the partition belongs to.
Thats not too bad for /boot but isn't good for anything else.

raid sets with superblock version > 0.9 must be assembled by calling mdadm, which for root on raid, means an initrd is required.
_________________
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
Simba7
l33t
l33t


Joined: 22 Jan 2007
Posts: 702
Location: Billings, MT, USA

PostPosted: Sun Jan 23, 2011 5:20 pm    Post subject: Reply with quote

NeddySeagoon wrote:
dwhoman,raid superblock 0.9 is no longer the default. A change means destroying all the data on the raid volume that the partition belongs to.
Thats not too bad for /boot but isn't good for anything else.

raid sets with superblock version > 0.9 must be assembled by calling mdadm, which for root on raid, means an initrd is required.

Is there issues with using 0.9 on all your MD volumes or just a performance hit? I'm rebuilding my Asus TS Mini and was booting from the 256MB internal flash and automounting the 2 HDDs as a RAID0 (md1 as swap, md2 as root).

I would like to know so I don't end up wiping out both systems (the other's a PE2550 with 4x640GB Drives as a SoftRAID5) due to a crash or major performance issues.
_________________
Router(Nokia IP390,2GB RAM,160GB HDD,8xGigE ports,pfSense) | MyDT(Xeon X3470@3.4GHz,32GB RAM,6x2TB R5,GTX560Ti,2xLG BD-RE,Win10Pro)
MyLT(Asus G53SX,32GB RAM,2x2TB HDDs,BD-RE,Intel 6230,Win10Pro) | Wife(PnmIIX3@3.3GHz,8GB RAM,1TB HDD,DVDRW,Win10Pro)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Jan 23, 2011 5:41 pm    Post subject: Reply with quote

Simba7,

I not aware of any performance changes with raid superblock versions. the problem with grub comes from disk layout changes. i.e. the superblock information is moved around.
_________________
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
dwhoman
n00b
n00b


Joined: 11 Dec 2009
Posts: 13

PostPosted: Sun Jan 23, 2011 10:45 pm    Post subject: Reply with quote

The superblock version was 1.2, I recreated it as 0.9 after imaging the boot partition, and then I restored the partition. I was able to install grub; however, the raid device names are different every time I reboot; they are always md124 to md127 but the partitions they represent change, sometimes sd[ab]3 is represented by mb125 and other times by md126. I had to rename the kernel in the boot partition from kernel-2.6.36-gentoo-r5 to bzImage, bzImage-1 and bzImage.1; grub could not find the image with the kernel-2.6.36-gentoo-r5 name. I'm not sure why grub can't find it; I've checked and rechecked that the names in grub.conf and boot match. When I boot I get a kernel panic
  • NET: Registered protocol family 17
  • Registering the dns_resolver key type
  • md: Waiting for all devices to be available before autodetect
  • md: If you don't use raid, use raid=noautodetect
  • md: Autodetecting RAID arrays
  • md: Scanned 0 and added 0 devices.
  • md: autorun ...
  • md: ... autorun DONE.
  • md: Unknown device name: sda3
  • Root-NFS:No NFS server available, giving up.
  • VFS: Unable to mount root fs via NFS, trying floppy.
  • VFS: Cannot open root device "md125" or unknown-block(2,0)
  • Please append a correct "root=" boot option; here are the available partitions:
  • Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
  • Pid: 1, comm: swapper Not tainted 2.6.36-gentoo-r5-libre #1
  • Call Trace:
    • [<ffffffff814ea52f>] ? panic+0x92/0x19b
    • [<ffffffff814ea678>] ? printk+0x40/0x45
    • [<ffffffff814e41cf>] ? mount_block_root+0x15c/0x213
    • [<ffffffff818a44d8>] ? prepare_namespace+0x168/0x192
    • [<ffffffff818a379e>] ? kernel_init+0x1b5/0x1c1
    • [<ffffffff8100a324>] ? kernel_thread_helper+0x4/0x10
    • [<ffffffff818a35e9>] ? kernel_init+0x0/0x1c1
    • [<ffffffff8100a320>] ? kernel_thread_helper+0x0/0x10
I compiled, into the kernel, support for scsi and raid, including VIA SATA, VIA PATA, and ATI PATA. I have an ATI SB700/SB800 SATA IDE host controller and a VIA Tech. VT6415 PATA IDE host controller. I didn't see any options for ATI SATA. I setup grub.conf exactly as shown in the guide,
Code:
root (hd0,0)
kernel /boot/bzImage root=/dev/md3 md=3,/dev/sda3,/dev/sdb3
and I have tried various substitutions for the 3 in md3 and md=3 (124, 125, 126, 127) with the same results.

It also struck me as odd that mdadm said that some boot loaders do not support the 1.x superblock, and that the example in the guide does not specify 0.9 and only has a side note instead of a warning, which begs the question, "Are there any boot loaders that support 1.x?".
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Jan 24, 2011 8:22 pm    Post subject: Reply with quote

dwhoman,

Code:
# md: Autodetecting RAID arrays
# md: Scanned 0 and added 0 devices.
# md: autorun ...
# md: ... autorun DONE.
Your raid arrays are not auto detected, so root=/dev/md... fails as md... does not exist.
I'm surprised that your /boot raid is not mentioned there.
Do you have Raid Autodetect set in the kernel?

You have fixed your grub problem - it loads the kernel. To get further, you need root to use version 0.9 superblocks or you need an initrd to contain mdadm to start your root raid.
_________________
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
Simba7
l33t
l33t


Joined: 22 Jan 2007
Posts: 702
Location: Billings, MT, USA

PostPosted: Tue Jan 25, 2011 8:28 am    Post subject: Reply with quote

Did you set the partition types to "fd" or "fd00"?
_________________
Router(Nokia IP390,2GB RAM,160GB HDD,8xGigE ports,pfSense) | MyDT(Xeon X3470@3.4GHz,32GB RAM,6x2TB R5,GTX560Ti,2xLG BD-RE,Win10Pro)
MyLT(Asus G53SX,32GB RAM,2x2TB HDDs,BD-RE,Intel 6230,Win10Pro) | Wife(PnmIIX3@3.3GHz,8GB RAM,1TB HDD,DVDRW,Win10Pro)
Back to top
View user's profile Send private message
dwhoman
n00b
n00b


Joined: 11 Dec 2009
Posts: 13

PostPosted: Wed Jan 26, 2011 8:21 am    Post subject: Reply with quote

I was able to figure it out. I made all the super-blocks version 0.90 and it turns out I had made AHCI SATA Support a module, so I compiled it into the kernel.
I also found that the names of the raid file systems were static on the hardware, although the live CD kept renaming them for the session upon reboot. Kind of reminds me of my first Gentoo install when the CD was calling my hard drive sda but the system was naming it hda. It's curious, whenever I boot there is a device called md0 and mdadm says it's an inactive device, then the device disappears. The swap also appears to have two super-blocks md2 and md2p1 both with identical mdadm --detail outputs, yet scan only lists one. I think my swap is getting mirrored; I only have one swap entry in fstab.
Code:
/dev/md2   none    swap    sw    0 0
From what I read, having swap store different information on either disk could cause the system to crash if one of the disks fail. I am also curious why some Gentoo raid tutorials http://www.gentoo.org/doc/en/gentoo-x86-tipsntricks.xml#software-raid tell you to do mknod /dev/md3 b 9 3 which creates a new dev entry but the one I referenced first did not. It appears that mdadm creates the special file correctly. I don't think this is a problem, but when I shutdown, I get a non-fatal error message that the raid array that my root is on fails to stop. This appears to be an instance of bug 119380 on Gentoo Bugzilla which is open. From what I read, it's harmless.

Thanks for all the help.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Jan 26, 2011 7:31 pm    Post subject: Reply with quote

dwhoman,

Raid volumes are known as /dev/mdX, where X is 0..255.
They can also be partitioned like a hard drive, then you get things like /dev/md2p1 thats the first partition on md2.

If you allow the kernel to manage multiple swaps, it does something like raid0. IF an an use swap fails, the applications that have data there will have a lobotomy, and will fail when the kernel tries to read the swap on their behalf. To keep everything going, you need to use a raid as swap (not raid0)
_________________
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
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