LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-22-2004, 04:13 AM   #1
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Rep: Reputation: 15
Thumbs up Solved - booting from USB mass storage


I would like to use Linux as second OS on a notebook, without making changes to the primary harddisk.

My idea was to
(1) buy an external USB hard disk,
(2) install Linux there
(3) configure it to boot from floppy or via BIOS (supports USB boot)

As of now, I have only successfully completed step 1. I created (amongst others) an ext2 and a swap partition on the disk with Partition Magic. Then I ran Mepis (vers. Oct 2003) to see whether everything on the notebook is detected and to eventually install it.

Mepis can see the USB harddisk (and also seems to recognise the partitions), but it refuses to mount it ("no valid block device"). With Knoppix 3.4 things are worse; it does not recognise the partitions. My next try will be a newer distro with kernel 2.6 (Mandrake 10).

Maybe someone reading this forum has already done this successfully? (I already checked with Linux success stories forum) Eventually I will post a success story myself, but you might help me save time as I slowly work through the possible distros...

I could settle with always booting Linux from CD, but I would still need to mount the USB hard disk to put additional software, configuration data and some work there.

Last edited by mwettach; 09-10-2004 at 03:57 AM.
 
Old 03-22-2004, 12:23 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,309

Rep: Reputation: 139Reputation: 139
See the post by pmpatrick here dealing with this issue:

http://www.mandrakeusers.org/index.p...8040&hl=maxtor

You get yourself in a catch 22 when trying to install to an external hard drive with most linux kernels - you need to load the usb mass storage module to access the root partition on your external usb hard drive and the usb module is in the root partition on the external hard drive. In the above post he got around that by putting the root partition on the internal drive and everything else on the external drive. An alternative would be to compile a linux kernel with usb mass storage built in rather than loaded as a module.
 
Old 03-23-2004, 03:20 AM   #3
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
Thanks for your post. Actually I used that configuration (boot partition on the primary disk, all other partitions on another disk) on my desktop. But I don't want to make changes to the primary harddisk on this laptop. As I said already, I wouldn't mind booting from floppy or CD, as long I can configure and install things on a hard disk.

