[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RAID1 root on nslu2



Hi Toon

On 3 Apr 2007 10:17:06 -0700, Toon <Toon.Verstraelen@gmail.com> wrote:

no problem, but I have some difficulties to boot into the RAID 1 root
partition. To clarify the picture, here is some basic info about my
configuration as it is now:

The problem is that the root partition on a USB disk takes some time
to be registered with the kernel through udev, so when mdadm is run in
the initramfs scripts, the USB disk is not ready, and mdadm does not
find the RAID devices. This problem is known [1] and a workaround has
been created by David Härdeman for etch. The workaround involves
setting the rootdelay parameter on the kernel command line to a value
like 10 seconds, which gives the USB disk enough time to be registered
with the kernel.

Unfortunately, setting the kernel command line is tricky on the NSLU2
with Debian right now. The command line is set by APEX, the second
stage boot loader that Debian/NSLU2 uses, and the version of APEX in
Debian supports apex-env which allows one to change the kernel command
line. However, the copy of APEX in the mtdblock2 partition of the
NSLU2 flash is padded with zeros, not 0xffs, which makes apex-env
unhappy. Therefore, to change the command line, the copy of APEX in
the flash needs to be overwritten with a version that is padded with
0xffs.

You can try to regenerate a copy of /dev/mtdblock2 yourself and then
edit the APEX configuration environment using apex-env, but to make
things easier for you, I have uploaded a copy of my 0xff padded apex
partition to the nslu2-linux group. It contains the following
configuration in the apex environment:

$ sudo apex-env printenv
bootaddr *= 0x00008000
cmdline = console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug rootdelay=10
cmdline-alt *= console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug
fis-drv *= nor:0x7e0000+4k
kernelsrc *= fis://kernel
kernelsrc-alt *= fis://kernel
ramdiskaddr *= 0x01000000
ramdisksrc *= fis://ramdisk
ramdisksrc-alt *= fis://ramdisk
startup *= copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc
$ramdiskaddr; wait 10 Type ^C key to cancel autoboot.; boot

The APEX configuration in this file has the rootdelay parameter set to
10 seconds which should be enough time for your USB disk to be
registered. If you use this file, you'll be able to use apex-env to
set the rootdelay parameter to anything you want (see below).

To get this file, login to Yahoo Groups, select the nslu2-linux group,
and click on the "Files" link in the panel on the left-hand side of
the page. The file is called etch-modified-mtdblock2.bin.

Then, to use this file, copy it to your NSLU2, and then do

$ su -c 'cat mtdblock2.bin > /dev/mtdblock2'

Check that your APEX configuration matches the one listed above by doing

$ sudo apex-env printenv

If it does, change your fstab to use /dev/md0 as your root device, and run

$ sudo update-initramfs

Reboot. I have not explicitly tested each of these steps with a root
on RAID system, but it should work.

Once you have overwritten the mtd2 partition, you can change the
command line stored in the APEX configuration environment by by doing

$ sudo apex-env setenv 'console=ttyS0,115200 rtc-x1205.probe=0,0x6f
noirqdebug rootdelay=5'

See 'apex-env --help' or 'man apex-env' for more information.

Gordon

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=401916

--
Gordon Farquharson



Reply to: