[NTLUG:Discuss] Installing Linux on USB Disks?

Chris Albertson alb at chrisalbertson.com
Tue Mar 20 10:42:58 CDT 2007


Stan,

I've just gone through an exercise of getting Debian to install on a 
Compact Flash card, so I could run it on an embedded device. (Single 
Board PC) I'm in the process of writing up how I got it to work. When I 
finish, I can get you a copy if you'd like. I think it might help answer 
some of these questions.
The first thing that's going to be a deal breaker or maker for you is if 
your bios can boot to the USB drive. If you don't get that option, 
you're going to be out of luck before you even get started.
If you can boot from USB in bios, then it's really just a problem of 
getting the image onto the USB drive. I don't use grub, so I can't speak 
too much to that. I use lilo.
Here is pretty much the steps I took to get debian on a CF card:

   1. Build base filesystem to a local directory (Using debootstrap)
   2. Prepare CF Card for the goods (Partition,make partition bootable,
      mkfs.ext2)
   3. Copy the base filesystem into the CF card
   4. Mount --bind proc, sys, and dev into the CF card
   5. CHROOT into the CF card
   6. Install the Kernel Image (apt-get install kernel-image-2.6.x.x.x)
   7. Alter fstab, network, hostname, resolv.conf files (Root in your
      fstab would probably point to /dev/sda1 since it's a usb mass
      storage device)
   8. Put LILO into the MBR of the card  (You could just use grub here
      if you're comfortable with that)
   9. exit chroot
  10. Unmount proc, sys and dev from the flash card
  11. unmount the card
  12. Finished

As I said, I'm in the process of detailing all these steps so they make 
more sense...

I know the USB boot drive is becoming a popular item now. You "may" be 
able to google this subject and find some pre-built images that you can 
just burn onto the USB drive. I could not find anything that met my 
needs/desires, so I had to build from scratch.

Chris

Stan Gatchel wrote:
> I found this interesting article about preloading Linux on USB disks. I
> was just wondering, if I bought a blank USB disk and tried to install
> Linux, would it work? Has anyone done this? Does it show in Grub? What
> happens when the disk is unmounted? What happens if you mount it on a
> different machine? What hardware similarities are required for it to run?
>
> Maybe this is a way to test new distributions.. just partition a USB
> disk? Can it be that easy?  ;-)
>
> http://people.ofset.org/~ckhung/a/c073.en.php
>
> Thanks,
>
> Stan
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>   



More information about the Discuss mailing list