Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
"Hardware" RAID1 - Grub
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
selberbauer
Apprentice
Apprentice


Joined: 20 Dec 2010
Posts: 276

PostPosted: Fri Apr 08, 2011 4:11 pm    Post subject: "Hardware" RAID1 - Grub Reply with quote

Hi,
i got a Asus P8H67-M Pro which provides a RAID1 Volume over the Chipset (so it isnt really Hardware RAID...).
I have installed the base System and i cann chroot and everything is fine, data is on both disks.
The only problem which is now left is the bootloader.
When i use "grub-install --no-floppy /dev/md126"
I am getting: "/dev/md126 does not have a corresponding BIOS drive"

Code:


livecd ~ # fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x37b4f513

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           5       40131   83  Linux
/dev/sda2               6         267     2104515   82  Linux swap / Solaris
/dev/sda3             268      243201  1951367355   83  Linux

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x37b4f513

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1           5       40131   83  Linux
/dev/sdb2               6         267     2104515   82  Linux swap / Solaris
/dev/sdb3             268      243201  1951367355   83  Linux

Disk /dev/sdc: 4009 MB, 4009754624 bytes
124 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7688 * 512 = 3936256 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b57dd

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        1018     3913161    b  W95 FAT32

Disk /dev/md126: 2000.4 GB, 2000395698176 bytes
255 heads, 63 sectors/track, 243200 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x37b4f513

      Device Boot      Start         End      Blocks   Id  System
/dev/md126p1   *           1           5       40131   83  Linux
/dev/md126p2               6         267     2104515   82  Linux swap / Solaris
/dev/md126p3             268      243201  1951367355   83  Linux


I also tried to install the MBR via grub-prompt
Code:


grub> root (hd0,0)
root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  18 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+18 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... failed

Error 22: No such partition
grub>


How do can I now install the MBR on my RAID?
regards
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Fri Apr 08, 2011 4:57 pm    Post subject: Reply with quote

I'm not sure if it will help or not, but I'd suggest booting grub from a CDROM or similar (be careful because USB HD can change the hard drive ordering sometimes) to see how grub actually sees the hard drives at boot time. You can actually run the install command from grub at boot time too - grub in the console is 99% the same as at boot as far as capabilities, but you just can't boot an OS at the console.

Then you can use commands like...

