SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
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.
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!
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.
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.