Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 03-15-2008, 05:41 PM   #1
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 398

Rep: Reputation: 64
booting from usb drive

I've installed slack 11 on a USB drive but can't get it to boot up.

I get the lilo screen and then various initial messages but it gives up
when trying to mount the root file system, saying:

   VFS: Cannot open root device "801" or 08:01
   Please append a correct "root=" boot option
   Kernet panic VFS: Unable to mount root fs on 08:01
Previous messages show that /dev/hda1 and /dev/hda2 paritions
have been found, but tellingly, no mention of the /dev/sda1
which is to be the root partition.

I tried the sata.i kernel first, then the scsi.s kernel
then compiled my own variant of scsi.s with usb as
part of the kernel (i.e. not modules). None of these helped.

As a test, I copied the contents of the root partition onto
/dev/hda2, tweaked lilo accordingly, and - hey presto -
it boots up fine. But I'd still like to get it all working on

I've just noticed that in scsi.s/config


Could that be the problem?

Any suggestions welcome.
Old 03-15-2008, 06:07 PM   #2
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 68
Try booting with rootdelay=10 at the lilo prompt.
Old 03-16-2008, 03:54 AM   #3
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 398

Original Poster
Rep: Reputation: 64
Tried rootdelay=10, but no joy. Good idea tho.

I've got a feeling it's a module to do with usb or /dev/sda that's
not loaded.

I noticed this kmod error that I missed before:

kmod: failed to exec /sbin/modprobe -s -k block_major_8, errno = 2.
I don't understand what this means, but block_major_8 seems related to scsi. Oddly, the -k option isn't mentioned in the man page.
Old 03-16-2008, 04:36 AM   #4
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
IIRC you need to be using an initrd if you're trying to boot from a thumbdrive, unless you're just trying to use it as a vehicle for getting lilo to boot your hard disk. You can't just clone what works for an IDE disk over to a thumbdrive and have it work. The USB bus works dramatically differently from an IDE bus in enough ways that they can't be booted from the same way.
Old 03-16-2008, 05:34 AM   #5
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 398

Original Poster
Rep: Reputation: 64
Thanks evildamgar. I've gone and read /boot/READM.initrd and it seems a custom initrd will let me load modules ahead of the mounting of the root partition.

But, I'm not sure this is going to help me because I've already compiled everything I can think of into my custom kernel, so
no modules should be needed.

This is new territory for me, so please tell me if I'm misunderstanding something.
Old 03-16-2008, 05:35 AM   #6
Senior Member
Registered: Mar 2004
Location: Westray, Orkney
Distribution: Linux Mint 17.1
Posts: 1,424

Rep: Reputation: 137Reputation: 137
Here try this! It is for Slackware 12.0, but it should give you some ideas.

Old 03-16-2008, 07:38 AM   #7
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 398

Original Poster
Rep: Reputation: 64
Thanks samac - spot on - slack 12 is now booting up perfectly from my usb drive. Loading the kernel takes ages, so the next job is to compile a smaller one.

The problem with my slack 11 install is almost certainly
that a delay is needed before mounting of the root partition
to give the usb drive time to initialise. rootdelay seems to be ignored (2.4.* kernel perhaps?), but I imagine inserting
sleep 10 into the initrd startup, as per your link above, would work too.

PS Having attended science and folk music festivals in Orkney, I'm not at all surprised to see an orcadian using slackware!
Old 03-17-2008, 12:35 AM   #8
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,855

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
Kernel-2.4 doesn't support the rootdelay option -at least for a little while longer. I submitted a patch to the kernel-2.4 Maintainer a few weeks ago which adds the feature (backported from kernel-2.6.x). It is supposed to be included in the next stable release of kernel-2.4.
Meanwhile, you can apply the patch yourself easily and use it, since you are already compiling your own kernel. It's a really small patch, so I'll just post it here:

	From: Gilbert Ashley <> 11 November 2007
	This patch adds the 'rootdelay' option to the kernel
	command-line boot options. The feature was backported
	from the 2.6 kernel series. This allows for mounting
	root filesystems which are located on devices whose
	drivers are slow to load, such as USB mass-storage devices.
	Example: 'rootdelay=10' tells the kernel to wait 10
	seconds before trying to mount the rootfs device.