root (hd<tab>

<tab>=tab key

and grub will list possible hard drives it sees, etc.

I have a feeling what is happening is grub in linux might be trying to install only to one hard drive's MBR, and isn't aware that (hd0) is actually your raid volume. But somehow it notices something isn't quite right? It's not clear to me why it should actually fail in that situation rather than just doing it wrong.
Back to top
View user's profile Send private message
selberbauer
Apprentice
Apprentice


Joined: 20 Dec 2010
Posts: 276

PostPosted: Fri Apr 08, 2011 6:03 pm    Post subject: Reply with quote

i dont have a working grub sys near me at the moment :(
so i cant try this with the tab.

Does Grub normaly doesnt complain about RAIDs?

regards

I tried everything threw root (hd0,0) (sda, first raid disk) root (hd1,0) (sdb, second raid disk), root (hd2,0) (sdc, gentoo liveusb)
Seems that Grub doesnt find the RAID Volume when it searches threw the BIOS


Last edited by selberbauer on Fri Apr 08, 2011 6:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Fri Apr 08, 2011 6:15 pm    Post subject: Reply with quote

Well, another thing...

Grub might be using (hd3) for your raid device in the command line version, placing the raid device after the 3 hard drives. You could try installing to (hd3) and see if that helps, but I wonder then if grub would get confused at boot time.

Check this out though: http://www.gnu.org/software/grub/manual/html_node/Device-map.html

I think a file like this might be needed to make the mapping correct.

The only line it should need should be:

(hd0) /dev/md126
Back to top
View user's profile Send private message
selberbauer
Apprentice
Apprentice


Joined: 20 Dec 2010
Posts: 276

PostPosted: Fri Apr 08, 2011 6:28 pm    Post subject: Reply with quote

So i think this could be it.
Code:
root (hd0,0) /dev/md126p1
works.
It finds an ext2fs disk (even if it could still be that this is sda?)
but when i want to try "setup (hd0) /dev/md126" i gt "unrecognized device string"

could grub2 be a help out?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Apr 08, 2011 7:24 pm    Post subject: Reply with quote

http://www.gentoo-wiki.info/HOWTO_Install_Gentoo_with_NVRAID_using_dmraid#Installing_GRUB

old but still should explain your problem and solve for it.

ps: note they map the drive but also the partition in it
ps2: note they only map to /dev/mapper and not /dev/ you better stop using /dev/md126 ref and use the /dev/mapper/yourdisk mapping
ps3: note the credits at end, hmmm, interesting name on it -> NeddySeagoon, i wonder who's that guy, but pretty sure he could help :P
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Fri Apr 08, 2011 7:44 pm    Post subject: Reply with quote

To clarify, you don't do the mapping as you type in the device name in the grub shell, it has to be placed in a special file (check the link I gave).

But, I think you can do it with extra commands in the grub shell instead - check the wiki link krinn gave.
Back to top
View user's profile Send private message
selberbauer
Apprentice
Apprentice


Joined: 20 Dec 2010
Posts: 276

PostPosted: Fri Apr 08, 2011 9:41 pm    Post subject: Reply with quote

Code:

#grub --device-map=/dev/null
grub> device (hd0,0) /dev/md126p1
grub> device (hd0) /dev/md126
grub> root (hd0,0)
Filesystem is ext2fs, partition type 0x83
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 18 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+18 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"...failed
Error 22: No such partition
grub> quit


How am can i map my RAID couldnt really read something about this in the wikis :(
regards
Back to top
View user's profile Send private message
selberbauer
Apprentice
Apprentice


Joined: 20 Dec 2010
Posts: 276

PostPosted: Fri Apr 08, 2011 9:53 pm    Post subject: Reply with quote

Hmm i tried now to boot over the commandline
it didnt find any modules (i think it didnt found md126p3 or so) but it bootet till the command-prompt
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Fri Apr 08, 2011 9:55 pm    Post subject: Reply with quote

I'm at a loss as to what's going on here - what you typed in should have worked.

I don't know what else to recommend besides making a bootable grub cdrom (or floppy if you have such old things) and trying that.

You can make a grub disc yourself (I've done it), but there's some tricks to it. I'd suggest grabbing this and burning it (on another machine if necessary).

http://linux.softpedia.com/progDownload/Super-Grub-Disk-Download-8071.html

Then try doing an installation by pressing c after it loads (you shouldn't have to map devices then either).
Back to top
View user's profile Send private message
selberbauer
Apprentice
Apprentice


Joined: 20 Dec 2010
Posts: 276

PostPosted: Fri Apr 08, 2011 10:04 pm    Post subject: Reply with quote

hmm i will search after a new cd tomorrow.
if theres no help i will try reinstalling with an software raid1

but thanks for your long endurance ;)

good night and regards
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Apr 08, 2011 10:10 pm    Post subject: Reply with quote

selberbauer wrote:
Code:

#grub --device-map=/dev/null
grub> device (hd0,0) /dev/md126p1
grub> device (hd0) /dev/md126


How am can i map my RAID couldnt really read something about this in the wikis :(


like that,
first line tell grub to not create the map from your drive
second & 3rd tell grub to map (hd0,0) -> /dev/md126p1 & /dev/md126
So you were doing it

and my 2nd ps was to take care not to map (i don't know if it's important, but this is kind of thing i take great care) your drive to /dev/md126 but to /dev/mapper/theraididgavebyyourfakeraid
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Fri Apr 08, 2011 10:13 pm    Post subject: Reply with quote

Which device name he uses shouldn't matter - in the end it just boils down to what major&minor device number (which is the same from any device node for it). It's not like grub records the unix device name into the boot sector or anything like that (it has no use for it at boot time).
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Apr 08, 2011 10:19 pm    Post subject: Reply with quote

should really go for soft raid, that's what the fakeraid will do at end, but removing the bullshit fakeraid bios does.
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Sat Apr 09, 2011 12:19 am    Post subject: Reply with quote

Agreed, at least then you know your system will still boot when you move it onto another motherboard. Boot can be manually cloned onto separate partitions on each drive (whether raid-1 or 5 or whatever) and grub won't know or care that it's a raid then :)
Back to top
View user's profile Send private message
selberbauer
Apprentice
Apprentice


Joined: 20 Dec 2010
Posts: 276

PostPosted: Sat Apr 09, 2011 7:36 am    Post subject: Reply with quote

Ok then i will do ; )
Should be the last time i used the fakeraid (had very slow ransfer rates as i tried it for years with windows...)

Is it recommend to use the software RAID for the whole disk or only for /home or /?



I wanted to use the pc as samba server which saves the data via RAID1 to prevent a disk crash and a backup script which is daily copying a tar to another disk to prevent deleteaccidents
I have two 2TB WD caviar green and one 1TB caviar green.
I wanted to use the 2TB disks for RAID and the 1TB for daily copies - but i am still not very happy with this configuration. Is there a better way to configure the system?

So maybe 2TB RAID mountet in /home and the system on an other disk or something like that.. i know its a little complicated written now :)

regards
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Sat Apr 09, 2011 4:40 pm    Post subject: Reply with quote

It is possible to do an arrangement of raid-5 over 1TB of each disk, and raid-1 over the remaining 1TB of the 2TB disks.

like this...

1TB |---home-raid5---|
2TB |---home-raid5---|---root-raid1----|
2TB |---home-raid5---|---root-raid1----|

This way, you end up with a 1TB raid-1 that's good for /root and high access rates (since data is duplicated so each disk can serve read requests independently)

And... you have a 2TB (effectively) raid-5 that's better for mass storage and throughput (two simultaneous accesses might not be serviceable at the same time though if they need the same disk, but this improves throughput because data can be written or read in parallel for 2x speed benefit over the slowest disk)

Of course the best thing is any disk can fail and the system will keep running (and not lose any backups/etc), which you wouldn't have had with your original arrangement, but you still get 3TB of usable space.

Also, note that I described the raid-5 as home, but perhaps you'd rather have it a separate /data mount point and reserve it for holding larger size files (media, backups, etc). The choice is up to you which way works easier and what you use the system for.

If you really want to go all-out, you can use LVM on top of the raids and combine the total 3GB into any combination of partitions - one big one, individual ones split up for separate /var and /home and such, or whatever (and be able to resize them freely after the fact).

Final tip - since the system can run with any 2 of the 3 drives, leave a 2TB disk out of the picture as you create your raid layout using only 2 of the 3 disks, then you can migrate data in from your original 2TB disk (as long as the data fits on it). The trick to creating a raid with a disk not in place with the mdadm utility, is using the keyword "missing" instead of the device name.
Back to top
View user's profile Send private message
selberbauer
Apprentice
Apprentice


Joined: 20 Dec 2010
Posts: 276

PostPosted: Sat Apr 09, 2011 7:45 pm    Post subject: Reply with quote

Hmm i will remember it me till next time - was reading it too late because of the timeshift :(
I have now already a working config ...
I tried first putting on an software RAID1 with mdadm with the two 2TB as boot,swap & root partition boot grub failed again. didnt found stage1 and so on..
then i had enough from raid1 with the boot device.

now i am having the 1TB as root, boot & swap and a raid1 out of the 2 x 2TB as /home.
in retrospect its a little stupid to use a 1TB as system drive .. but so i am making practise experience ;)

the RAID1 is now contening the data and a daily tar archive with max. 30 instances (so i can go max. 30 days back to rescue a deleten file) additional the 1TB is providing weekly save of data.

well now when the real cause is succesfully avoided i would say now comes the time to prob you.
so thanks allot for youre help and ideas.

regards
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Sat Apr 09, 2011 8:24 pm    Post subject: Reply with quote

No problem, at least you found something that works!
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