View previous topic :: View next topic |
Author |
Message |
leonarp n00b
Joined: 22 Mar 2004 Posts: 35 Location: Kansas
|
Posted: Mon Apr 12, 2004 4:10 pm Post subject: Boot from software raid |
|
|
Has anyone been able to get Gentoo for Sparc to boot from a software raid device? If so how did you do it. I have the raid devices setup and running. That part went okay.
Philip |
|
Back to top |
|
|
spam_ Tux's lil' helper
Joined: 14 Jan 2004 Posts: 105 Location: /dev/null
|
Posted: Mon Apr 12, 2004 8:14 pm Post subject: |
|
|
Sure. Both my sparcs run on a software raid0. Not really a big deal to set up even.
This doc assumes you're starting from the beginning, since you're farther along read the previous steps carefully to make sure you didn't miss anything. I'm writing it all so you don't miss critical parts, and so others who search the forums and turn up this will have all the steps.
First: boot the install cd. modprobe md.
Run fdisk, create the partitions to be used as raid. Note that you will definitely need to use a seperate /boot for this setup, silo can't understand raid devices. Critical part: mark the raid partitions type FD (Linux raid autodetect), not the usual 83 (Linux). This allows the kernel to automatically figure out to mount the raid at boot.
Now, nano -w /etc/raidtab. Example config for a 2-disk raid0:
Code: |
raiddev /dev/md0
raid-level 0
nr-raid-disks 2
persistent-superblock 1
chunk-size 8
device /dev/sda2
raid-disk 0
device /dev/sdb2
raid-disk 1
|
Make sure to preserve the whitespace, and use single TABs not spaces. I had to use spaces above because of the forum reply box.
The "persistent-superblock 1" option is required, it adds info to the raid device that allows it to be automounted as root at boot time.
For all the raid params, go to the software-raid-howto: http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html
BTW: Don't go changing chunk-size. I found that it would not work (on sparc64, x86 doesn't seem to care) with any chunk-size other than 8K.
Now mkraid /dev/md0. If everything went well, /dev/md0 should be up and running.
Format /dev/md0 as normal (mke2fs -j /dev/md0, mkreiserfs /dev/md0, whatever fs you're going to use). Mount /dev/md0 to /mnt/gentoo. mkdir /mnt/gentoo/boot and mount /dev/<YOUR_BOOT_PARTITION> /mnt/gentoo/boot.
Follow the docs all the way to the kernel build (extract your stage tarball, mount -t proc proc /mnt/gentoo/proc, chroot, etc.)
Now, when you compile the kernel, turn on raid support and raid0 (or whatever level you plan to use - 0, 1, 5, etc) and put it directly in the kernel, not as modules. This saves the need for a messy initrd.
All the other setup is the same as in the docs, using /dev/md0 as the root disk device (in /etc/fstab).
When you boot it, a whole boatload of raid junk should come up in the kernel boot messages (on my 2-disk raid0 it's well over a page even with the 128x54 framebuffer console!). If all goes well, init should start with that nice colored Gentoo bootup process, and when you see the login prompt you can uncross your fingers. |
|
Back to top |
|
|
leonarp n00b
Joined: 22 Mar 2004 Posts: 35 Location: Kansas
|
Posted: Mon Apr 12, 2004 8:53 pm Post subject: |
|
|
Hm. I didn't know the part about 8K chunks. I built mine with 32K. Is this limitation only with the /boot partition?
Of course I'm also dealing with the infamous "Fast Data Access MMU Miss" problem when I try to boot from the disk. Booting from the CD works fine. |
|
Back to top |
|
|
spam_ Tux's lil' helper
Joined: 14 Jan 2004 Posts: 105 Location: /dev/null
|
Posted: Mon Apr 12, 2004 11:00 pm Post subject: |
|
|
leonarp wrote: | Hm. I didn't know the part about 8K chunks. I built mine with 32K. Is this limitation only with the /boot partition? |
I wasn't thinking that you had /boot as a RAID setup too. My /boot is not raid, but / is. AFAIK there is no 'simple' way to make /boot a RAID partition, because of silo.
If chunk-size was not 8 for me, mkraid would bomb out. I know that I tried 4, 16, 32, and 64 with no results.
leonarp wrote: |
Of course I'm also dealing with the infamous "Fast Data Access MMU Miss" problem when I try to boot from the disk. Booting from the CD works fine. |
Well if your /boot is raid, that certainly is a problem. Boot the livecd, copy your /boot somewhere, make a new non-raid /boot, and copy everything back then run silo -f -C /boot/silo.conf (I think).
If you're worried about corruption in /boot, the simplest way is to cp -a /boot/* to somewhere every time you change it.
I don't think it's possible to have an automatically 'fixed' /boot even if a disk dies (raid5). |
|
Back to top |
|
|
LasseKongo n00b
Joined: 01 Aug 2003 Posts: 17 Location: Sweden
|
Posted: Wed Apr 14, 2004 9:06 pm Post subject: Boot from software raid |
|
|
I have my Sparc 20 boot from software raid mirror (raid1). Looks like SILO can handle that. I don´t have a separate /boot but I can´t see why that wouldn´t work, my kernel located on the / filesystem and can be booted from the software raid.
------------------------------------------------------------------------------------
Part of my fstab:
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/md0 / ext3 noatime 1 1
/dev/md1 none swap sw 0 0
/dev/vg1/lvusr /usr ext3 noatime 1 2
/dev/vg1/lvvar /var ext3 noatime 1 3
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
/dev/fd0 /mnt/floppy auto noauto 0 0
------------------------------------------------------------------------------------- |
|
Back to top |
|
|
cryptodev n00b
Joined: 16 Apr 2004 Posts: 53
|
Posted: Fri Apr 16, 2004 5:13 pm Post subject: |
|
|
I'm trying to get my setup to boot from a RAID 1. I currently have the system installed on a spare hard drive, and I'm attempting to transfer the setup to the RAID 1 on two other disks. At first I built the kernel with the RAID as a module by mistake. When I corrected this by rebuilding the kernel with the RAID module as part of the kernel, I am no longer able to mount my raid. It appears that the md and raid modules are having trouble during bootup, but no useful messages from dmesg. Can anyone help?
Thanks. |
|
Back to top |
|
|
spam_ Tux's lil' helper
Joined: 14 Jan 2004 Posts: 105 Location: /dev/null
|
Posted: Fri Apr 16, 2004 9:12 pm Post subject: |
|
|
cryptodev wrote: | I'm trying to get my setup to boot from a RAID 1. I currently have the system installed on a spare hard drive, and I'm attempting to transfer the setup to the RAID 1 on two other disks. At first I built the kernel with the RAID as a module by mistake. When I corrected this by rebuilding the kernel with the RAID module as part of the kernel, I am no longer able to mount my raid. It appears that the md and raid modules are having trouble during bootup, but no useful messages from dmesg. Can anyone help?
Thanks. |
Did you create the raid1 array with the "persistent-superblock 1" option in /etc/raidtab, and mark the RAID partitions type FD? |
|
Back to top |
|
|
|
|
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
|
|