LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problems installing linux onto a USB drive (https://www.linuxquestions.org/questions/linux-newbie-8/problems-installing-linux-onto-a-usb-drive-372201/)

Cogvos 10-12-2005 05:29 AM

Problems installing linux onto a USB drive
 
Dear all,

I am having problems installing Linux onto an external usb/firewire hard drive. I wish to do this so that I can have a portable, writable linux distribution that I can plug into a number of pcs without having to install a boot loader onto that pc. In short I want to leave pcs untouched... but use linux on 'em.

Now 2 of my distributions install onto a usb disk

SUSE 9.3 and Fedora 4.

The external drive has 2 firewire sockets and 1 usb.

Q1. SUSE locks up at random points during the package copying when the drive is connected via firewire, but not if it's connected via usb. Windows does not have this problem, so I am guessing that it is not a cabling issue. Any ideas?

Q2. Once either SUSE or Fedora are installed I want to be able to boot from the USB hard drive. The PCs all have a boot menu (they are compaq's so pressing ESC brings this up) and I can select the usb drive. But... All that is displayed is the word GRUB in the top left corner. What do I have to do in order to get grub to load Linux? The boot loader is installed into the first sector of the USB drive and the drive order is usb then system drive.

Q3. I can boot SUSE by using the install DVD, waiting till I get to the part where it detects the install on the usb drive and then boot that. It takes a while but it works. One of the pcs has an Agere winmodem (ugh), SUSE 9.3 comes with a package called ltmodem, which I install, follow the directions on various web sites and totally fail to get the modem working. Can someone point me to an easy to follow way of doing this?

Hope someone can help. All the PCs identical compaq amd 3200+ systems, so there will not be a problem with kernal/module inconsitancies.

John.

Simon Bridge 10-12-2005 09:51 PM

How did you install these distros to the usb drive?
Are the bioses set to boot from usb hdd?

mjjzf 10-13-2005 03:19 AM

Boot floppy, perhaps?

Simon Bridge 10-13-2005 04:12 AM

Reading more carefully:
Q1. SUSE locks up at random points during the package copying when the drive is connected via firewire, but not if it's connected via usb. Windows does not have this problem, so I am guessing that it is not a cabling issue. Any ideas?


This sounds like you do not have SuSE installed to the external drive.
Are you saying you have already tried booting windows from the external drive?

This is interesting since it would appear you need have a boot image which can tell whether it is using firewire or usb. So - is this first question about installing or booting SuSE?

Q2. Once either SUSE or Fedora are installed I want to be able to boot from the USB hard drive. The PCs all have a boot menu (they are compaq's so pressing ESC brings this up) and I can select the usb drive. But... All that is displayed is the word GRUB in the top left corner. What do I have to do in order to get grub to load Linux? The boot loader is installed into the first sector of the USB drive and the drive order is usb then system drive.

"Once either SuSE or Fedora is installed..." suggests you do not have either installed. How are you attempting to install them?

In general:
Grub has to know where to find the boot image - look in /boot/grub/grub.conf and see where the /boot is expected to be.

The boot image needs to have the appropriate drivers.

You have to run grubinstall after the linux install

Installing linux to boot off a usb drive is fiddly depending on the distro. A lot depends on the installer and how you did the installation. Hence the question.

Q3. I can boot SUSE by using the install DVD, waiting till I get to the part where it detects the install on the usb drive and then boot that. It takes a while but it works. One of the pcs has an Agere winmodem (ugh), SUSE 9.3 comes with a package called ltmodem, which I install, follow the directions on various web sites and totally fail to get the modem working. Can someone point me to an easy to follow way of doing this?

There is no easy way to get a winmodem going. And they either go or they don't. Basically, this is quite a big question all by itself. You need to specify what exactly you did to get the modem going and in what way this has failed.

The most reliable way I have found to get a stubborn modem going is to run the scanModem script from the linmodem project and read what it says. It can be a bit dauntingly technical but it will give you sound advice in the middle there.

* * *

FWIW: here's a basic howto for installing FC3 so it boots off usb hdd:


1. Boot off of a rescue CD. If you use Redhat/Fedora, type

chroot /mnt/sysimage

If your rescue CD would not mount the partitions (for some reason, mine did not), you have to mount them manually and then change root to the hard disk's filesystem. In my case,

mount /dev/sda3 /mnt/sysimage
mount /dev/sda1 /mnt/sysimage/boot
chroot /mnt/sysimage

2. You'll need to create a custom initrd image. Fortunately, FC3 can do it for you

mkinitrd --preload=ehci-hcd --preload=usb-storage --preload=scsi_mod --preload=sd_mod /boot/usbinitrd.img 2.6.9-1.667smp

Warning: this did not work for me on FC3, probably because the sleep call (see below) was not there, and I was not
able to create a custom initrd using the steps below. But my hardware is pretty flaky. Other people reported success with this.

Stanislav Umansky made some corrections to the default mkinitrd script. He writes:

The mkinitrd command wasn't okay, because it lacked sleeps and some other commands, so we've changed it a little. The main thing is having sleeps and running sfdisk on /dev/sdb, /dev/sdc and /dev/sdd. When you boot on some systems with the primary SATA drive, /dev/sda is that SATA drive. Our USB drives become /dev/sdb, /dev/sdc...

As we installed FC3, it used volume labels to find a disk when booting (ROOT in our case), but when we tried to boot on a system where Linux had already been installed on the primary hard drive, the system found two ROOT-labeled partitions and didn't boot successfully, so we had to change the labels to ROOT_USB, etc and modify grub.conf.

3. Update your lilo.conf or grub.conf to use the new usbinitrd.gz with the same kernel that you grabbed the modules from. Run lilo or grub-install.

Author: Simon Ilyushchenko (simonf@simonf.com)

Cogvos 10-13-2005 05:48 PM

Hello Simon,
Many thanks for such a detailed reply. To answer your questions in order...

Q1. Suse locks up during the install when the external drive is connected via firewire. Everything is ok up until the point where the install starts copying packages. Then at some random point during this something happens and the external drive 'disappears'. That's the best way to describe it. Eventually the copy times-out saying that it can't copy package xxxx. Retry fails, ignore fails on the next package, though without a timeout. Aborting the install and restarting the pc into windows does not make the drive come back. The only way to do so is power cycle both the pc and the external drive. At first I thought this was a heat problem, but Suse installs fine if the external drive is connected via USB and windows is quite happy accessing the drive via firewire. Note that I only have either the firewire or USB cables connected, never both.

Q2. Sort of answered above, basically by using install disks which I have (DVDs). Both Suse and Redhat install onto the external drive when its connected via USB. (Suse locks when its connected via Firewire and Fedora can't see the drive when its connected via Firewire).
I select expert partioning in both case. 3 partions Sda1 = boot, sda2 =/, sda 3= swap.
I have been switching the drive order and installing the bootloader onto the first sector of sda1...

However, I read that this might not work on a web site so tried to install it onto the MBR of the exteral drive. This now gives me a partially booting suse install and a Fedora 4 install that Kernal panics saying it can't sync. (I posted another question relating to the Suse boot on that forum. Appologies if this was wrong)

Q3. I had a feeling this would be the case. I got a winmodem working years ago on an old P1 200mhz PC using Redhat9, I had hoped that the ltmodem package on Suse would solve my problem without going through the hastle of scripts and stuff. Guess not. I'll have a look once I can get one of the dists to boot successfully from the external drive.

Many many many thanks for the mini howto. Just one question, when you say boot off a rescue cd, is this the install cd or another cd. If the latter how do I create it ? If the install cd where do I issue the chroot /mnt/sysimage command? At the start before the install (where you hit enter to start the install) or elsewhere. Sorry that was 3 questions.

Finally bios can boot from USB, cd or internal (windows), not sure about firewire, I have conflicting info on this.

John

Cogvos 10-13-2005 05:52 PM

Floppy boot disk?
 
Quote:

Originally posted by OSourceDiplomat
Boot floppy, perhaps?
Sorry OSourceDiplomat. The PC is a new PC, and does not have a floppy drive, 'cos people don't use them anymore'. The cynic in me reads this as 'we don't build pcs with floppy drives, thus forcing people to spend more money buying a floppy drive from us....

John.

Cogvos 10-14-2005 05:37 PM

USB booting linux --- Solved! ---
 
Many thanks to Simon, who put me on the right track with this. Taking his Mini howto as a starting point I created a new SUSE Initrd with the following command.

mkinitrd -m "ehci-hcd usb-storage scsi_mod sd_mod ohci-hcd uhci-hcd usbcore sata_sil atiixp reiserfs ext"

This overwrites the initrd in /boot so I made a copy of it. And lo- it works. I can now boot suse from an external USB hard drive. I guess the missing part was the usbcore, why it wasn't in the installed initrd is a mystery.

Also re win modem, I gave up the unequal struggle and bought a small adaptor that converts serial to usb, YaST now picks up my old US robotics external fax modem, I'm using it now.

Finally, there have been a few posts I've seen re getting nVidia cards to work, the newer ones like the 6600 GT. Well the latest 7676 divers work for me, but... I could not get YoU (or whatever its called) to install this properly. I had to download the drivers from the Nvidia wb site, kill X (init 3 from a root xterm), then run the Nvidia script (also as root) and finally start SaX2 to enable. I also had to install the kernal headers for the script to work.

I hope this helps anyone else with similar problems. The usual 'try it at your own risk' words apply. The above worked for me. I cannot guarentee it will work for you, nor can I guarentee that it won't damage anything,

John.

waytoocrazy 12-14-2005 10:29 PM

Excellent, I now have hope to get Suse10 working off of my 80gb USB External drive. What I would like to do is dual partition the drive... 60gb for Windows (for backup) and 20gb for linux to learn the OS. I tried doing a custom partition setup, but got stuck (I'm clueless on how to use the custom partition info). If anyone can point me to the original post that has the walk through on how to actually install and then do the mkinit or whatever to actually get the drive to boot. I would also like to put the drive on any machine and have it work without putting lilo or grub on my internal HD.


All times are GMT -5. The time now is 01:35 PM.