Developments

Debian Squeeze on a usb drive

Subscribe to RSS feed

Setting the inode size on your build machine to allow for grub install on USB chroot install of Debian Squeeze

, , , ...

So. What I have been working on is to get a full working installation (NOT a LIVE Version) of Debian Squeeze on a USB drive (1GB since we dont need X or Desktop features) to allow for use of this install as a rescue system to allow for booting into failed systems using this USB drive. This allows for chroot into your failed system, maintenance tasks to be performed on the failed system to bring it back to bootable state, and also, since USB is the boot medium, this allows for cd burning for backups to cd/dvd using cdrecord on command line. All things considered, a very fast and portable rescue system.

Our first task is to create a minimal install onto the USB medium, using the latest installer image. While this is possible by booting up the standard Netinstall CD and telling the partitioner to make USB bootable, create a primary partition on it, and then installing the base system to the USB..This takes hours to accomplish and is not a very efficient way of doing things. Also, it's not the official Debian way to do things.

Ok. So if we treat this as what it really is, a basic Debian Install, then things get a little less complicated.
Going to the Debian Installer homepage gets us to the information on installing from an existing Debian system. This is the debootstrap way of doing things and takes about 10-15 minutes to get the system imaged to your USB drive. See this page:
http://www.debian.org/releases/stable/amd64/apds03.html.en
for instructions on how to get the base system installed.
Now.. a few points of interest here. While there are skeleton files on the internet and even on this site for things like your /etc/fstab or /etc/hosts, it is far easier to copy them from your system into the chrooted environment and modify them to fit your new system. Faster too.
NOTE: The debian mke2fs creates a file system with 256 inodes. For grub to be able to read the partition for install of boot loader, we need 128 inodes. So, just edit your /etc/mke2fs.conf and adjust the default inodes element.
Easy, right? Ok, so follow instructions from the site after that and you end up with a lean system, but it works.
NOTE: Since you are in the chroot envirionment, and have networking capabilities, go ahead and apt-get your way into your needed firmware for things like wireless or any exotic hardware that you may have. Also, if you expect to be able to boot onto a laptop its a very good idea to go ahead and install the laptop packages. This can be done by issuing tasksel install laptop from inside your chroot environment.
Enjoy!




June 2012
S M T W T F S
May 2012July 2012
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30