I have just re-installed my Debian MythTV server now that I have bought it bigger disks. In fact, with two new 1TB (ie approx 1000 Gigs) disks, I have put them together as a RAID1 pair and use this box to act as my new Home Internet Gateway.
I wanted to use Debian Squeeze because it will soon (sic) become Debian Stable and it is the first distribution that supports the Ext-4 filesystem that I feel is necessary for this important set of files.
However, I do not have a CD-ROM drive on this machine, so this is the story of installing Debian Squeeze using just just usb memory. With the easy and availability of USB to SD card converters, it does not matter whether you use a memory stick or an SD card – the process can be the same.
I have also decided to use extlinux as the boot loader. I have simple boot requirements, and feel nervous that using Grub (the Debian standard) means the use of a program to create the configuration file. What happens when I need to do something manual.
This blog entry does two things.
- It describes how to turn a bootable usb memory stick into an installation disk
- How to setup extlinux as the bootloader
Creating a USB installation memory stick
The first job is to prepare the USB memory stick (or SD card). The majority will already be formatted so that they have a boot sector that is bootable, with a single partition, formatted as FAT. If they are not, its straight forward under Linux to format them yourselves. I tend to use cfdisk as my disk partitioning program because I find it easier to use, but it doesn’t matter which. Just mark the first partition bootable, and then format it using the command
mkfs -t vfat /dev/sdX1
where /dev/sdX is the device name of your usb stick when plugged in. You can also use
directly if your prefer (I never remember the second, so always use the first). mkdosfs is found in the dosfstools Debian package.
The second step is to locate and download the latest installer images. The Debian installer consist of a kernel image and and initrd image. The kernel is obvious, what is less clear is that the initrd image is the software the controls the install process. Start by navigating to http://www.debian.org/devel/debian-installer/ and looking for the different architecture images listed under the heading “other images (netboot, USB stick, etc)” (at the time of writing the squeeze alpha images are available as are the daily build images – I have used the daily builds without problems)
Regardless of which one of these two you choose you will then need to go down one further level into directory “hd-media”. In there you will find a vmlinuz image (the linux kernel) and an initrd.gz file listed. Download both of them.
You will also need an .iso image as when the installer starts it looks at all the possible partitions for a .iso image in the root. Obviously having it in the same root as the installer is the ideal here. If you have sufficient space to store a full CD image (approx 700Mb) this would be the ideal image to download, if not you will have to choose one of the smaller images (netinst or business card). I found I needed the full CD image to support my ethernet hardware so you may be forced to go for the large image anyway.
You can get the CD images from the same installer page – but then select the weekly snapshot CD image for your architecture as the one to download. Download CD1 – you don’t need any of the others.
Copy all three files (vmlinuz, initrd.gz and the .iso to the usb drive once it has been mounted.
You are also going to put syslinux on the usb, however for now just create a file syslinux.cfg in the root of the partition with the following contents
which will tell syslinux to boot the vmlinuz image with initrd=initrd.gz appended to the command line.
Finally unmount the usb stick and then type
to put syslinux image on the partition’s boot sector.
You should now have an installation usb 🙂