Thinstation Compact Flash boot HOWTO

By Lars Karlslund, May 2003.


Since compact flash (CF) cards are relatively new media, this Compact Flash HOWTO might be useful for Thinstation users.

Q: What do I need to boot from a CF
A: You'll need:

Q: How do I prepare the CF?
A: Most CF-cards are preformatted with a MS-DOS boot sector and a FAT16 formatted partition. This will do nicely, and you do not need any further preparation.
Should your CF card be totally blank, the easiest way out is to partition and format it under DOS or Windows (FAT16, not FAT32 or NTFS).
If you're running entirely under Linux, instead you'll need to dd a MS-DOS MBR onto the card, partition it with fdisk, and finally mkfs.dos the partition.
Caveats: Not all computers recognize the CF cards as having the same cylinder/heads/sector dimensions. If you're preparing the card under linux, you'll possibly need to go to the advanced part of fdisk and adjust these settings manually if your linux machine and the netstation client hardware do not agree automatically. Under windows98 you can try fdisk /CMBR <IDE CF device number> - e.g. fdisk /CMBR 2.

Q: How do I transfer the files to the CF.
A: Mount the CF card on your linux machine, on which you already prepared the initrd.gz package using build:
mount /dev/hdc1 /mnt/somewhere
Where /dev/hdc1 is the first partition of the master drive on the secondary IDE controller. If you're using an USB-to-CF adapter, it will probably be a SCSI unit (ex. /dev/sda1). The latter /mnt/somewhere is where you'll mount the card, and can be any existing directory.
Copy vmlinuz (the kernel) and initrd.gz (the initial RAM-disk) onto the CF card. Also create a syslinux.cfg file with the following contents:
timeout 0
default vmlinuz
append initrd=initrd.gz load_ramdisk=1 ramdisk_blocksize=4096 root=/dev/ram0 ramdisk_size=13000

Tip: Should you wish to enable console redirection to serial port 0 (COM1) - this makes logging errors and debugging your client easier - you can change it to:
serial 0 115200 timeout 0
default vmlinuz
append console=ttyS0,115200 initrd=initrd.gz load_ramdisk=1 ramdisk_blocksize=4096 root=/dev/ram0 ramdisk_size=13000

Now dismount the card:
umount /mnt/somewhere
Caveats: The "ramdisk_size" parameter should fit around the same size as you initrd.gz file. If you include lots of stuff and drivers, you need this setting as your image gets larger than the default 8MB, which results in an error upon booting.

Q: How do I make the CF bootable?
A: Simple:
syslinux /dev/hdc1
(or whatever your partition on the CF card is called under linux).