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.
Here's a twist on the boot from USB topic. I want to install Slackware to a USB HDD, but boot from CD/ROM.
This is surely a strange problem. My barely out of warranty laptop suffered water damage which killed the internal HDD and the primary IDE controller. I have booted it with a live CD so I know the CD/DVD on hdc works . There is no floppy either. I must boot from CD/DVD.
Since I cannot install a new HDD, I hope I can use a USB HDD as a root device. The bios, however, does not permit booting from a USB HDD. I am/was hoping that I can setup an initrd and them use mkrescue, or whatever, to boot from the CD/DVD.
I have done a full install to the USB HDD, but am stumped on how to create a bootable CD.
I am trying to do the same thing on a desktop. I spent all afternoon googling yesterday, and did not find the solution, but I did find some leads. It looks like there are two choices: recompile the kernel to have built-in support for USB, or make a customized initrd that loads USB support at boot time. I would prefer the second method, but as yet have not found a step-by-step that actually works for Slackware. See: http://www.linuxquestions.org/questi...5&pagenumber=1
Anyone done this successfully? It seems to me it shouldn't be too difficult.
Mike.
The insmod command used by initrd is from busybox and apparently does not handle gzipped modules. A make ;make install wil clear the 'not an ELF file" error message.
Another thing that helps in the long run is to address the sleep issue where linuxrc needs to wait until the usb/firewire root device in ready. My solution is to modify initrd-tree.tar.gz file used by the -c option of mkinitrd. In its bin folder I added ln -s busybox sleep and in linuxrc I added sleep 9 right after the section that loads the modules.
I've successfully installed slackware 10.0 and 10.1 to a USB harddrive. Also created a CD that will boot the USB harddrive. See the thread quoted above or search here for aikempshall for more information.
I hope to get a bit more script driven when I upgrade to 10.2 -
a script to compile the kernel with the necessary USB/SCSI support and other personalised kernel settings;
a script to create the bootable CD;
a script to create the initrd on the USB HDD.
I got it to work by booting the cd I made, and entering the following parameters at the "Boot:" prompt
vmlinuz initrd=initrd.gz root=/dev/sda3 ro hdc=ide-scsi
In my case, sda3 is the / partition, and hdc is my cd writer.
Mike.
I have another problem with this boot cd. It works on the computer I made it on, but it does not work on my computer at the office, where I really need it. It hangs trying to mount the root partition of the usb drive, that is, /dev/sda3, telling me it does not exist. I managed to install lilo on the MBR of the usb drive, and I copied my initrd.gz and the initrd-tree to the /boot partition. Lilo loads, but again, it hangs when trying to mount the root partition of the usb drive. I have a "sleep 10" in the linuxrc file after it loads the usb modules. The usb modules seem to be loading, so I am stumpped. Any ideas?
Mike.
Here are the kernel messages on the screen when it stops:
PCI: Found IRQ 10 for device 00:1d.3
PCI: Sharing IRQ 10 with 00:1e.2
uhci.c: USB UHCI at I/O 0xff20, IRQ 10
usb.c: new USB bus registered, assigned bus number 4
hub.c: USB hub found
hub.c: 2 ports detected
Using /lib/modules/2.4.29/usb-storage.o
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
hub.c: new USB device 00:1d.1-2, assigned address 2
usb.c: USB device 2 (vend/prod 0x413c/0x2005) is not claimed by any active driver
hub.c: new USB device 00:1d.3-1, assigned address 2
usb.c: USB device 2 (vend/prod 0x46d;0xc016) is not claimed by any active driver.
kmod: failed to exec /sbin/modprobe -s -k block-major-8, errno = 2
mount: Mounting /dev/sda3 on /mnt failed: No such device or address
ERROR: mount returned error code 1. Trouble ahead.
mount: Mounting /dev/sda3 on /mnt failed: Invalid argument
mount: Mounting /dev/sda3 on /mnt failed: Invalid argument
/boot/initrd.gz: exiting
pivot_root: pivot_root: Device or resource busy
Freeing unused kernel memory: 120k freed
#
That's it. I had to type it all out (I am logged on to a Windows machine right now).
Mike.
It looks like one of my modules is not loading, but since usb-storage did load, and it is the last on my list in my load_kernel_modules file (see below), I don't see how this could be the case. Does anybody know which module the last line in these messages refers to?
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
hub.c: new USB device 00:1d.1-2, assigned address 2
usb.c: USB device 2 (vend/prod 0x413c/0x2005) is not claimed by any active driver
hub.c: new USB device 00:1d.3-1, assigned address 2
usb.c: USB device 2 (vend/prod 0x46d;0xc016) is not claimed by any active driver.
kmod: failed to exec /sbin/modprobe -s -k block-major-8, errno = 2
My load_kernel_modules file, which forces the modules to load in the order listed:
Code:
# This is a script used to load the kernel modules.
# To use it, chmod it 755, and then add the insmod
# lines needed to load your modules, like this:
insmod /lib/modules/$(uname -r)/reiserfs.o
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
Here is part of my linuxrc file, note where I added "sleep 10" after the modules are loaded. The last lines here show where I am getting an error during boot.
Code:
# Mount /proc:
mount -n proc /proc -t proc
# Load kernel modules:
if [ ! -d /lib/modules/`uname -r` ]; then
echo "No kernel modules found for Linux `uname -r`."
elif [ -x ./load_kernel_modules ]; then # use load_kernel_modules script:
echo "/boot/initrd.gz: Loading kernel modules from initrd image:"
. ./load_kernel_modules
else # load modules (if any) in order:
if ls /lib/modules/`uname -r`/*.*o 1> /dev/null 2> /dev/null ; then
echo "/boot/initrd.gz: Loading kernel modules from initrd image:"
for module in /lib/modules/`uname -r`/*.*o ; do
insmod $module
done
unset module
fi
fi
sleep 10
# Initialize LVM:
if [ -x /sbin/vgscan ]; then
/sbin/vgscan --mknodes
sleep 10
/sbin/vgchange -ay
fi
# If /rootdev isn't set, we'll have to trust exiting to work here.
# It's harder to clean up the initrd without a pivot_root,
# so it's a good idea to set rootdev (and rootfs) properly.
if [ -r /rootdev ]; then
if [ "`cat /rootdev`" = "" ]; then
exit 0
fi
else
exit 0
fi
# Switch to real root partition:
ROOTDEV=`cat /rootdev`
ROOTFS=`cat /rootfs`
echo 0x0100 > /proc/sys/kernel/real-root-dev
mount -o ro -t $ROOTFS $ROOTDEV /mnt
ERR=$?
if [ ! "$ERR" = "0" ]; then
echo "ERROR: mount returned error code $ERR. Trouble ahead."
One other detail. The machine at home (where the cd works) is USB 1.something, and the machine at the office, where the cd does not work, is USB 2.0; I don't know whether or not that matters.
Mike.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.