• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Booting Linux from Compact Flash; what hardware?

JustMike

Senior member
I want to build a Linux-based router that boots from a solid-state device (like CF or something similar). What is the required hardware (IDE to CF)? Where to get it and most importantly, how much?
 
IDE to CF or whatever should work fine.
This this (.au) and this were the only places I saw mentioned in a quick search of an OpenBSD mailing list. I have no experience with these sites or this type of hardware, so I cannot recommend any of these.
 
The adaptor that plugs straight into the motherboard IDE socket is just too neat. What's the lifespan of a compact flash compared to an IDE drive?
 
Yeah, I'm also interested in field reports. I'm thinking of moving all my home gear to a rack, and this would be a nifty low-power/noise solution for routers and simple network servers being jammed into 1U cases.
 
Just be sure to make any swap space (if you need it, i don't know) and/or logs off of the flash device (probably best place for logs or something in ramdisk or something)

Because flash drives are by their nature self-destructive and wear out after a while...

heres something that is related to what your talking about I don't know if they have flash stuff or anything, but I was pleased by how well their daschstien firewall/router on a floppy worked. So maybe they can give you ideas or something.
 
I highly recommend Pebble Linux for an embedded system. It requires a 64MB flash card though I'd highly recommend a 128 or even larger depending on how much you want to customize the distribution. The author has followed several other websites/papers to get a fully functional read only linux system with a user defined RAMdisk size (default was 5MB, now 10MB). I was using this as a firewall for a month or so but I wanted to play around some with ACID (and Snort) and the flash disk just didn't have enough space for a quickly growing MySQL database. 🙂

Anyway, you need an x86 box of some kind, and possibly an IDE to CF adapter which you can find for $20 or so. Getting an IDE one rather than a USB card reader (which is possible) makes figuring out how to boot from the CF simple. It's just /dev/hdX. I had a few issues getting Grub to install properly and you should have a working linux distro up and running before trying to get Pebble on the CF card.

Compact Flash can be read from near infinitely but it has a limited write lifespan. By putting the logs, user files, /tmp dir, /etc and other dirs in the ramdisk, it lets you edit the configuration (and save it back to the flash disk if you want) on the fly. You can add more dirs and files to the ramdisk by symlinking them.

Pebble Linux is a super stripped down Debian and it does include apt-get though by default it does not store a copy of the apt-get file list. This makes upgrading and customizing the distro very simple for anyone to do. I searched off an on for a couple years for an embedded linux or BSD distro without much success (emBSD, an embedded OpenBSD came closest but last I checked I couldn't find the project anymore) until I found Pebble. It was made originally to be an embedded linux wireless access point but with apt-get it can be anything you want. I started on a Linux from scratch install but Pebble is way smaller than I ever got and the hard work of figuring out which files need write access has already been done for you. If you need a custom kernel, just compile one on a normal linux box and copy over the bzImage and modules to the flash drive.

Gaidin
 
Why aren't these things available in North America? It looks like I'll have to order from Switzerland or Australia...
 
Originally posted by: JustMike
Why aren't these things available in North America? It looks like I'll have to order from Switzerland or Australia...

I saw a few of them (used) on ebay (search for cf and ide), but thats ebay so YMMV (or carpe diem).
 
Early types of flash memory had a MTBF of 10,000 writes per sector. Newer ones are 100,000 to 1 million. Note that the size of a sector changes among flash types and I have no idea how big it is in compact flash (or whether it can vary among cards). In order to change a single bit, you must rewrite the entire sector.

In order for a flash that will fail at 1 million writes to last for 5 years, you shouldn't write to it more then every 3 minutes.
 
I would think that once the OS is setup and configured, it should remain relatively static on the CF card. Of course, I have never done this before, so maybe I'll shorten the lifetime of a CF card during experimentation 🙂
 
Originally posted by: JustMike
I would think that once the OS is setup and configured, it should remain relatively static on the CF card. Of course, I have never done this before, so maybe I'll shorten the lifetime of a CF card during experimentation 🙂

Now that I've thought of it, this whole thing sounds like what I've done to my zaurus, which is to set it up like a full size linux box. I haven't had any problem with any cards yet, and AKAIK you probably won't either (unless you create a swap file on the card).
 
Try here or here or here. 🙂 All are in the US and are $17-$24. The types vary slightly (ie floppy power connector vs. normal hard drive power or right angle power) but all should accomplish what you want. froogle.google.com is your friend. 🙂

Gaidin
 
Back
Top