[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

My method for booting from USB, non-partitioned



For interest and discussion, the following is my method for booting
a debian-live image from a USB memory stick, without using a
partition.  Hopefully it will be useful to somebody, or even better,
people will suggest to me ways to do this better.

I created a debian live image using the methods outlined in the manual
and FAQ.  I added several custimizations, such as an encrypted home
directory, custimized xorg.conf for some hardware (autodetected for
others), and updated clamav signatures.  I'd like to discuss those at
other times, but I'll do that in other posts.

Anway, I created the live image with the ISO option.
I formatted my USB drive normally---with a single FAT32 partition.
I then installed grub (I also tried grub2, and they both work) to the
USB drive.  The grub related files live in /boot on the usb drive.
I copied the contents of binary/live to /live on the USB drive.
I copied binary/boot/grub/menu.lst to /boot/grub/ on the USB drive.

The relevant lines will be something like

title           Debian GNU/Linux - live
kernel          /live/vmlinuz-2.6.26-2-686 boot=live union=aufs persistent nofastboot
initrd          /live/initrd.img-2.6.26-2-686

or

menuentry "Debian GNU/Linux - live" {
        linux   /live/vmlinuz-2.6.26-2-686 boot=live union=aufs persistent nofastboot
        initrd  /live/initrd.img-2.6.26-2-686
}

I use persistent so the USB drive itself is mounted read write, and
nofastboot because my encrypted home "drive" is ext2.  I generally
rebuild the live image to make changes to root, so even though root is
persistent, I don't really use it that way, because I just overwrite
filesystem.squashfs with new versions.

So, a computer which boots from a USB memory key (most modern ones)
will load grub, which if configured correctly will load the kernel
from /live/vmlinuz... initrd from /live/initrd.img... which will then
figure out to mount root from /live/filesystem.squashfs on the USB key.



Reply to: