USB mass-storage install fails

Bug #21449 reported by Mark Lord
32
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
Medium
Adam Conrad

Bug Description

Trying out newest Breezy "Preview" disc today on a notebook. Rather than blow
away the main drive (running Hoary), I used a USB2 hard disk as the target for
the breezy install. No problem until the mid-install reboot sequence, at which
point it eventually dropped me to a shell complaining that it couldn't access
the root filesystem.

The initramfs logic doesn't appear to realize that it needs the USB drivers on
the initramfs in this case, even though the installer was clever enough to load
them to enable the partial install to that point.

Result: impossible to install to anything other than the fixed hard disk in the
notebook.

Revision history for this message
Mark Lord (mlord) wrote :

Mmm.. poked around some more, and the initramfs *does* have the USB drivers.
But the usb-storage module has a built-in delay before acknowledging drives, and
the initramfs runs before usb-storage has made the target drive available for
use. Thus the failure.

Maybe add a (sleep 6) to the initramfs when the target is usb-storage??

Revision history for this message
Mark Lord (mlord) wrote :

Success -- I edited the "functions" file from the initramfs, and added a "sleep
6" line to it:

        for x in /sys/bus/usb/devices/*; do
                if [ -e ${x}/modalias ]; then
                        modprobe -q $(cat ${x}/modalias)
                fi
        done
        sleep 6

This allowed my system to boot/run from the USB drive. I think "6" is the bare
minimum here (I have a very fast system), and a number like "8" would be better.
 The usb-storage drive delays for "5" seconds, so allowance must be made for the
activity that happens after the delay.

Cheers

Revision history for this message
Jeff Bailey (jbailey) wrote :

Thanks. This is another case where we're being bitten by bus scans taking too
long to complete.

I'm going to try and work something where if it doesn't find what it needs, it
sleeps and retries to a maximum of 20 seconds or so before it dies.

I'll let you know when I've got a test initramfs-tools for you.

Tks,
Jeff Bailey

Revision history for this message
Mark Lord (mlord) wrote :

Note that the usb-storage module has a modparam: "delay_use=nn"

The "5 second delay" is a fairly recent thing, and nearly all systems don't need
it ever -- it really messes up the plug'n'play desktop icons, for example.

I have it set to "delay_use=1" on my Hoary install.

Cheers

Revision history for this message
Kevin R. Page (ubuntu-bugzilla-krp) wrote :

I have also been trying to install to a USB hard disk.

I succeeded by building a new initramfs at the end of the install, where:

1) I changed to MODULES=dep in /etc/mkinitramfs/initramfs.conf

2) in both /usr/share/initramfs-tools/hook-functions and
/usr/share/initramfs-tools/scripts/functions I increased the sleep value found,
in both cases, after the "Give the USB bus a moment to catch up" comment. I used
sleep 10, which works, but is probably a little conservative.

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 23385 has been marked as a duplicate of this bug. ***

Changed in initramfs-tools:
status: Unconfirmed → Confirmed
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

This should work fine in dapper, no?

Revision history for this message
Mark Lord (launchpad-rtr) wrote :

I am unable to test this on Dapper yet, as the Kubuntu dapper liveCD installer crashes at screen 6/7 whenever the USB drive is connected, even if I don't select that drive.

Revision history for this message
Mark Lord (launchpad-rtr) wrote :

Re-tested with Kubuntu flight-7 live CD today.

Install and subsequent use works well now, thanks.

Suspend (to RAM) from bios key works, but resume fails with external USB root drive; works when internal SATA drive is used instead. But all that is a different bug, I suppose.

Cheers

Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Mark, is your bug now fixed or have you still problems?

Changed in initramfs-tools:
status: Confirmed → Needs Info
Revision history for this message
Mark Lord (launchpad-rtr) wrote :

It was working (aka. "fixed") in Dapper flight-7. Have not retested since. Go ahead and close this.

Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Thank you for your response. Please feel free to reopen this bug, if this happens again.

Changed in initramfs-tools:
status: Needs Info → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.