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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I installed Slack 11.0 on /dev/sdb2 of an external (USB)
hard drive, configured as master. I made a boot floppy.
Lilo was installed into the root partition superblock.
When I booted from the floppy I got a certain distance
into the boot and then got a kernel panic. Specifically:
.....
Linux IP multicast router 0.06 plus PIM-SM
NET4: Unix domain sockets
NFS: Cannot open root device "sdb2" or 08:12
Please append a current "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 08:12
I tried various boot options and other procedures
using a boot manager (Ranish) but always get kernel panic.
Linux fdisk correctly identifies /dev/sdb and /dev/sdb2
is bootable. I can mount /dev/sdb2 from another Linux OS
and the partition appears to be OK.
Thanks for that pointer, gbowden.
Very informative. I tried to use it as
a basis for booting to the USB partition
using a boot loader (Ranish).
I booted to the Slack11 CD and installed the default
Linux on /dev/sdb2. Then
# mount /dev/sdb2 /mnt
# cd /mnt/boot
# chroot /mnt /usr/sbin/mkinitrd -c -k 2.4.33.3 -m jbd:ext3
-f ext3 -r /dev/sdb2
# cd /mnt/etc
edit lilo.conf to include the lines:
image=/boot/vmlinux
initrd=/boot/initrd.gz
root=/dev/sdb2
label=Linux
Save file then
# chroot /mnt /sbin/lilo
When I select the partition /dev/sdb2 through the boot loader
this happens:
......
/boot/initrd.gz: Loading kernel modules from initrd image
Using /lib/modules/2.4.33.3/jbd.o.gz
insmod: not an ELF file
insmod: could not load the module
mount: Mounting /dev/sdb2 on /mnt failed: No such file or directory
ERROR: mount returned error code 1. Trouble ahead
mount: mounting /dev/sdb2 on /mnt failed: Invalid argument
/boot/initrd.gz: exiting
I guess there is something I am doing wrong, but what?
Is the mkinitrd command correct?
GOT IT! The trick was *not* to set the boot device in the
initrd config file rootdev. With /dev/sdb2 removed from
rootdev I was able to boot to the external USB HD through
my boot loader (Ranish).
In summary I used the Slack 11.0 boot disk and Ranish
to install the default kernel (2.4.33.3) in the partition
/dev/sdb2 of the USB drive, and then to boot Linux from this
partition. The procedure was:
(1) Boot to the Slack CD and format the partition. Install
Linux into /dev/sdb2 (use ext2 fs) and put lilo in the superblock.
(2) With the CD still in place make sure /dev/sdb2 is mounted
on /mnt.
(3) Set up the initial ramdisk
# cd /mnt/boot
# chroot /mnt /usr/sbin/mkinitrd -k 2.4.33.3
(4) Copy usb modules to the initrd-tree/lib/modules/2.4.33.3
These are
USB_MODULE_PATH/usbcore.o.gz,
USB_MODULE_PATH/storage/usb-storage.o.gz
USB_MODULE_PATH/host/ehci-hcd.o.gz,
USB_MODULE_PATH/host/uhci.o.gz
where
USB_MODULE_PATH = /mnt/lib/modules/2.4.33.3/kernel/drivers/usb
The files should be gunzipped after transfer.
(5) Insmod the usb modules in /mnt/boot/initrd-tree/load-kernel-modules.
Use the vi editor to insert them in this order:
insmod /lib/modules/$(uname -r)/usbcore.o
insmod /lib/modules/$(uname -r)/ehci-hcd.o
insmod /lib/modules/$(uname -r)/uhci.o
insmod /lib/modules/$(uname -r)/usb-storage.o
Other modules may be inserted as desired (eg if using
ext3 or reiserfs instead of ext2)
Make sure the file is executable
(chmod 755 load-kernel-modules)
(6) Use vi to insert the line "sleep 10" in
/mnt/boot/initrd-tree/linuxrc
after the lines
......
done
unset module
fi
fi
.......
sleep 10
......
Make sure linuxrc is executable (chmod 755 linuxrc)
(7) Make sure /mnt/boot/initrd-tree/rootdev is empty
(8) chroot /mnt /usr/sbin/mkinitrd
(9) Run lilo
# cd /mnt/etc
Edit lilo.conf with vi and insert the lines
image=/boot/vmlinuz
initrd=/boot/initrd.gz
root=/dev/sdb2
label=Linux
# chroot /mnt /sbin/lilo
(10) Reboot
(11) If using Ranish select /dev/sdb2 as a boot item
and boot to the USB partition.
I Am Working On This Same Project But With Mandriva
The Exact Same Thing Happens When The System Tries To Mount Root
Will I Be Able To Use The Same Technique That Was Just Used Here?
I Wonder If I'll Have A Problem Editing These Files If I Have My Usb Drive Plugged Into My Machine That Is Running Mandriva.
Kernel Is 2.6.17
I don't know Mandriva, but it is probably worth a try.
You need a bootable CD and then you must install the OS
(in basic form) on the USB drive. You also need some
utilities on the boot CD such as chroot and an editor,
and of course you need mkinitrd either on the CD or
from the installed OS. The correct USB modules must be
available, and insmodded in the correct order. If you
get this wrong then you will have those nasty error messages.
Also you need some sort of boot manager which allows you
to set the bootable partition.
I can't see why you should have any problem editing the
files on the USB partition. If you can mount it then
you can treat it like any other partition.
There's nothing wrong with experimenting, since you will
still have your main Mandriva partition there if things
go wrong. I had to to try quite a few times before I got it
right.....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.