2

To build a compact, headless host, I'd like to use a CompactFlash instead of an IDE drive, and connect the card to the mobo using an IDE-to-CF adapter.

I don't know if this is still an issue, but flash memory only supports so many write operations, so a solution is to mount eg. /tmp and /var in RAM and only write /var from RAM to the card every so often, so as to reduce the number of write operations.

I was wondering if there are good, compact, actively-developped Linux distros that are built from the start to be used with a CF card instead of an HD.

Thank you.

3
  • 1
    If you have plenty of RAM you might also want to turn off swap as well
    – Col
    Sep 23, 2009 at 9:27
  • You could also just buy a small IDE or SATA SSD drive that you know has modern wear-leveling technology built-in and toss the IDE-to-CF adapter. If you use an SSD with good wear-leveling, you shouldn't care much about typical OS disk writes. Sep 24, 2009 at 0:56
  • Thanks for the feedback. I'll just get an SSD then and use some compact Linux distro. Sep 24, 2009 at 10:33

8 Answers 8

2

Most distributions can be easily tweaked to function this way. I've done the following on my netbook (running Ubuntu 9.04):

  • mount /tmp as a tmpfs (RAM based) filesystem
  • mount /var/tmp as tmpfs too
  • mount ~/.mozilla/firefox as tmpfs and copy the real content (kept in ~/.mozilla/firefox.ssd) to it, rsyncing back to ~/.mozilla/firefox.ssd every now and then (and explicitly in the shutdown scripts). This makes a big difference as FFs writing to the URL classifier DB and its cache is very noticable on the slow SSD.
  • remove all swap (the machine only has 8Gb of fixed storage and 1.5Gb of RAM, so there is little need for swap and having the extra free drive space it more important and having enough swap around to enable suspend-to-disk is definitely not an option!)

Things I plan to do, but haven't got around to yet:

  • mounting /var/log as tmpfs, but syncing regularly with an on-disk copy, like I do my main user account's FF profile. Other parts of /var may benefit from this too, or maybe the whole of /var, but there is only a fixed amount of RAM to go around in this machine

I don't know of any distributions specifically set to do this sort of thing by default (though there are several designed to run entirely from RAM, but this is probably not suitable for what you are looking to do).

Be careful when mounting /tmp as a tmpfs filesystem to make sure you know how much space your apps are going to use there. For instance if you run VMWare VMs with certain options they will create large files there as RAM backing store (and for suspending to) - see this page for more info on that. Also make sure no badly designed/configured apps/scripts assume that the content of /tmp survives a reboot.

With modern flash drives you don't have to worry about the number of writes so much in terms of drive life-span. The combination of improved "expected write cycles before failure" per cell and the wear-levelling algorithms used means this is a much smaller concern than it once was - you have to be running some very IO intensive operations for a long period of time before it becomes a major issue. The main reason to keep things in RAM on a flash based system is to work around poor write performance (especially with many small writes) rather than to extend drive life.

1
  • +1, Very good notes. I have been considering a PuppyLinux kind a variation for Ubuntu too.
    – nik
    Sep 24, 2009 at 7:37
1

You can install Voyage Linux. This is a Debian based distro optimized to run in a Compact Flash and others embedded platforms.

0

There are several Linux distros that can be run from Live CDs (i.e formats that require no writes at all to the source media)

Ubuntu has one. (It's installer is actually a live CD), and if you look on their site there is instructions for making your own customised live CD/USB stick. (Check out LiveCDCustomisation, LiveCd and HowToCustomiseUbuntuLiveCds)

Knoppix is specifically built as a Live CD Linux distro.

Either of these would probably suit you fine.

0

You might be interested in PuppyLinux that is designed to work off the RAM (with ramdisks).
I have successfully installed PuppyLinux on a CF to boot through my laptop PCMCIA adapter.

0

Besides a ramdisk based PuppyLinux solution,
You could get Disk-on-Module packages (MagicRam for example)
and use these either with PuppyLinux or straight with Ubuntu installations.

You can also get CF IDE adapters (or SCSI ones) and plug a good CF on them for the same purpose.
Another article from ThinkWiki on CF Boot drives (good notes).

0

You might also be interested in slax which is perfect for just such a setup.

0

DamnSmallLinux can be set up to boot from CF--in fact at one point they were selling CF cards with DSL pre-loaded.

I've seen OpenBSD installs (great low-power router) but they required tweaking.

0

I have a home router running Slackware on top of an 4GB CF card via a IDE-CF adapter.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .