Jump to content



Photo

[How To]Boot from a USB drive without BIOS support


  • Please log in to reply
28 replies to this topic

#1 zachman123

zachman123

    Remix.

  • Joined: 02-October 03
  • Location: A² MI

Posted 10 January 2005 - 00:38

Since it seemed to be such a common issue with barely any resources available, I decided to write a tutorial on how to achieve booting Linux, from an external USB drive, on a computer that can't boot from USB (Using a boot CD). I'll get right to the point.

I used Windows for the CD burning steps just because it was easier for me, but feel free to use linux.

1. Start off by installing the distro of your choice to the USB drive. For the rest of the tutorial I'm going to be using Mandrake 10.1 just becuase I've already made the initrd for it. All the defualt settings should be fine.

2. Using a rescue/LiveCD, mount your USB drive and steal the kernel off it (from /boot). Copy the kernel to somewhere that you can access from Windows, like a NTFS/FAT partition on the disk.

3. Here comes the fun part. If you plan on installing Mandrake 10.1 (I've found it to be pretty nice), you can just use my initrd file, which will save you A LOT of time. If you plan to use a distro, hop over to my section on editing my initrd to fit your system.

4. Now, from Windows, proceed to create your CD bootloader. I've convienently made an isolinux boot cd, so all you have to do is insert your kernel. Use MagicIso or a similar program to put your kernel and initrd.img into the isolinux directory on the cd. Check the isolinux.cfg and make sure it's pointing to the kernel and initrd, and that root is set to /dev/sda1.

5. Burn your Boot CD. I've been looking for buisness card cd's so I could put my bootloader in my wallet, but none of the major retail stores have them. Tell me if you find a good deal on them somewhere.

6. This is the first test. Put in the boot CD, and plug in the USB drive. The system should boot up and get to the startup script, and it'll probably get hung at the fsck step (At least for Mandrake 10.1). If you didn't get that far, you have a problem with the bootloader on the cd, the kernel, or the initrd. Fix it, or if you can't figure out what's wrong, contact me.

7. If you made it this far, you're pretty much done, and you can smile now. Just use a rescue/live cd and mount your usb drive again. Delete/modify the lines in your rc script that the boot is getting stuck at. Keep trying to boot/fixing the script until it's happy and you can boot.

8. That's it! You're done. Hope this guide helped you. If there are any bugs/errors/you can't figure it out, PLEASE contact me so I can change it.

Initrd Editing:
So, you chose to use a different disto. That's fine and all, but it's going to require some work.
Basically, here are the steps.
Boot using a rescue/live cd. Mount your usb drive. Also, mount the directory containing my initrd image (Have it on a cd or something). Gunzip the initrd.img (rename it to initrd.gz first) if it needs it. Mkdir /mnt/initrd Then mount it using mount -o loop initrd /mnt/initrd.
From /mnt/initrd, view the linuxrc file and get a feel for what it's doing. Then, replace all of the modules currently in the initrd (The Mandrake 10.1 modules) with the modules from the usb drive, the system you wish to boot from usb.
Unmount the initrd image, gzip it back up, rename it to initrd.img, and copy it back to a Windows accessable partition.
Continue on with the rest of the steps.

Attached Files


Edited by zachman123, 21 January 2005 - 20:35.



#2 aem4162

aem4162

    neowinita

  • Joined: 01-April 02
  • Location: Riverside, OH location: my quiet place

Posted 10 January 2005 - 01:05

5.  Burn your Boot CD.  I've been looking for buisness card cd's  so I could put my bootloader in my wallet, but none of the major retail stores have them.  Tell me if you find a good deal on them somewhere.

View Post

thank you!!!! this is SO cool!!!! i'm gonna try it soon (i hope!).

anyhoo...you might try supermediastore for your business card cds. i've ordered stuff from them before and they seem to be ok. i'd swear that i saw the cds in compusa but can't find anything about them on the site.

#3 bflorat

bflorat

    Neowinian

  • Joined: 19-January 05

Posted 19 January 2005 - 09:46

Thanks but your two files looks corrupted . I can't unzip them neither under Windows (tried winzip, 7zip) nor under Linux (tried unzip, tar xzpvf, bzip2).

#4 OP zachman123

zachman123

    Remix.

  • Joined: 02-October 03
  • Location: A² MI

Posted 19 January 2005 - 11:46

Try again, they seem to be working fine for me.

#5 bflorat

bflorat

    Neowinian

  • Joined: 19-January 05

Posted 21 January 2005 - 13:36

Not better...
For both files:
With Winzip : "File is not in the standard Zip 2.0 format"
With 7-Zip : file broken
With unzip under Linux : error uncompressing

Inspite of these errors, I get some files:
usbboot.iso :120 KO
initrd.img : 129KO
but when I try to open them under MapgicIso, it tells me that these files don't contain image...

#6 Solarix

Solarix

    Neowinian Senior

  • Joined: 29-July 02
  • Location: Sealand

Posted 21 January 2005 - 13:47

yes i can confirm they are broken in a way winrar is giving me errors

#7 OP zachman123

zachman123

    Remix.

  • Joined: 02-October 03
  • Location: A² MI

Posted 21 January 2005 - 20:40

Files Fixed.
Stuffit apparently hates me, it wouldn't zip files correctly AND it didn't give an error trying to unzip the old files (but they were still messed up)
Anyways Winzip did the trick, and I may be reinstalling/killing stuffit soon.

If you have ANY problems AT ALL, please let me know. Feel free to
E-mail zachman123@gmail.com
AIM zachman123
MSN zachman123@gmail.com **Not on often
YAHOO zachdude123@sbcglobal.net **Not on often

#8 bflorat

bflorat

    Neowinian

  • Joined: 19-January 05

Posted 21 January 2005 - 22:16

Hi again, indeed your files are fixed. Unfortunatly, I can't boot yet. What I did:
Using winimage:
- I opened the usbboot.iso file and I found an isolinux dir.
- I put my MDK 10.1 vmlinuz-2.6.8.1-12mdk-i586-up-1GB from my USB install /boot to isolinux directory
- I put the initrd.img file in the isolinux directory as well
- I edited initrd.cfg file :
*********************
default linux
timeout 0
label linux
kernel vmlinuz-2.6.8.1-12mdk-i586-up-1GB
append initrd=initrd.img root=/dev/sda1
*********************
- I burned the image and tried to boot : my bios can't boot it. I have none message.

Questions:
- Do I have to leave "vmlinuz' in initrd.cfg file?
- Is it realated with lilo.conf of USB drive ?
- I have 2 installs : one one sda1 and another one sda3. Should it work I have set root=/dev/sda3 in initrd.cfg ?

thanks again.

#9 OP zachman123

zachman123

    Remix.

  • Joined: 02-October 03
  • Location: A² MI

Posted 22 January 2005 - 04:57

You mean the CD won't boot? Make sure winimage is keeping it as a bootable CD, to test that try burning my exact iso just to see if that'll boot.

And I assume you mean isolinux.cfg, everything in there looks fine. root just needs to point to the root partition of your linux install...

#10 bflorat

bflorat

    Neowinian

  • Joined: 19-January 05

Posted 22 January 2005 - 10:32

Yes, it won't boot at all, I just have the BIOS message 'Boot from CD:', the CD is read for 5 secs and then, nothing...

I tried to brun the usbboot.iso : it boots and tell me it can't find the vmlinuz kernel (normal). So it should be your initrd.img that freeze the boot? I use an external USB CD Reader.

Questions:
- Do I have to set kernel to kernel (link) or the full kernel name ?
- Why don't your provide a full iso pour sda1 with provided kernel ?

Thanks.

#11 OP zachman123

zachman123

    Remix.

  • Joined: 02-October 03
  • Location: A² MI

Posted 22 January 2005 - 16:02

Yea, it must be your editing of the iso messing up it's burnable-ness.

I'll put them together and test it and post it, I'll put it up in a few min.

Edited by zachman123, 22 January 2005 - 16:37.


#12 OP zachman123

zachman123

    Remix.

  • Joined: 02-October 03
  • Location: A² MI

Posted 22 January 2005 - 17:29

Yea, it must be your editing of the iso messing up it's burnable-ness.

I'll put them together and test it and post it, I'll put it up in a few min.

Neowin wouldn't upload it (it's 9 megs), and my website has (very) limited bandwidth so I can't upload it there.
Can anyone host it if I email it to them? Or if you want the file just email me (zachman123@gmail.com)

