LinuxQuestions.org
Help answer threads with 0 replies.
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
  Search this Thread
Old 08-26-2005, 05:15 PM   #1
4partee
Member
 
Registered: Nov 2004
Distribution: Slackware
Posts: 39

Rep: Reputation: 15
Install to USB HDD, boot from CD/DVD


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.
 
Old 08-27-2005, 09:07 AM   #2
mscole
Member
 
Registered: Nov 2004
Location: Florida
Distribution: Slackware 15
Posts: 129

Rep: Reputation: 24
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.
 
Old 08-29-2005, 11:01 AM   #3
4partee
Member
 
Registered: Nov 2004
Distribution: Slackware
Posts: 39

Original Poster
Rep: Reputation: 15
mscole, thanks for the link.

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.
 
Old 08-30-2005, 06:54 AM   #4
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 900

Rep: Reputation: 153Reputation: 153
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.


Regards
 
Old 09-02-2005, 08:37 PM   #5
4partee
Member
 
Registered: Nov 2004
Distribution: Slackware
Posts: 39

Original Poster
Rep: Reputation: 15
Thanks mscole and aikempshall;

I am now booting a 120GB ide HDD in a USB enclosure on my otherwise broken laptop(no hda). I can boot from USB or a rescue CD.

mscole, are you still needing a solution?
 
Old 09-05-2005, 09:00 AM   #6
mscole
Member
 
Registered: Nov 2004
Location: Florida
Distribution: Slackware 15
Posts: 129

Rep: Reputation: 24
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.
 
Old 09-06-2005, 09:44 AM   #7
baoiso
LQ Newbie
 
Registered: Aug 2005
Posts: 1

Rep: Reputation: 0
Hi All,

I am booting Slackware 10.1 on an external USB drive thanks to you all.

mscole, do this if you want to boot directly from your USB:

- Boot CD1 Slackware 10.1
- Mount /dev/sda3 and chroot
- Modified your lilo.conf and executed lilo.

You 'll get a warning messages saying that it's not the first drive.

You now have a portable linux distribution

Hope this help.

Baoiso
 
Old 09-06-2005, 10:42 AM   #8
mscole
Member
 
Registered: Nov 2004
Location: Florida
Distribution: Slackware 15
Posts: 129

Rep: Reputation: 24
I can't boot from my external drive because the bios does not support it, so I will have to live with the boot cd (which isn't so bad).
Mike.
 
Old 09-07-2005, 06:40 PM   #9
mscole
Member
 
Registered: Nov 2004
Location: Florida
Distribution: Slackware 15
Posts: 129

Rep: Reputation: 24
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.
 
Old 09-07-2005, 07:25 PM   #10
mscole
Member
 
Registered: Nov 2004
Location: Florida
Distribution: Slackware 15
Posts: 129

Rep: Reputation: 24
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.
 
Old 09-08-2005, 06:04 PM   #11
4partee
Member
 
Registered: Nov 2004
Distribution: Slackware
Posts: 39

Original Poster
Rep: Reputation: 15
I have seen this(mount: Mounting /dev/sda3 on /mnt failed: No such device or address) happen also.

Look in your /boot/initrd-tree/dev folder that was source for mkinitrd and make sure sda3 is listed.
 
Old 09-09-2005, 06:23 AM   #12
mscole
Member
 
Registered: Nov 2004
Location: Florida
Distribution: Slackware 15
Posts: 129

Rep: Reputation: 24
It is listed in a file named rootdev, and the boot cd does the job on my home computer. Unfortunately I need it primarily for my work computer.
Mike.
 
Old 09-09-2005, 06:32 AM   #13
mscole
Member
 
Registered: Nov 2004
Location: Florida
Distribution: Slackware 15
Posts: 129

Rep: Reputation: 24
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
Mike.
 
Old 09-09-2005, 06:58 AM   #14
mscole
Member
 
Registered: Nov 2004
Location: Florida
Distribution: Slackware 15
Posts: 129

Rep: Reputation: 24
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."
Mike.
 
Old 09-09-2005, 07:01 AM   #15
mscole
Member
 
Registered: Nov 2004
Location: Florida
Distribution: Slackware 15
Posts: 129

Rep: Reputation: 24
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.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual boot XP(internal IDE HDD) Debian(external USB-IDE HDD) using boot.ini PolarDog Linux - Laptop and Netbook 2 07-01-2005 09:50 PM
Install directly to HDD from iso on HDD/USB, with out burning cd vivinuthappa DamnSmallLinux 7 11-16-2004 10:03 AM
boot from USB HDD, no MOBO usb boot support magiconexxx Linux - Hardware 0 11-03-2004 12:38 AM
need help boot from usb-hdd shadow.blue Linux - General 4 04-25-2004 08:19 AM
Toshiba boot problems - USB ext HDD - new install wtriver Linux - Newbie 5 11-02-2003 04:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration