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


Recommended Posts

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.

usbboot.zip

initrd.zip

Edited by zachman123
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.

585264239[/snapback]

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.

  • 2 weeks later...

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...

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 [email protected]

AIM zachman123

MSN [email protected] **Not on often

YAHOO [email protected] **Not on often

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.

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...

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.

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 ([email protected])

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.

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.

  • 1 month later...
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.

585350512[/snapback]

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 !

Then use my method. Try using my iso files, but if that doesn't work, do it from scratch like I did.

I'm no linux expert by any means, so someone else shouldn't have too much trouble with my steps...

edit: Just saw you're using 10.2beta3 ... Which is a different kernel than my iso. So you'll have to do my method from scratch.

Then use my method.  Try using my iso files, but if that doesn't work, do it from scratch like I did.

I'm no linux expert by any means, so someone else shouldn't have too much trouble with my steps...

edit:  Just saw you're using 10.2beta3 ... Which is a different kernel than my iso.  So you'll have to do my method from scratch.

585559086[/snapback]

in fact I think I'm trying something simpler : installing 10.1 on my USB drive first to test your CD and then I will try MDK10.2!

By the way what was your version of MDK 10.1 it is normal MDK with or without last updates, 10.1 community?

one more question : the mandrake installed on the usb drive shoud or should not have a bootloader installed ?

Edited by manouchk

Doesn't matter if a bootloader is on the drive (I had it on and then deleted it by mistake) as it's not used unless you plan on using the external drive with a computer that DOES support usb booting, in which case you won't need to use the cdrom to boot.

I'm not sure what version of mdk it was (It came with PC Format awhile ago). Anyways if the kernel is different you can see in the iso (Unless I renamed it, might've).

Anyways good luck, and feel free to instant message me if you want.

here is a script to build rapidly a booting CD from scratch :

It worked for me (be prudent it writes important files)

#!/bin/sh

#needs syslinux (tested with version 1.76)

d="CD_boot"

rm -rf $d

mkdir $d

cp /usr/lib/syslinux/isolinux.bin $d

#create initrd for USB boot

mkinitrd --preload=ehci-hcd --preload=usb-storage --preload=scsi_mod --preload=sd_mod /boot/usbinitrd.img `uname -r`

#copy kernel (vmlinuz) and initrd file in isolinux directory

cp /boot/vmlinuz $d

cp /boot/usbinitrd.img $d/initrd.img

#create file isolinux.cfg

#assuming kernel file is in isolinux/vmlinuz

#and initrd in file isolinux/initrd.img

cfg=$d/isolinux.cfg

echo "default linux" > $cfg

echo "timeout 0" >> $cfg

echo "label linux" >> $cfg

echo " kernel vmlinuz" >> $cfg

echo " append initrd=initrd.img root=/dev/sda1" >> $cfg

mkisofs -o boot_USB.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table $d

echo "burn CD :"

echo "cdrecord dev=ATAPI:0,0,0 blank=fast"

echo "cdrecord dev=ATAPI:0,0,0 boot_USB.iso"

  • 3 weeks later...

The question is only stupid if you meant using this EXACT method. Of course you're not going to run Windows using a Mandrake disk or linux bootloader... But running windows/dos is possible. If you feel lazy, check out BartPE (A limited version of windows xp that runs off a cd). You might be able to mess with it to make it use a usb disk.

Making Windows XP run from cd on your own would be very hard. Windows 9x/ME though I've managed to kind-of run, just by fooling around. Simpy use a dos bookdisk on cd along with a USB driver (that's the tricky part though...) and install on the usb disk. Then have fun making a bootloader from dos (load dos, init usb driver, then win.exe)

DOS USB resources... http://www.stefan2000.com/darkehorse/PC/DOS/Drivers/USB/

http://www.freedos.org/freedos/news/newsitem/149.html

Just search

Thanks for your prompt reply. What I am really looking for is a solution similar to your scenario where USB boot is not supported by BIOS and I need to be able to use a bootable CD to do so. As it does seem that LILO can boot DOS/Windows 98, I was guessing it might be possible to do so with an approach similar to yours if my goal is to use a CD to boot DOS/Windows 98 from an external USB HDD. Any suggestion?

  • 2 weeks later...