#13 bflorat

bflorat

    Neowinian

  • Joined: 19-January 05

Posted 22 January 2005 - 17:56

Nervermind, I finally found another solution:

Book your MDK using your rescue disk (F1, then 'rescue').
mkdir sda1
mount /dev/sda1 sda1
chroot sda1

then, use the mkrescue command:
mkrescue --iso

that will geenrate a rescue.iso file.
Burn this image, boot on USB CDROM, that's all. It works for me for sda3.

#14 OP zachman123

zachman123

    Remix.

  • Joined: 02-October 03
  • Location: A² MI

Posted 24 January 2005 - 20:12

Oh yea, that would work too :D
Forgot mkrescue would take any modifications you made to the rescue system. Much easier, thanx for the tip. Some distros might not support something like that, so if you're trying some odd system, my instructions should help.

All that time I wasted... Nice solution tho, I was to lazy to make my own firewire initrd with my method, but I think I'll try it with yours.

#15 manouchk

manouchk

    Neowinian

  • Joined: 02-March 05
  • Location: Rio de Janeiro

Posted 02 March 2005 - 18:21

Oh yea, that would work too :D
Forgot mkrescue would take any modifications you made to the rescue system.  Much easier, thanx for the tip.  Some distros might not support something like that, so if you're trying some odd system, my instructions should help.

All that time I wasted... Nice solution tho, I was to lazy to make my own firewire initrd with my method, but I think I'll try it with yours.

View Post


It didn't work for me! :no:

I tried the mkrescue --iso script on MDK 10.2beta3 (that I installed on sda1) and booted on the CD but I've only seen L 99 99 99 ... on the screen, nothing more !



Click here to login or here to register to remove this ad, it's free!