* * This text describes the rough procedure I used to create * the small footprint linux installation from a larger * fedora installation. * * I started with a flash based IDE-HD-compatible disk prepared with a DSL (Damn Small Linux) installation. I then wiped the whole disk, just leaving the disk formated for Linux. (So, if you have such a disk, just format it with EXT3, in one large partition...) NOTE! The flash disk is identified with /dev/hdc I mounted the disk as /mnt/flashIDE1/ in my current file tree. mount /dev/hdc1 /mnt/flashIDE1 Then I created a boot directory: mkdir /mnt/flashIDE1/boot The next step is to create the boot-loader, I used GRUB like this: grub-install --root-directory=/mnt/flashIDE1/ /dev/hdc Then I copied the grub-configuration from my current installation: cp /boot/grub/grub.conf /mnt/flashIDE1/boot/grub/ The modifications I made are specific for my setup, see the part about configuration in the grub documentation. (info grub) then I copied the kernel and initrd from /boot to /mnt/flashIDE1/boot/ (feel free to use your own kernel...) filesystem population: cp -r /dev /mnt/flashIDE1/ mkdir /mnt/flashIDE1/lib mkdir /mnt/flashIDE1/lib/modules cp -r /lib/modules/ /mnt/flashIDE1/lib/modules/ cp -r /etc /mnt/flashIDE1/ mkdir /mnt/flashIDE1/tmp cp -r /dev /mnt/flashIDE1/ mkdir /mnt/flashIDE1/proc mkdir /mnt/flashIDE1/sys cd /mnt/flashIDE1/ # below I will create symlinks for /root and /var mkdir /tmp/root # yes, /tmp/root and not /mnt/flashIDE1/tmp/root.. mkdir /tmp/var ln -s /tmp/root root ln -s /tmp/var var From here I decided to try busybox to populate the most common binaries and here I discovered that busybox comes with it's own init. So I will use that instead of SysVinit. So you have to create your own inittab file in /mnt/flashIDE1/etc/ according to the busybox documentation. (man busybox) It is possible that you have to modify the initrd, I found some good examples on this in a document called "Booting Linux off of a USB drive", by Simon Illyushchenko. The essential parts for me where: (to unpack initrd to a directory) cp initrd /tmp/initrd.gz cd /tmp/ ; gunzip initrd.gz mkdir a; cd a; cpio -i < /tmp/initrd from here you can modify /tmp/a/init for example (which in my case was a sh-script). To create your custom initrd-image: cd /tmp/a find . | cpio -c -o | gzip -9 > /tmp/myinitrd the myinitrd-file can then be moved into /mnt/flashIDE1/boot/ Then, what you have left is to copy all other necesarry binaries and libraries and then I recomend that you create a rcS-script that you call from busybox-init the rcS-script will take care of stuff like loading modules, mounting /tmp /proc and /sys. Also, since I created symlinks for /var and /root, the corresponding directories must be created in /tmp, and this is also idealy done in the rcS-script. And if you want to start your network interfaces, do it here to. Copying binaries and libraries: use strip on everything, and when you copy libraries, remember: copy the REAL library file, and re-create the necessary symlinks... (for libld.so: remember, libld needs the files /etc/ld.so.conf and ld.so.cache and ld.so.conf.d/* ) for bash (for example): mkdir /tmp/tmp_binNlib ldd `which bash` # this tells you which libraries you need. # ldd returns, amongst others, /lib/libtermcap.so.2 ls -l /lib/libtermcap.so.2 # reports it as a symlink to libtermcap.so.2.0.8 cp /lib/libtermcap.so.2.0.8 /tmp/tmp_binNlib cd /tmp/tmp_binNlib strip libtermcap.so.2.0.8 mv libtermcap.so.2.0.8 /mnt/flashIDE1/lib cd /mnt/flashIDE1/lib ln -s libtermcap.so.2.0.8 libtermcap.so.2 # after you've copied all necessary binaries like above cp /sbin/bash /tmp/tmp_binNlib cd /tmp/tmp_binNlib strip bash mv bash /mnt/flashIDE1/bin/