Didn't think about LILO being able to do that, but it should be possible to at least boot ( I don't know if windows would like it).

edit: that's what I kinda tried, except booted from DOS. Windows started, but in messed resolution and didn't work quite right.

Edited by zachman123
  • 3 weeks later...
here is a script to build rapidly a booting CD from scratch  :

It worked for me (be prudent it writes important files)

#!/bin/sh

#needs syslinux (tested with version 1.76)

d="CD_boot"

rm -rf $d

mkdir $d

cp /usr/lib/syslinux/isolinux.bin $d

#create initrd for USB boot

mkinitrd --preload=ehci-hcd --preload=usb-storage --preload=scsi_mod --preload=sd_mod /boot/usbinitrd.img `uname -r`

#copy kernel (vmlinuz) and initrd file in isolinux directory

cp /boot/vmlinuz $d

cp /boot/usbinitrd.img $d/initrd.img

#create file isolinux.cfg

#assuming kernel file is in isolinux/vmlinuz

#and initrd in file isolinux/initrd.img

cfg=$d/isolinux.cfg

echo "default linux" > $cfg

echo "timeout 0" >> $cfg

echo "label linux" >> $cfg

echo " kernel vmlinuz" >> $cfg

echo " append initrd=initrd.img root=/dev/sda1" >> $cfg

mkisofs -o boot_USB.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table $d

echo "burn CD :"

echo "cdrecord dev=ATAPI:0,0,0 blank=fast"

echo "cdrecord dev=ATAPI:0,0,0 boot_USB.iso"

585568604[/snapback]

Your script is perfect and that is what I have done. I am posting this because my problem is related booting from usb-cdrom. This is what is happening:

I am installing Linux (Suse) from my CD (customized) on IBM blade center (BIOS is capable of booting from usb) in which cdrom is a usb device. What exactly happens is this:

During boot, it says grub loading stage 2......

