Slackware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
01-10-2007, 02:48 AM
|
#1
|
Member
Registered: Jul 2002
Location: New Zealand
Distribution: slackware
Posts: 81
Rep:
|
Boot Linux from external hard drive??
Is it possible?
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.
Any suggestions as to what to do next?
Thanks.
|
|
|
01-10-2007, 03:16 AM
|
#2
|
Member
Registered: Nov 2003
Location: London, UK
Distribution: openSUSE, Ubuntu
Posts: 358
Rep:
|
Which boot image did you use? this sounds like it doesn't have SB support.
|
|
|
01-10-2007, 03:50 AM
|
#3
|
Member
Registered: Jul 2002
Location: New Zealand
Distribution: slackware
Posts: 81
Original Poster
Rep:
|
> Which boot image did you use?
> this sounds like it doesn't have SB support.
Good point. I used the default sata.i.
What would be a better choice?
|
|
|
01-10-2007, 09:34 AM
|
#4
|
Member
Registered: Dec 2003
Location: Spain
Distribution: Slackware 14.1 64bit - multilib
Posts: 148
Rep:
|
You will probably need to make a initrd. See this.
|
|
|
01-11-2007, 02:14 AM
|
#5
|
Member
Registered: Jul 2002
Location: New Zealand
Distribution: slackware
Posts: 81
Original Poster
Rep:
|
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?
Thanks for your help...
|
|
|
01-11-2007, 03:37 AM
|
#6
|
Member
Registered: Aug 2005
Location: Bavaria, Germany
Distribution: Slackware (Current)
Posts: 225
Rep:
|
|
|
|
01-11-2007, 05:01 AM
|
#7
|
Member
Registered: Jul 2002
Location: New Zealand
Distribution: slackware
Posts: 81
Original Poster
Rep:
|
Thanks Fluxx. I'm gradually getting it all together.
I must be fairly close. I can boot the usb partition through
my boot loader and the usb modules are installed. Then I get:
Attached scsi disk sdb at scsi2, channel0, ide0, lun0
SCSI device sdb: 234441648 512-byte hdwr sectors (120034 MB)
sdb: sdb1 sdb2
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
What is going on here? Why does the device fail to mount?
|
|
|
01-11-2007, 06:06 AM
|
#8
|
Member
Registered: Jul 2002
Location: New Zealand
Distribution: slackware
Posts: 81
Original Poster
Rep:
|
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.
|
|
|
01-13-2007, 10:33 PM
|
#9
|
LQ Newbie
Registered: Jan 2007
Posts: 3
Rep:
|
Mandriva?
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
|
|
|
01-19-2007, 05:46 AM
|
#10
|
Member
Registered: Jul 2002
Location: New Zealand
Distribution: slackware
Posts: 81
Original Poster
Rep:
|
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.....
Cheers,
Wootle.
|
|
|
All times are GMT -5. The time now is 04:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|