Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.


  Search this Thread
Old 09-02-2003, 05:44 PM   #1
sam cadby
LQ Newbie
Registered: Sep 2003
Distribution: slackware
Posts: 1

Rep: Reputation: 0
Unhappy usb root filesystem and devfs

ok. here's a problem Iím having and Iím hoping someone can help?

I'm building a little ucLibc/busybox system that boots off a usb flash drive (flash and a floppy at the moí).

/ is mounted read-only off a cramfs partition on the flash (why bother with a ramdisk - seems inelegant). the intention is to build a ramdisk for /tmp and /var.

In order to avoid having to faff about populating a /dev dir on a ramdisk (again, inelegant) I thought Iíd use devfs.

I have an initrd that loads the necessary modules (cramfs, usb-storage etc).

When i boot the kernel I pass root=/dev/scsi/host0/bus0/target0/lun0/part1 from grub (the cramfs partition on the usb device). However, the node/devfs entry is not made by devfs until after the kernel has started booting, apparently when the usb-storage module loads. This appears to confuse the kernel when it tries to mount root=/dev/scsi/host0/bus0/target0/lun0/part1. It can't find /dev/scsi0/bus0/target0/lun0/part1 and even refers to it as 00:00 (as in the device node major and minor), just before it panics.

It seems to be a devfs thing as Iíve produced the system with an near identical kernel, just without devfs (this time passing root=/dev/sda1 from grub) and it works fine.

Here are a few things Iíve tried:

no devfs kernel, root=/dev/sda1 (works)

devfs kernel but passing root=/dev/sda1 from grub. I believe this should work, but it doesn't...

devfs kernel, monolithic (ie, no modules, no initrd), pass root=/dev/scsi/host0/bus0/target0/lun0/part1. doesn't work ("unable to mount root on 00:00 as before")

no devfs, monolithic (as above), root=/dev/sda1. works fine

As far as i can work out the problem stems form the kernel needing to decipher the location of the rootfs passed from the bootloader at some point before the information is made available to it by the usb-storage code initialising and devfs creating the device node (am i right?). Can anyone think of a way round this? Does anyone have any more info on the process the kernel goes though when passed a root= parameter by a bootloader? Obviously it canít examine a /dev/node as the root is not mounted so how does it work out the root device from the parameter?

- Sam

Incidentally I have inserted code into domounts.c in the kernel sources to delay the mounting of root to allow for USB device initialisation, which works without devfs but makes no difference with it. usb-storage has plenty of time to initialise as the non devfs kernel mounts root but the devfs one still falls down.

I forgot to mention, 2.4.22 kernel

Last edited by sam cadby; 09-02-2003 at 05:45 PM.
Old 10-14-2003, 04:21 PM   #2
LQ Newbie
Registered: Oct 2003
Posts: 1

Rep: Reputation: 0
Yeah, this appears to be broken for devfs since 2.4.19. The old patch to wait and retry is needed, but in a different place. In init/do_mounts:mount_root, after the tests for NFS mount, there is a call to devfs_make_root, followed by a call to create_dev. Prior to the call to devfs_make_root, the USB userland daemon needs to run to instantiate the USB device into the system. Then either the devfs path or the non-devfs form on the root= should work. However, notice that the devfs form is pased on the command line in a weird format (see convert_name for details). In the non-devfs format, the device is looked up in the name_to_kdev_t converstion routine, and the MAJOR/MINOR number is taken from the table. If the device exists, devfs is searched to find the real device handle. Otherwise, the links should be setup from the call to devfs_make_root.

In any event, if the device doesn't exist prior to these function calls, you're gonna' panic.

I'm working on a patch, but had hoped to find an "official" patch from So far, no luck.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unknown filesystem devfs ioan123 Linux - Software 4 11-23-2005 07:24 PM
Mounting root filesystem from an external USB hard drive? ChrisHart Linux - Laptop and Netbook 6 04-02-2005 10:49 PM
Encrypted Root Filesystem HOWTO and /dev filesystem tmillard Linux From Scratch 0 10-18-2004 03:58 PM
MSI Vox USB TV Tuner (saa7114) modprobes but no devfs entries show? ChillingSilence Linux - Hardware 2 09-25-2004 03:03 PM
USB Keyboard Failing at USB Filesystem Mount Time ciaran_skye Fedora 0 08-06-2004 02:09 AM > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 09:56 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration