Sign in with
Sign up | Sign in

Booting From Compact Flash

How To: Building an Embedded Asterisk PBX
By

Unlike hard drives, there are very real limits to how many read/write cycles a compact flash (CF) card can survive. If the system was to treat the CF card just like a hard drive, then the CF card would fail in an unacceptably short period of time. On the Asterisk Users Mailing List, I found users whose experience was that the point of failure can be as low as 300,000 writes, even when using high quality, brand name CF cards.

Astlinux has been designed to get around this issue through use of a RAM disk and by limiting write access to the CF card. At boot time the contents of the CF card are copied to a RAM disk, which is then used to boot the OS, services and applications. The CF is still mounted by the OS, but in read-only mode. Symbolic links are used to provide pointers on the RAM disk to critical config files on the CF card, and all disk writes happen to/from the RAM disk. This approach extends the service life of the CF card by several orders of magnitude.

Here's my experience. My initial Astlinux test system used an old generic 128 MB CF card once used in a long dead digital camera. That card was in service for more than a year without any problems at all. For my new Soekris based production Astlinux system I purchased a new 32 MB Sandisk CF card for a mere $8 on eBay. Kristian recommends Sandisk cards, as he has found them to be the most reliable.

Figure 3: Windows installer writing the Astlinux boot image to a CF card

Since I'm no Linux wizard I needed to load the CF card with the boot image using my Windows XP desktop. The Windows installer for Astlinux includes a utility called "physdiskwrite" for loading the CF card on any PC with a suitable media reader. Writing Astlinux to the CF card was easy (Figure 3) and took less than 2 minutes.

React To This Article