LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

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

Rep: Reputation: 60
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:

Code:
   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
/dev/sda1.

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

CONFIG_BLK_DEV_IDESCSI=m

Could that be the problem?

Any suggestions welcome.
 
Old 03-15-2008, 06:07 PM   #2
XGizzmo
Member
 
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
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 388

Original Poster
Rep: Reputation: 60
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:

Code:
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
evilDagmar
Member
 
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
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 388

Original Poster
Rep: Reputation: 60
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
samac
Senior Member
 
Registered: Mar 2004
Location: Westray, Orkney
Distribution: Slackware64-14.1 (multi-lib) KDE 4.11.4
Posts: 1,399

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

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

Original Poster
Rep: Reputation: 60
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
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,724

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
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:

Code:
	From: Gilbert Ashley <amigo@ibiblio.org> 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;
 #ifdef CONFIG_ALL_PPC
 	extern void arch_discover_root(void);
 	arch_discover_root();
--- ./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:
Code:
# (under IDE, ATA and ATAPI Block Devices)
# scsi emulation
CONFIG_BLK_DEV_IDESCSI=y

# under SCSI support
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y

# extra checks in queing code not strictly needed
CONFIG_SCSI_DEBUG_QUEUES=y

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

# under USB support
# this is main USB support
CONFIG_USB=y

# initial usb filesystem support
CONFIG_USB_DEVICEFS=y

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

# these are for cardereaders -if you plan on using any of these
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_DPCM=y
CONFIG_USB_STORAGE_HP8200e=y
CONFIG_USB_STORAGE_SDDR09=y
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_STORAGE_JUMPSHOT=y
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
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 388

Original Poster
Rep: Reputation: 60
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.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


All times are GMT -5. The time now is 07:44 AM.

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