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

Re: booting from software-RAID1 with debian on nslu2



Hi,

I've created a temporary fix that works in my case. I have make a copy
of one of the scripts in the initramfs:

cp /usr/share/initramfs-tools/scripts/local /etc/initramfs-tools/
scripts

and I have added one line to the copy, resulting in the following
file:


----------------------------
# Local filesystem mounting                     -*- shell-script -*-

# Parameter: device node to check
# Echos fstype to stdout
# Return value: indicates if an fs could be recognized
get_fstype ()
{
        local FS FSTYPE FSSIZE RET
        FS="${1}"

        # vol_id has a more complete list of file systems
        if [ -x /lib/udev/vol_id ]; then
                FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null)
        else
                eval $(fstype < "${FS}" 2> /dev/null)
        fi
        RET=$?

        if [ -z "${FSTYPE}" ]; then
                FSTYPE="unknown"
        fi

        echo "${FSTYPE}"
        return ${RET}
}

# Parameter: Where to mount the filesystem
mountroot ()
{
        [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-
top"
        run_scripts /scripts/local-top
        [ "$quiet" != "y" ] && log_end_msg

        # If the root device hasn't shown up yet, give it a little
while
        # to deal with removable devices
        if [ ! -e "${ROOT}" ] || ! $(get_fstype "${ROOT}" >/dev/null);
then
                log_begin_msg "Waiting for root file system..."

                # Default delay is 180s
                if [ -z "${ROOTDELAY}" ]; then
                        slumber=180
                else
                        slumber=${ROOTDELAY}
                fi
                if [ -x /sbin/usplash_write ]; then
                        /sbin/usplash_write "TIMEOUT ${slumber}" ||
true
                fi

                slumber=$(( ${slumber} * 10 ))
                while [ ! -e "${ROOT}" ] \
                || ! $(get_fstype "${ROOT}" >/dev/null); do
                        /bin/sleep 0.1
                        /sbin/mdadm --assemble --run --auto=yes /dev/
md1 # ADDED THIS LINE, TEMPORARY FIX
                        slumber=$(( ${slumber} - 1 ))
                        [ ${slumber} -gt 0 ] || break
                done

                if [ ${slumber} -gt 0 ]; then
                        log_end_msg 0
                else
                        log_end_msg 1 || true
                fi
                if [ -x /sbin/usplash_write ]; then
                        /sbin/usplash_write "TIMEOUT 15" || true
                fi
        fi

        # We've given up, but we'll let the user fix matters if they
can
        while [ ! -e "${ROOT}" ]; do
                echo "ALERT!  ${ROOT} does not exist.  Dropping to a
shell!"
                echo "  Check your root= boot argument (cat /proc/
cmdline)"
                panic " Check for missing modules (cat /proc/modules),
or device files (ls /dev)"
        done

        # Get the root filesystem type if not set
        if [ -z "${ROOTFSTYPE}" ]; then
                FSTYPE=$(get_fstype "${ROOT}")
        else
                FSTYPE=${ROOTFSTYPE}
        fi

        [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-
premount"
        run_scripts /scripts/local-premount
        [ "$quiet" != "y" ] && log_end_msg

        if [ ${readonly} = y ]; then
                roflag=-r
        else
                roflag=-w
        fi

        # FIXME This has no error checking
        modprobe ${FSTYPE}

        # FIXME This has no error checking
        # Mount root
        mount ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt}

        [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-
bottom"
        run_scripts /scripts/local-bottom
        [ "$quiet" != "y" ] && log_end_msg
}
--------------------

The original file is part of version initramfs-tools-0.88. The added
line makes sure that /dev/md1 is assembled when usb disks become
available. This is the output of the boot process at the serial
console:

+Ethernet eth0: MAC address 00:18:39:30:0d:7d
IP: 192.168.0.1/255.255.255.0, Gateway: 192.168.0.1
Default server: 0.0.0.0, DNS server IP: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Red Hat certified release, version 1.92 - built 15:16:07, Feb  3 2004

Platform: IXDP425 Development Platform (XScale)
Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

RAM: 0x00000000-0x02000000, 0x000723a0-0x01ff3000 available
FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each.
== Executing boot script in 2.000 seconds - enter ^C to abort
RedBoot> boot;exec 0x01d00000
have eRcOmM
push button
Entry to download
download: GET_VERSION_INFO
download: DOWN_REQUEST normal
... Erase from
0x50060000-0x50800000: .............................................................
download: DOWN_RESET
... Resetting.+Ethernet eth0: MAC address 00:18:39:30:0d:7d
IP: 192.168.0.1/255.255.255.0, Gateway: 192.168.0.1
Default server: 0.0.0.0, DNS server IP: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Red Hat certified release, version 1.92 - built 15:16:07, Feb  3 2004

Platform: IXDP425 Development Platform (XScale)
Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

RAM: 0x00000000-0x02000000, 0x000723a0-0x01ff3000 available
FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each.
== Executing boot script in 2.000 seconds - enter ^C to abort
RedBoot> boot;exec 0x01d00000
have eRcOmM
copy kernel code from flash to RAM
copy ramdisk file from flash to RAM
run kernel
Using base address 0x01d00000 and length 0x0001ffe0


APEX Boot Loader 1.4.15 -- Copyright (c) 2004,2005,2006,2007 Marc
Singer

APEX comes with ABSOLUTELY NO WARRANTY.  It is free software and you
are welcome to redistribute it under certain circumstances.
For details, refer to the file COPYING in the program source.

  apex => mem:0x00200000+0xa78c   (42892 bytes)
  env  => nor:0x7c000+15k         (no-write)

Use the command 'help help' to get started.

# copy -s $kernelsrc $bootaddr
# copy -s fis://kernel 0x00008000
1441760 bytes transferred
# copy -s $ramdisksrc $ramdiskaddr
# copy -s fis://ramdisk 0x01000000
6291440 bytes transferred
# wait 10 Type ^C key to cancel autoboot.
Type ^C key to cancel autoboot.
# boot
ATAG_HEADER
ATAG_MEM: start 0x00000000  size 0x02000000
ATAG_CMDLINE: (55 bytes) 'console=ttyS0,115200 rtc-x1205.probe=0,0x6f
noirqdebug'
ATAG_INITRD2: start 0x01000000  size 0x00400000
ATAG_END
Booting kernel at 0x00008000...
Uncompressing
Linux...............................................................................
done, booting the kernel.
Linux version 2.6.18-4-ixp4xx (Debian 2.6.18.dfsg.1-12etch2)
(dannf@debian.org) (gcc version 4.1.2 20061115 (prerelease) (Debian
4.1.1-21)) #1 Sun Apr 22 087
CPU: XScale-IXP42x Family [690541f1] revision 1 (ARMv5TE), cr=0000397f
Machine: Linksys NSLU2
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT undefined 5 cache
CPU0: I cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
CPU0: D cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
Built 1 zonelists.  Total pages: 8192
Kernel command line: console=ttyS0,115200 rtc-x1205.probe=0,0x6f
noirqdebug
IRQ lockup detection disabled
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 25780KB available (1948K code, 496K data, 92K init)
Security Framework v1.0.0 initialized
SELinux:  Disabled at boot.
Capability LSM initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
checking if image is initramfs... it is
Freeing initrd memory: 4096K
NET: Registered protocol family 16
IXP4xx: Using 16MiB expansion bus window size
PCI: IXP4xx is host
PCI: IXP4xx Using direct access for memory space
PCI: bus0: Fast back to back transfers disabled
dmabounce: registered device 0000:00:01.0 on pci bus
dmabounce: registered device 0000:00:01.1 on pci bus
dmabounce: registered device 0000:00:01.2 on pci bus
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
NetWinder Floating Point Emulator V0.97 (double precision)
audit: initializing netlink socket (disabled)
audit(4.380:1): initialized
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
IXP4xx Watchdog Timer: heartbeat 60 sec
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing
disabled
serial8250.0: ttyS0 at MMIO 0xc8000000 (irq = 15) is a XScale
serial8250.0: ttyS1 at MMIO 0xc8001000 (irq = 13) is a XScale
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
IXP4XX-Flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Searching for RedBoot partition table in IXP4XX-Flash.0 at offset
0x7e0000
6 RedBoot partitions found on MTD device IXP4XX-Flash.0
Creating 6 MTD partitions on "IXP4XX-Flash.0":
0x00000000-0x00040000 : "RedBoot"
NSLU2 MAC: 00:18:39:30:0d:7d
0x00040000-0x00060000 : "SysConf"
0x00060000-0x00080000 : "Loader"
0x00080000-0x001e0000 : "Kernel"
0x001e0000-0x007e0000 : "Ramdisk"
0x007e0000-0x00800000 : "FIS directory"
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
x1205 0-006f: chip found, driver version 1.0.7
x1205 0-006f: rtc core: registered x1205 as rtc0
Registered led device: ready
Registered led device: status
Registered led device: disk-1
Registered led device: disk-2
NET: Registered protocol family 26
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Time: OSTS clocksource has been installed.
x1205 0-006f: setting the system clock to 2007-06-17 07:59:34
(1182067174)
Freeing init memory: 92K
Loading, please wait...
Begin: Loading essential drivers... ...
md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: bitmap version 4.39
md: raid1 personality registered for level 1
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
Done.
Begin: Running /scripts/init-premount ...
PCI: enabling device 0000:00:01.0 (0140 -> 0142)
ohci_hcd 0000:00:01.0: OHCI Host Controller
ohci_hcd 0000:00:01.0: new USB bus registered, assigned bus number 1
ohci_hcd 0000:00:01.0: irq 28, io mem 0x48000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
PCI: enabling device 0000:00:01.1 (0140 -> 0142)
ohci_hcd 0000:00:01.1: OHCI Host Controller
ohci_hcd 0000:00:01.1: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:01.1: irq 27, io mem 0x48001000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
PCI: enabling device 0000:00:01.2 (0140 -> 0142)
ehci_hcd 0000:00:01.2: EHCI Host Controller
ehci_hcd 0000:00:01.2: new USB bus registered, assigned bus number 3
usb 1-1: new full speed USB device using ohci_hcd and address 2
ehci_hcd 0000:00:01.2: irq 26, io mem 0x48002000
ehci_hcd 0000:00:01.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 5 ports detected
Done.
Begin: Mounting root file system... ...
usb 3-1: new high speed USB device using ehci_hcd and address 2
Toony was here
Begin: Running /scripts/local-top ...
usb 3-1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usb 3-2: new high speed USB device using ehci_hcd and address 3
usb 3-2: configuration #1 chosen from 1 choice
scsi1 : SCSI emulation for USB Mass Storage devices
Loading Intel IXP400 ethernet driver
Failed to load Intel IXP400 ethernet driver
Begin: Loading MD modules ...
Success: loaded module raid1.
Done.
Begin: Assembling MD array /dev/md1 ...
md: md1 stopped.
mdadm: no devices found for /dev/md1
Failure: failed to start /dev/md1
Done.
Done.
Begin: Waiting for root file system... ...
md: md1 stopped.
mdadm: no devices found for /dev/md1
md: md1 stopped.
mdadm: no devices found for /dev/md1
md: md1 stopped.
mdadm: no devices found for /dev/md1
md: md1 stopped.
mdadm: no devices found for /dev/md1
md: md1 stopped.
mdadm: no devices found for /dev/md1
md: md1 stopped.
mdadm: no devices found for /dev/md1
  Vendor: ST350084  Model: 1A                Rev: 3.AA
  Type:   Direct-Access                      ANSI SCSI revision: 00
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
 sda:<6>md: md1 stopped.
  Vendor: ST350084  Model: 1A                Rev: 3.AA
  Type:   Direct-Access                      ANSI SCSI revision: 00
SCSI device sdb: 976773168 512-byte hdwr sectors (500108 MB)
sdb: Write Protect is off
sdb: assuming drive cache: write through
SCSI device sdb: 976773168 512-byte hdwr sectors (500108 MB)
sdb: Write Protect is off
sdb: assuming drive cache: write through
 sdb:udevd-event[939]: wait_for_sysfs: waiting for '/sys/devices/
pci0000:00/0000:00:01.2/usb3/3-1/3-1:1.0/host0/target0:0:0/0:0:0:0/
ioerr_cnt' failed
udevd-event[941]: wait_for_sysfs: waiting for '/sys/devices/
pci0000:00/0000:00:01.2/usb3/3-2/3-2:1.0/host1/target1:0:0/1:0:0:0/
ioerr_cnt' failed
 sda1 sda2 sda3
sd 0:0:0:0: Attached scsi disk sda
 sdb1 sdb2 sdb3
sd 1:0:0:0: Attached scsi disk sdb
mdadm: no devices found for /dev/md1
md: md1 stopped.
md: bind<sda1>
md: bind<sdb1>
md: kicking non-fresh sda1 from array!
md: unbind<sda1>
md: export_rdev(sda1)
raid1: raid set md1 active with 1 out of 2 mirrors
mdadm: /dev/md1 has been started with 1 drive (out of 2).
Done.
Begin: Running /scripts/local-premount ...
Done.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
Begin: Running /scripts/local-bottom ...
Done.
Done.
Begin: Running /scripts/init-bottom ...
Done.
INIT: version 2.86 booting
Starting the hotplug events dispatcher: udevd.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...input: ixp4xx beeper as /
class/input/input0
swapped image found
Image loaded to NPE-B Func:0, Rel: 2:1, Status: 82c00000
IXP4XX NPE driver Version 0.3.0 initialized
IXP4XX Q Manager 0.2.1 initialized.
ixp4xx_mac driver 0.3.1: eth0 on NPE-B with PHY[1] initialized
done.
Starting boot logger: bootlogd.
Activating swap...done.
Checking root file system...fsck 1.40-WIP (14-Nov-2006)
e2fsck 1.40-WIP (14-Nov-2006)
/dev/md1: clean, 22911/854784 files, 197904/1708880 blocks
done.
EXT3 FS on md1, internal journal
x1205 0-006f: rtc intf: dev (254:0)
Setting the system clock..
Cleaning up ifupdown....
Loading kernel modules...done.
Loading device-mapper supportdevice-mapper: ioctl: 4.7.0-ioctl
(2006-06-24) initialised: dm-devel@redhat.com
.
md: md2 stopped.
md: bind<sda2>
md: bind<sdb2>
raid1: raid set md2 active with 2 out of 2 mirrors
md: md3 stopped.
md: bind<sda3>
md: bind<sdb3>
raid1: raid set md3 active with 2 out of 2 mirrors
Assembling MD array md2...done (started [2/2]).
Assembling MD array md3...done (started [2/2]).
Generating udev events for MD arrays...done.
Checking file systems...fsck 1.40-WIP (14-Nov-2006)
e2fsck 1.40-WIP (14-Nov-2006)
/dev/md3: clean, 87290/60178432 files, 15549888/120354944 blocks
done.
Setting kernel variables...done.
Mounting local filesystems...kjournald starting.  Commit interval 5
seconds
EXT3 FS on md3, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
done.
Activating swapfile swap...Adding 128440k swap on /dev/md2.
Priority:-1 extents:1 across:128440k
done.
Setting up networking....
Configuring network interfaces...eth0: link up, 100Mbps, full-duplex,
lpa 0x45E1
done.
Starting portmap daemon....
/etc/init.d/rc: line 78: /etc/rcS.d/S70screen-cleanup: Permission
denied
INIT: Entering runlevel: 2
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Starting portmap daemon...Already running..
Starting MTA: exim4.
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
Exporting directories for NFS kernel daemon...exportfs: /etc/exports
[2]: Neither 'subtree_check' or 'no_subtree_check' specified for
export "*:/home".
  Assuming default behaviour ('subtree_check').
  NOTE: this default will change with nfs-utils version 1.1.0
.
Starting NFS kernel daemon: nfsdNFSD: Using /var/lib/nfs/v4recovery as
the NFSv4 state recovery directory
NFSD: starting 90-second grace period
 mountd.
Starting internet superserver: inetd.
Starting Samba daemons: nmbd smbd.
Starting OpenBSD Secure Shell server: sshdNET: Registered protocol
family 10
lo: Disabled Privacy Extensions
IPv6 over IPv4 tunneling driver
.
Starting NFS common utilities: statd idmapd.
Starting MD monitoring service: mdadm --monitor.
Starting deferred execution scheduler: atd.
Starting periodic command scheduler: crond.
Stopping boot logger: bootlogd.

Debian GNU/Linux 4.0 sluggy ttyS0

sluggy login:




A more decent fix would read the conf/md.conf file and would use
MD_DEVS.

Toon



Reply to: