LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-01-2005, 04:44 AM   #1
roger64
LQ Newbie
 
Registered: Dec 2004
Distribution: mdk10
Posts: 2

Rep: Reputation: 0
Question booting a Linux distro from an external USB2 disk


All is in the title. I think this will soon be quite a popular feature due to the everfalling prices of USB2 hardisks but currently it is not clearly in the mainstream. Mandrake did it some months ago for their Globe trotter from a boot CD. I did not buy it because I already have MDK10 and I wish to test other distros. I first thought that it would be a trivial task. In fact I realize that it is -now- far from being easy.

The BIOS of my laptop (dual boot XP and MDK10) does not support booting directly from USB2, so I need to find a booting something (CD, floppy, internal partition).

I nearly had an easy win using BootitNG shareware which can be used as a boot manager for USB2. Alas, i use a PC card adapter (PCMCIA) for USB2 and this feature is still unsupported by this otherwise excellent product (maybe it will be this year according to Terabyteunlimited).

Somebody from IBM did it with a floppy and Grub but the explanations are far beyond my understanding.

AFAIK there is nothing to expect from Partition Magic (Boot Magic has no magy for USB2).

To create a small dedicated partition (/boot) on the main internal disk could be a solution but I would need clear explanations on how to implement it. Probably there is also the need to recompile the kernel because currently USB is loaded from modules.

Has somebody done such a thing and could provide me with a clear and hopefully simple path to implement it?

Happy New year all of you and long life to Linux.
 
Old 01-01-2005, 08:48 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hi and Happy New Year

You're right, if you don't master Linux boot floppy creation, the easiest way for you to boot from USB drive is to do it from a /boot partition.
First step: compile a kernel with USB/PCMCIA drivers built in the kernel
Second step: install it in /boot (Just need to copy bzImage and System.map in the directory)
Third step: the most complicated... create a root filesystem on your USB drive (must have /bin directory with bash exec, must have /lib, must have all modules...)
Last step: re-configure your bootloader... and enjoy

Here are links:
this one explain how to build an USB system
And I forgot to tell you that you'll need to apply a kernel patch to mount USB partition as a root fs:
here is the patch
or there's also this one which work pretty good

Oliv'

Last edited by Oliv'; 01-01-2005 at 08:55 AM.
 
Old 01-01-2005, 09:24 PM   #3
roger64
LQ Newbie
 
Registered: Dec 2004
Distribution: mdk10
Posts: 2

Original Poster
Rep: Reputation: 0
Hi Oliv

Thanks very much for your reply and links provided which clearly show there is a way ahead. I realize it is still a little cryptic for me (i used only Macintosh in my past life....) and I am afraid of screwing up my current settings because my knowledge of Lilo and booting is just basic and I cannot consult any books here (I am in China..) I'd just comment on steps 1 and 2

- 1. recompile the kernel with USB-PCMIA. Seems OK
(had forgotten to include PCMCIA) But which kernel? I imagine it would need to be the kernel of my new distro? Or my current MDK10 kernel? Or a brand new MDK 10.1 kernel (I've been told that MDK patches heavily its kernel, to good effect it seems..?

I think to apply the patch is just a single command. This step should be OK

- 2. I look at my current /boot and do not see any bzImage. If I create a new /boot partition, will it confuse Lilo? Will Lilo automatically add a new entry in his two-items list? How big would be this partition? My current /boot is 3,3 megs with about sixteen items.

I keep stage 3 for further time (Paris ne s'est pas fait en un jour :-)

Thanks for help
 
Old 01-02-2005, 07:35 AM   #4
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
1-You can choose the kernel you want... personnally I would download kernel sources from kernel.org but if you prefer recompiling mandrake kernel sources....
to patch a kernel, that's very simple:
-download the patch
-then:
Code:
cd /usr/src/linux
patch -Np1 -i ../path/to/my/patch.txt
and that's done

2-about /boot partition, I think it's about 50/100 mega large (type "df" in a console to know it)... In fact, to add a new kernel and its symbol table (the System.map file), you need 2Megas if you don't put too many useless features in your kernel (currently: my 2.4.28 compressed kernel + my System.map = 1264Ko).
When you finish kernel compilation, it will generate a file called bzImage (in relation with the make bzImage step)... this file is located in /usr/src/linux/arch/i386/boot/... and you need to copy it in /boot and also rename it as vmlinuz (in fact you can rename it as you want but many people rename it like that)
you need to configure lilo yourself... have a look in /etc/lilo.conf (I think you'll quickly understand base config)... once this file modified you need to run lilo, for that just type "lilo" in a console... If you make a mistake in the config file you'll be warned and you'll be able to correct it and re-run lilo

Hope I've correctly shed your lights

Oliv'
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PCMCIA USB2-CARD and External harddisk Satriani Linux - Hardware 0 05-03-2005 04:43 AM
USB2 External drive... Sirkent Debian 2 12-19-2004 07:23 PM
Updatedb is crashing my usb2 external drive turls Linux - Hardware 1 12-06-2004 07:52 AM
installing on usb2 external drive, kernel panics zed13 Linux - Newbie 3 08-25-2004 08:41 PM
multiple usb2 external HD juel Linux - Hardware 1 04-18-2004 06:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:53 PM.

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