I guess I'll stop beating around the bush and post what I've got for the install steps so far. Use at your own risk, your devices may use different hardware names and the like. But here's the command by command blow of how I setup my current 32gb PNY stick with debian sid linux. Based in part on the debian guide linked to in earlier posts. Additional notes to follow, these steps only get you a basic bootable usb linux. You can do a lot of extra install stuff before you do any writes to the usb device. Plus a variety of administrative stuff not listed in this post. Like setting up a user account.
##### Prepare to use ar and debootstrap to build our base installation #####
Code: Select all
$ mkdir work
$ mkdir install
$ cd work
$ wget -c http://cdimage.debian.org/debian-cd/6.0.6/i386/iso-cd/debian-6.0.6-i386-netinst.iso
$ su
# mkdir /mnt/loop
# mount -o loop debian-6.0.6-i386-netinst.iso /mnt/loop
# exit
$ cp -v /mnt/loop/pool/main/d/debootstrap/debootstrap-udeb_1.0.26+squeeze1_all.udeb .
$ su
# umount /mnt/loop
# apt-get install binutils debootstrap
# exit
In my case I used the home directory of my current debian based linux to build the installation.
##### Make and prepare our new installation #####
Code: Select all
$ ar -x debootstrap-udeb_1.0.26+squeeze1_all.udeb
$ cd ../install
$ su
# tar -xzvpf ../work/data.tar.gz
# /usr/sbin/debootstrap --arch i386 squeeze /home/user/install http://ftp.us.debian.org/debian
# cp /etc/fstab /home/user/install/etc/
# nano ./etc/apt/sources.list
And I opted to upgrade to sid from squeeze right out the gate.
##### Chroot into our new installation #####
Code: Select all
# mount -t proc none /home/user/install/proc
# mount --rbind /dev /home/user/install/dev
# LANG=C chroot /home/user/install /bin/bash
# apt-get update
# apt-get install binutils debootstrap dselect
# dpkg --clear-avail
# dselect
# apt-get install linux-image-686
# passwd
Don't forget to set the password for root or it might be hard to use your new installation.
(additional administrative things here)
##### Exit the chroot and make a snapshot of this installation #####
Code: Select all
# exit
# umount /home/user/install/dev/pts
# umount /home/user/install/dev
# umount /home/user/install/proc
# tar -cvpf ../work/snapshot_i386_YYYYMMDD.tar ./*
##### Prepare the USB medium to receive this installation #####
Code: Select all
# cat /proc/partitions
# cfdisk /dev/sdg
# partprobe /dev/sdg
# mkfs.ext2 -L pny32gb -U ba55c1ef-0b0e-c0da-5010-5ca1ed121234 /dev/sdg2
# mount /dev/sdg2 /mnt/somelocation
# cd /mnt/somelocation
# tar -xvpf /home/user/work/snapshot_i386_YYYYMMDD.tar
# nano /mnt/somelocation/etc/fstab
# cd /home/user
# umount /mnt/somelocation
The initial cat to identify what your usb device is actually named. If you cat /proc/partitions before you insert it, and after the difference is the new device. (in theory). You may want to do any write / read tests on the new device first to make sure you didn't get a dud.
##### Adjust a bootloader to boot this new bootable installation of linux #####
Code: Select all
# nano /etc/grub/40_custom
# update-grub
In my case I'm using my existing bootloader to boot the usb device first. And I installed grub to the distro, but not the hardware before making the tarball.
##### If all went well we're running the new install #####
Code: Select all
# cat /proc/partitions
# mount
# grub-install --force /dev/sdc
# update-grub
The MBR region of these things seems excessively small. So we have to force it, and I made two partitions, the first one is never used, and just there to allow extra overwrite space. Which may or may not actually be needed. In either case I have to --force it, or it never actually writes to the device. The device name of course changed when it was booted.
##### Boot the USB linux from it's own bootloader #####
If all went well you'll have a linux install that you can boot from any x86 device that can boot USB (assuming i386 or better). Or boot a cd version of grub to use to boot the usb device. This works for me anyway. Although my current laptop requires the CD to boot the USB stick. My main desktop uses the ESC key to get to the boot usb option. Another desktop uses F10, and yet another uses F12. So not without a few quirks.
If speed and responsiveness is of concern you might want to use a c6 or better flash card and a reader. My 32gb PNY is my newest and highest capacity stick and by far the slowest stick. But it's cute. Running it and web browsing has a lot of delays while the browser cache's content.