2001-12-22 22:37:58

by Geoffrey Gallaway

[permalink] [raw]
Subject: Using USB floppy drive for root floppy

Hello,

I have a Sony Vaio laptop with an external USB floppy drive with which I
have been trying to install linux (slackware 8 specifically). I do not have
a cdrom drive, so that is not an easy option.

Originally, I just downloaded the standard boot and root floppies. I booted
and got the "Insert root floppy disk to be loaded into RAM disk and press
ENTER" message. Upon inserting the root disk and pressing ENTER I get a
message saying "Unable to mount root fs on 02:00". I believe the kernel is
looking for the root disk on what would be the floppy controler. I had
expected that the VAIO would have made the USB floppy drive emulate a
regular floppy drive on a regular controller. Apparently I was wrong.

To get around this problem I compiled my own kernel (2.4.12) with USB and
SCSI floppy support. Upon booting that kernel, linux recognizes the USB
floppy drive and apparently assigns it to sda. I then tried booting with
root=/dev/fd0 which caused the "Unable to mount root fs on 02:00" again. I
then tried root=/dev/sda which caused the kernel to panic with "Unable to
mount root fs on 08:00". I even tried adding "load_ramdisk=1" and
"prompt_ramdisk=1" to the kernel boot and it never asked for the floppy.
Anytime I specify root=/dev/sda the kernel would try to mount /dev/sda
before the USB floppy driver had been loaded. I took a hint from a previous
message thread regarding this problem[1] and added a sleep(10) before the
kernel tried to mount root. This didn't help at all or change the way the
system acted.

Any suggestions? My next idea is to try mounting root via NFS. My concern
with this idea is that my network adaptor is a PCMCIA card. If that doesn't
work I'm going to have to try to combine the root and boot floppies (ala
RedHat but for slackware in this case) so that the system never has to load
a seperate root floppy.

Thanks in advance,
Geoffeg

[1] http://www.uwsg.indiana.edu/hypermail/linux/kernel/0108.1/0735.html


2001-12-23 08:34:41

by Pete Zaitcev

[permalink] [raw]
Subject: Re: Using USB floppy drive for root floppy

>[...]
> Originally, I just downloaded the standard boot and root floppies. I booted
> and got the "Insert root floppy disk to be loaded into RAM disk and press
> ENTER" message. Upon inserting the root disk and pressing ENTER I get a
> message saying "Unable to mount root fs on 02:00".
>[...]
> To get around this problem I compiled my own kernel (2.4.12) with USB and
> SCSI floppy support. Upon booting that kernel, linux recognizes the USB
> floppy drive and apparently assigns it to sda. I then tried booting with
> root=/dev/fd0 which caused the "Unable to mount root fs on 02:00" again. I
> then tried root=/dev/sda which caused the kernel to panic with "Unable to
> mount root fs on 08:00".

There must be a delay before an attempt to mount is made.
Insert schedule_timeout(5*HZ) there (mdelay won't work because
it locks out khubd).

-- Pete

2001-12-23 16:07:37

by Eric Lammerts

[permalink] [raw]
Subject: Re: Using USB floppy drive for root floppy


On Sun, 23 Dec 2001, Pete Zaitcev wrote:
> There must be a delay before an attempt to mount is made.
> Insert schedule_timeout(5*HZ) there (mdelay won't work because
> it locks out khubd).

I made the patch below for this kind of thing. With this I can mount
the root fs on a USB harddisk.

Eric

--- linux-2.4.14-pre8-ext3/fs/super.c.orig Fri Nov 16 00:59:18 2001
+++ linux-2.4.14-pre8-ext3/fs/super.c Fri Nov 16 01:07:26 2001
@@ -1009,11 +1009,13 @@
* Allow the user to distinguish between failed open
* and bad superblock on root device.
*/
- printk ("VFS: Cannot open root device \"%s\" or %s\n",
+ printk ("VFS: Cannot open root device \"%s\" or %s, retrying in 1s.\n",
root_device_name, kdevname (ROOT_DEV));
- printk ("Please append a correct \"root=\" boot option\n");
- panic("VFS: Unable to mount root fs on %s",
- kdevname(ROOT_DEV));
+
+ /* wait 1 second and try again */
+ current->state = TASK_INTERRUPTIBLE;
+ schedule_timeout(HZ);
+ goto retry;
}

check_disk_change(ROOT_DEV);