--- ./init/do_mounts.c.00	2007-11-11 17:07:37.000000000 +0100
+++ ./init/do_mounts.c	2007-11-11 17:34:38.000000000 +0100
@@ -6,6 +6,7 @@
 #include <linux/ctype.h>
 #include <linux/blk.h>
 #include <linux/fd.h>
+#include <linux/delay.h>
 #include <linux/tty.h>
 #include <linux/init.h>
@@ -315,8 +316,16 @@
 	return 1;
+static unsigned int __initdata root_delay;
+static int __init root_delay_setup(char *str)
+	root_delay = simple_strtoul(str, NULL, 0);
+	return 1;
 __setup("rootflags=", root_data_setup);
 __setup("rootfstype=", fs_names_setup);
+__setup("rootdelay=", root_delay_setup);
 static void __init get_fs_names(char *page)
@@ -888,7 +897,15 @@
 void prepare_namespace(void)
-	int is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
+	int is_floppy;
+	if (root_delay) {
+		printk(KERN_INFO "Waiting %dsec before mounting root device...\n",
+		       root_delay);
+		ssleep(root_delay);
+	}
+	is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
 	extern void arch_discover_root(void);
--- ./Documentation/kernel-parameters.txt.02	2007-08-15 09:49:06.000000000 +0200
+++ ./Documentation/kernel-parameters.txt	2007-11-11 18:06:41.000000000 +0100
@@ -561,6 +561,9 @@
 	root=		[KNL] root filesystem.
+	rootdelay=	[KNL] Delay (in seconds) to pause before attempting to
+			mount the root filesystem
 	rootflags=	[KNL] set root filesystem mount option string
 	rootfstype=	[KNL] set root filesystem type
Paste the above into an empty document and save as 'rootdelay-K24.diff'.
You can apply it to the kernel sources by copying it into the toplevel kernel sources, then cd'ing in there an give the command 'patch -p1 rootdelay-K24.diff'
Then re-compile your kernel. You don't need to choose any options during kernel configuration.
Then you can use the feature by putting 'rootdelay=X' in your kernel commandline, where 'X' is the number of seconds to delay.
Usually, you need to give an extra 3-6 seconds as the rootdelay option. 3 seconds is sometimes enough if the drive doesn't have a bunch of partitions. I have one drive with 6 or 7 partitions which needs 6 seconds to register. You may have drives which need even longer. If so, just keep adding time until it works consistently.

You don't really have to use an initrd either, just be sure that you have these options enabled:
# (under IDE, ATA and ATAPI Block Devices)
# scsi emulation

# under SCSI support

# extra checks in queing code not strictly needed

# enable scan all luns -this lets you use multi-card readers painlessly

# under USB support
# this is main USB support

# initial usb filesystem support

# main USB mass-storage driver
# you don't have to have this -it just gives more verbosity in the log

# these are for cardereaders -if you plan on using any of these
The only other thing you need in your kernel is support for whichever filesystem your root partition is using. You can have nearly everything else as modules. With a little patience pruning out hard-compiled options, you can cut the size of the kernel to under 800KB. Or just start with the config file for the standard Slackware ide kernel and add in the above options -your kernel should still be around 1200KB so it easily fits on a floppy if you want.
Old 03-17-2008, 02:35 AM   #9
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 398

Original Poster
Rep: Reputation: 64
Thanks gnashley - that confirms what I was slowly discovering.

I've noticed slightly strange behaviour when booting off the slack (11 or 12) setup cd
with the usb key plugged in. At the prompt (where you'd type setup), the first time I type
fdisk -l I just see /dev/hda partitions. But, without fail, the second time I type
fdisk -l the /dev/sda partitions appear!

Not really a problem - just wierd.


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
booting from a USB drive poblano Linux - General 1 08-12-2007 09:02 PM
booting 11.0 off external usb drive jmille34 Slackware 2 11-18-2006 01:43 PM
Booting from USB Drive agallant Linux - General 1 02-15-2006 08:43 AM
Booting USB drive from floppy UrbanKonfederat Linux - Software 3 01-31-2004 06:58 AM
booting from usb keychain drive etron Linux - Software 0 01-28-2004 11:32 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:11 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