and then instead of loading the menu.lst , it launches the grub shell. Now when I try to set "root ( <tab>", no cd is listed. The only devices listed are fd0 and hd0 (hard disk already has Suse Linux on it (which was installed using standard Suse CD).

This is the command I used to create ISO

mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \

-boot-load-size 4 -boot-info-table -o grub.iso

What I understand is that GRUB automatically sets the root device to (cd) when booted from a CD-ROM

Is there any option in mkisofs or grub in which we can change the default (cd) to usb-cdrom (whatever alias it has) so that stage2 could be loaded successfully.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I don't hate the new menus, I am not a fan of the lack of features and how they went live when they clearly are not complete. The menu itself presents much better than the previous - but what's lacking (IMO) is: 1) Any kind of automated manipulation such as: "this goes on the new menu because you use this feature more often on this filetype" "this is rarely used and will fall back to the old menu" 2) Any kind of user manipulation such as: "a UI to add/remove/order items to the new menu"
    • The biggest issue in this version of Win 11 context menu, from usability standpoint, is the movable row with basic commands. Think of a car analogy...if You turn the week left the infotainment screen will move right and vice versa. With how it works now Microsoft made something forbidden in designing in any UI, software or hardware. I can't grasp who were the morons within Microsoft suggesting it was a good idea and gave it a green light.
    • LibreOffice 26.2.4 by Razvan Serea LibreOffice is the free power-packed Open Source personal productivity suite for Windows, Macintosh and Linux, that gives you six feature-rich applications for all your document production and data processing needs: Writer, Calc, Impress, Draw, Math and Base. Support and documentation is free from our large, dedicated community of users, contributors and developers. You, too, can also get involved! Choosing Between LibreOffice Still and LibreOffice Fresh: LibreOffice Still is a good choice if you value stability, a longer support cycle, and a more conservative approach to software updates. It's suitable for businesses and organizations where reliability and compatibility are crucial. LibreOffice Fresh is ideal if you're an enthusiast or an early adopter who wants to stay on the cutting edge of LibreOffice development and is willing to accept more frequent updates and occasional minor issues. Features: Writer is the word processor inside LibreOffice. Use it for everything, from dashing off a quick letter to producing an entire book with tables of contents, embedded illustrations, bibliographies and diagrams. The while-you-type auto-completion, auto-formatting and automatic spelling checking make difficult tasks easy (but are easy to disable if you prefer). Writer is powerful enough to tackle desktop publishing tasks such as creating multi-column newsletters and brochures. The only limit is your imagination. Calc tames your numbers and helps with difficult decisions when you're weighing the alternatives. Analyze your data with Calc and then use it to present your final output. Charts and analysis tools help bring transparency to your conclusions. A fully-integrated help system makes easier work of entering complex formulas. Add data from external databases such as SQL or Oracle, then sort and filter them to produce statistical analyses. Use the graphing functions to display large number of 2D and 3D graphics from 13 categories, including line, area, bar, pie, X-Y, and net - with the dozens of variations available, you're sure to find one that suits your project. Impress is the fastest and easiest way to create effective multimedia presentations. Stunning animation and sensational special effects help you convince your audience. Create presentations that look even more professional than the standard presentations you commonly see at work. Get your collegues' and bosses' attention by creating something a little bit different. Draw lets you build diagrams and sketches from scratch. A picture is worth a thousand words, so why not try something simple with box and line diagrams? Or else go further and easily build dynamic 3D illustrations and special effects. It's as simple or as powerful as you want it to be. Base is the database front-end of the LibreOffice suite. With Base, you can seamlessly integrate into your existing database structures. Based on imported and linked tables and queries from MySQL, PostgreSQL or Microsoft Access and many other data sources, you can build powerful databases containing forms, reports, views and queries. Full integration is possible with the in-built HSQL database. Math is a simple equation editor that lets you lay-out and display your mathematical, chemical, electrical or scientific equations quickly in standard written notation. Even the most-complex calculations can be understandable when displayed correctly. E=mc2. LibreOffice also comes configured with a PDF file creator, meaning you can distribute documents that you're sure can be opened and read by users of almost any computing device or operating system. LibreOffice also comes configured with a PDF file creator, meaning you can distribute documents that you're sure can be opened and read by users of almost any computing device or operating system. Download: LibreOffice 64-bit | LibreOffice 32-bit ~300.0 MB (Open Source) View: LibreOffice Website | Screenshot | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Amazon eero Pro 6E mesh Wi-Fi system 2-pack is 27% off by Ivan Jenic The Amazon eero Pro 6E mesh Wi-Fi system is currently $239.99 on Amazon for the 2-pack, down from $329.99. That's 27% off and $90 saved for a solid Wi-Fi solution that covers your entire home (purchase link down below). The 2-pack covers up to 4,000 square feet (372 square meters) and supports 100+ connected devices, which handles the vast majority of home setups without breaking a sweat. Wi-Fi 6E brings access to the 6 GHz band for lower latency across the network, and the 2.5 Gb Ethernet port supports gigabit+ internet plans if your ISP offers them. eero's TrueMesh technology handles traffic routing automatically, so you're not manually managing which devices connect to which node. You set up the entire thing through the eero app, and the entire process takes a few minutes. The system also receives automatic security updates in the background, so once you set it up, you don't have to worry about compatibility issues. If you're covering a larger home or want more nodes, the 3-pack is $329.99 and the 4-pack is $479.98, both at similar discount levels. It's worth mentioning that a newer model exists, which is likely the reason for the discount, but the Pro 6E is still perfectly capable hardware for most homes. Amazon eero Pro 6E mesh Wi-Fi system 2-pack - $239.99 | 27% off on Amazon This Amazon deal is US-specific and not available in other regions unless specified. This is a first-party seller link (at the time of article publishing); ensure that you also purchase from a first-party seller link only. If you don't like it or want to look at more options, check out the previous deals that we have covered, OR you can also visit Amazon US deals page. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
  • Recent Achievements

    • Week One Done
      I2D earned a badge
      Week One Done
    • Week One Done
      Dr Jared Dental Studio earned a badge
      Week One Done
    • Week One Done
      RG INVESTMENT GROUP earned a badge
      Week One Done
    • Very Popular
      The Norwegian Drone Pilot earned a badge
      Very Popular
    • Very Popular
      s0nic69 earned a badge
      Very Popular
  • Popular Contributors

    1. 1
      +primortal
      484
    2. 2
      PsYcHoKiLLa
      258
    3. 3
      Skyfrog
      84
    4. 4
      FloatingFatMan
      64
    5. 5
      Michael Scrip
      63
  • Tell a friend

    Love Neowin? Tell a friend!