I tried Mandrake 10.0 (kernel 2.6) yesterday evening and my external USB disk was recognised just fine. I chose "expert" install (though this din't appear complicated) and manual partitioning to make sure my primary disk would suffer no harm. My existing Linux partitions on the external disk were recognised and allowed for install.

Alas, during the software install process I received several messages of the type "error in installing ...xyz... do you want to continue?" and at some point the install hung. Maybe a faulty media (was still on CD 1), an external disk that got too warm, a flawed USB connection, whatever.

So I cannot post my success story yet, but I'll keep trying. At least it seems that Mandrake 10 can be recommended for this type of install.
 
Old 03-23-2004, 08:20 AM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,309

Rep: Reputation: 139Reputation: 139
I did an install of mdk9.2 on my externel usb hard drive and got the same result as pmpatrick, i.e. the installation program recognized and allowed me to install to the external hard drive but I got a kernel panic when I tried to boot. Reinstalling and putting the root partition on my internal hard drive and everything else on the external drive worked for me; no more kernel panic.
I'm now running mdk10 and the usb and scsi modules that are needed to recognize the external usb hard drive are definitely being loaded as modules so I think you will have the same problem with mdk10. The solution would be to first install to an internal hard drive then recompile the kernel to have those modules built in the kernel instead of loaded as modules. Then image your mdk partitions and transfer them to your external drive, edit your fstab on the external to correspond to the new location of your mdk partitions and make a boot cd(kernel is too big for a floppy) and edit the boot cd config file to point it to your root partition on the external hard drive. I'm fairly certain that would work but it's pretty complicated. I PMed pmpatrick on that forum and that's what he suggested and gave me instructions on how to make the boot cd if your interested.
 
Old 03-24-2004, 03:55 AM   #5
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
Yes, I would definitely be interested in instructions how to make a boot CD.

My problem at the moment however is not the boot process but the install. My Mandrake 10 installation hangs repeatably at 11-12 minutes before completion. I find it interesting that you managed to intall MDK9.2; of this product I have better quality CDs; I might try that as well but thought it would be better to use a newer version.

I tried to install SUSE 9 last evening. The SUSE installation CD has an option to start an already installed Linux from hard disk, so this would save me the trouble to create a boot CD.

My partitions on the USB drive were recognised by the YAST setup tool and I was able to choose them for installation. However, at the point where SUSE wanted to format the partitions, they had been lost again ("no valid partition").

I found indications in the internet that older versions of MEPIS (until 08.2003; cf. this link: http://www.mepis.org/node/view/262 ) and also the recent versions of Yellow Dog Linux have USB compiled into the kernel (in the latter case to support MAC computers better). So I might try one of these; this would save me the trouble of kernel compile which I have never done yet. [[edited: skip the crap about yellow dog; this is for the Power PC architecture only.]]

Last edited by mwettach; 03-24-2004 at 04:11 AM.
 
Old 03-29-2004, 04:19 AM   #6
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
I'm giving up for the moment.

I have tried Mandrake 9.2, Lycoris and other distros - and every distro is giving up the installation somewhere along the way. Some distros do not let me mount the drive or do not recognise the partitions; some distros just hang during install; Lycoris (Update 3) suddenly finished at 55% progress with the message: "some packages could not be installed".

May be a hardware problem; but I have copied several Gigabytes to and from this external USB drive without problems under Windows 2000 and Windows XP.

I'll try to find a live distro which is able to mount the drive and write configuration files and install software on it. Maybe some further research into Mepis or Knoppix will be sufficient for this.

If that fails, I have read about the possibility to create a linux filesystem within a file on a windows partition using loopback (cf. http://uranus.it.swin.edu.au/~jn/linux/ex2fsfile.htm), so I could use Knoppix - if it still refuses to mount my external disk - with the new stable NTFS support to store data on my primary (WinXP) hard disk.

Another option would be to give up my stance on not changing the primary disk and to create a small boot partition there (see the earlier posts).
 
Old 04-14-2004, 04:00 AM   #7
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
I found that the occasional hang-ups in Linux may be associated with my USB hardware (external Genesys Logic USB 2.0 controller in the hard disk case). Other people have reported similar problems (works in Windows, hangs in Linux) here: http://www.mail-archive.com/linux-us.../msg21593.html .

As I am using a removable USB case I shall try another external USB case.

By the way I noticed that I can boot a S.U.S.E 9.0 Live! CD, mount the external USB hard disk and use the YAST setup tool to put mount points (even the root mount point: /) on the external disk. If I am not mistaken SUSE copied files from the Ramdisk onto the external USB hard disk during this manoeuvre. I have not tried software installs yet, but this might be just the solution I wanted.
 
Old 04-14-2004, 04:15 AM   #8
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
Just as an afterthought - I was able to mount the disk in Mepis after all. I did it by unplugging the USB disk, removing the kernel modules associated with USB (ucpi, ehci and usb-storage), reloading these modules (except ehci, because that is not needed on my machine) and connecting the USB disk again. After this operation the mount command worked, but the Mepis install failed all the same (similar to the other Linuxes).

For the other newbies out there who want to mount a reluctant external USB disk, to save you some searching, you might want to look into the following commands:

cat /proc/scsi/scsi [shows all recognised SCSI/USB disks]
lvmdiskscan [shows all recognised partitions on all disks]
fdisk -l /dev/sda [shows all recognised partitions on first SCSI disk]

lsmod [shows the currently loaded kernel modules]
rmmod module-name [unloads a module]
modprobe module-name [loads a module if not already present]
 
Old 08-07-2004, 04:44 PM   #9
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
not solved yet

I got a new USB case for my 40GB notebook harddisk this week. It works far better: SUSE installed the first CD completely without failure.

(Addendum, just for the record - the new device also has a Genesys Logic controller. So it is not necessarily the controller's fault.)

However, I couldn't reboot into the installation and complete it. I tried rescue mode and chrooted into the new partition. I was even able to start X and KDE. But many things did not work yet and I didn't know how to finish the install.

Mepis install was more successful. Alas, the kernel complains about wrong parameters when booted (does not find the root filesystem -> kernel panic; apparently the USB disk is not visible to the kernel at boot time, even though LiLo and the kernel itself have been loaded from it).

But I can boot the Mepis CD, log into a console, chroot to the USB disk and start X and KDE. Everything works quite well; however I can't unmount the CD: the kernel still seems to think it is needed. So all installs will have to be done through the internet.

Last edited by mwettach; 08-19-2004 at 02:07 AM.
 
Old 08-08-2004, 06:56 PM   #10
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,309

Rep: Reputation: 139Reputation: 139
Here's a great link on this very topic, an aritcle from IBM:

http://www-106.ibm.com/developerwork...lnxw02FireBoot

Haven't tried it yet myself but it looks very thorough. Note the script at the end which is needed to rescan the scsi bus which I think was at the heart of the problem.
 
Old 08-19-2004, 02:19 AM   #11
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
Thanks for the link; I had also found that page in the meantime. It looks like using InitRD will definitely help to set up my boot from hard disk. I will be tackling this approach in the next weeks.

As to booting from CD, I am currently using the following sequence:
[ Mepis is installed on sda7 using ext3fs; I created a directory /cdroot there. ]

(1) Boot up the Mepis (SimplyMepis 2004 RC3) CD.
(2) Edit the GRUB command line (press 'e' twice) and append 'Linux 2' (without hyphens).
(3) Boot from the changed command line (press 'b')
(4) Log on using 'root' username and password.

(5) mkdir /mnt/linux
(6) mount -t ext3 /dev/sda7 /mnt/linux
(7) cd /mnt/linux
(8) pivot_root . cdroot
(9) exec chroot . /sbin/init 5

This will start X and KDE and take me to a graphical login for the harddisk installed Mepis. From this point on the CD is silent and everything is loaded from harddisk.

However, the CD drive is still blocked by Linux and I cannot switch the CD. Any ideas on how I can release or umount the drive, so that I could put another CD in there?
 
Old 09-08-2004, 09:10 AM   #12
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
new experiences

I have installed SuSE 9.1 on the USB disk in the meantime using an installation DVD (not a CD as in my first try). This completes quite smoothly, recognizes my hardware and makes it usable, including the winmodem. The SuSE DVD also allows me to boot from DVD, load the USB drivers from DVD and then boot the installed USB partition. This means I can work with SuSE already. However, the DVD cannot be removed.

Now I have started on the initrd trail.

(1) I copied and mounted the standard SuSE 9.1 initrd, which needs to be gunzipped first. Contrary to some messages I read on the internet the SuSE initrd does not use the minix filesystem (maybe that was true for older versions, I haven't checked) but rather an ext2 filesystem.

(2) I added the necessary USB drivers on the initrd under /lib/modules/2.6*/usb (a directory I created myself). The drivers are scsi_mod.ko, usbcore.ko, uhci-usb.ko, hid.ko, usb-storage.ko. I found that I also needed to add ehci-usb.ko, because otherwise the boot would hang on PCMCIA detection. No idea why, but nevermind. As the initrd file is residing on my external USB hard disk, I am not plagued by space restrictions. For safety, I also added the other modules I found loaded after the SuSE DVD boot, which are sg.ko, sd_mod.ko and sr_mod.ko.

By the way on my first try I got some error messages of the type "usb-storage: unknown symbol scsi_add_host" etc. If you get "unknown symbol" messages like I did, maybe a module that you need has not been loaded (as was true in my case). There are two files (created by the depmod command) which you can use to find out what is missing; I give examples of the respective command lines to get the needed info.

cat /lib/modules/2.6*/modules.dep | grep usb-storage
cat /lib/modules/2.6*/modules.symbols | grep scsi_add_host

In my case the module scsi_mod.ko was missing on first try because the IBM article referenced in an earlier post above did not mention it. I had thought the SCSI emulation sd_mod mentioned in the article would satisfy all requirements. [ EDIT - As a side note, the "modprobe" command used in the article would have solved the dependencies, but this command is not available in the SuSE initrd file. I have used "insmod" instead. ]

(3) I then edited the linuxrc batch file to load the USB drivers just before the presence of the root filesystem is checked.

(4) I umounted and gzipped the initrd file and changed the GRUB config file (menu.lst) so that the new initrd file is used during boot.

Now all the necessary drivers, including usb-storage, are loaded successfully on boot. There is even a message "new usb device found"; the device (my external HD) is recognized as "sg0". However, the root filesystem is still not present; the partition /dev/sda6 does not seem to appear.

Any ideas as to what I can do so that the partition can be seen by the kernel?

Last edited by mwettach; 09-08-2004 at 09:19 AM.
 
Old 09-10-2004, 03:41 AM   #13
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
Talking solved

Answering my own post...

Just a silly typo - should have been sd_mod.ko instead of sg_mod.ko.
Couldn't see the failed loading because messages flashed past too quickly.
SuSE now boots fine from external USB disk; no CD needed anymore.

[Edit:]
I have posted extracts from my adapted SuSE linuxrc file on my homepage
http://mw-pc-seiten.de/homepage

[Edit-End]

Last edited by mwettach; 11-08-2004 at 03:40 AM.
 
Old 09-13-2004, 05:06 AM   #14
nemihome
LQ Newbie
 
Registered: Sep 2004
Posts: 1

Rep: Reputation: 0
Hmm I have tried to make a boot disk for Mandrake. I have edited the inird file and added the modules for usb. My problem is, that I have not found a Kernel which is small enough to fit on the disk with the initrd file.

I also tried changing the initrd file on the harddisk, but there is no change for me. The same problems than before. I don't think that the initrd file is used on my harddisk before the usb driver is loaded. How do you have solved this problems?

Btw sorry for my Englisch

Last edited by nemihome; 09-13-2004 at 05:18 AM.
 
Old 09-19-2004, 04:33 PM   #15
mwettach
Member
 
Registered: Oct 2003
Location: Germany
Distribution: SuSE 8.2, SuSE 9.1 on desktop (besides W2K). SuSE 9.1 on notebook (besides XP).
Posts: 44

Original Poster
Rep: Reputation: 15
Obviously modern kernels together with initrd are too large for a floppy disk. You could use an USB stick instead or - as I did - your USB hard disk, which has more than enough space.

The initrd file is not used by default. You must configure your bootloader to use it. In my case I am using GRUB and had to edit the /boot/grub/menu.lst file. I needed to add an entry below the line where my kernel is loaded. Please have a look at my homepage:
http://mw-pc-seiten.de/homepage/USB_hd.htm

Good luck!
 
  


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
USB Mass Storage Daniboy Linux - Software 10 09-12-2005 08:30 AM
USB mass storage Roy-Svork Linux - Hardware 9 09-24-2003 04:34 PM
usb mass storage Erwan Linux - Hardware 6 07-08-2003 05:39 PM
usb mass storage mohapi Linux - Hardware 3 06-03-2003 12:44 AM
USB Mass Storage mrsolo Linux - Hardware 11 10-25-2002 06:24 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration