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

Bug#359922: initramfs-tools: ata drive via usb 'scsi' /dev/sda stops boot, gets busybox



Package: initramfs-tools
Version: 0.55b
Severity: important
Tags: patch

Every boot aborts to a busybox with a failure to mount the root, /dev/sda1, which is an ordinary drive in a portable 
enclosure connected via USB, in this case to an Athlon 64 system. After the busybox prompt appears, the usb hotplug system 
finds the drive, printing the correct id messages, whereafter /dev/sda1 appears.  Just typing 'exit' at the busybox then 
proceeds to boot normally.

I suspect this problem occurs in all cases where the bios 'boot' device is not the eventual final root device and
the root device discovery / setup process takes some time to settle (usb storage setups, raid setups, etc.)

I suggest the proper fix is to have a script in init-premount that doesn't exit until the root device is present
(probing once per second) or a timeout after 30 seconds occurs.  I created the following file, than ran

update-initramfs -u

which corrected the problem in my hard-drive-via-usb case.  file:  

/usr/share/initramfs-tools/scripts/init-premount/usbscsiroot

Content:

#!/bin/sh 

PREREQS="udev"

prereqs() { echo "$PREREQS"; }

case "$1" in
    prereqs)
    prereqs
    exit 0
    ;;
esac

# The time we wait for udev to work things out
udevd_timeout=30

if [ "$ROOT" = "/dev/sda1" ]; then
  echo "waiting on sda1"
  while [ ! -b "/dev/sda1" ]; do
    sleep 1
    udevd_timeout=$(($udevd_timeout - 1))
    if [ $udevd_timeout -eq 0 ]; then
	break
    fi
  done
fi

Hope this helps.  I searched the net prior to see that others had this problem, but I didn't see a published answer.

Sincerely,

Harry Coin
Bettendorf, Iowa
 

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15diskless-a64
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages initramfs-tools depends on:
ii  busybox                       1:1.01-4   Tiny utilities for small and embed
ii  cpio                          2.6-11     GNU cpio -- a program to manage ar
ii  klibc-utils                   1.2.4-1    small statically-linked utilities 
ii  udev                          0.087-2    /dev/ and hotplug management daemo

initramfs-tools recommends no packages.

-- no debconf information



Reply to: