Silent, Durable Media For Servers?
Aldurn asks: "Recently, I've come into a living situation where having my rather loud computer continuously running is distinctly suboptimal. In order to maintain my current email address and webserver, in addition to running a decent set of iptables rules for the house, I decided to buy a Mini-ITX-based server. Currently, /dev/hda is running on a CompactFlash card, but I realize that this probably isn't the best thing to do when running a mail server, due to limitations of the media with regards to the number of writes possible over the lifetime of the media. I'm looking to add another storage medium to the device for /var in order to maintain the logs, as well as for mail storage and other bits that like to live in that directory. The media doesn't have to be terribly large (preferably at least 64 MB), and can be connected through IDE, USB, the floppy connector, or through the network. The end goal of this exercise is simply to prevent my poor CF card from dying an early death from continuous writes. What do you suggest for such a situation?"
I'd go for the ramdisk idea. However UPS systems are bulky and potentially noisy, and don't protect you from some unrelated computer crash (e.g.: CPU overheating and the resulting lock-up.
Therefore find some secondary storage medium and schedule a cronjob that rsync's the ramdisk to the permament media. The permament media could be:
* a flash disk, but this time you know that you do the rsync every X minutes, and that the life of the media is Y writes, therefore you'll need to replace the thing every Z years.
* a remote server accessed via SSH
* any kind of local disk -- the tradeoff being the noise of the thing running periodically.
"But actually trying to use m4 as a general-purpose langage would be deeply perverse" --ESR
That's a bad idea. What happens if the system goes down after a message is received, but before the RAM disk has been backed up? The mail will get lost.
Mail servers are required to guarantee the reliability of a message it has accepted responsibility for, even in the event of power failure. In order for that to be possible, the message must be synchronously written to non-volatile storage before the server acknowledges responsibility. So unless the server operator (and any mail domains they are a backup for) doesn't mind losing mail, a RAM disk is not an option.
The end goal of this exercise is simply to prevent my poor CF card from dying an early death from continuous writes.
Don't bother with different media, just use a proper flash file system and don't worry about it. JFFS and JFFS2 are specifically designed for flash file systems, and are purely log-structured, meaning they never erase and rewrite a specific sector, preferring always to write somewhere else in order to level the wear.
To get a rough idea of what the lifetime of you CF card will be, you need to look at how much total data "churn" the card will suffer. Supposing it receives, stores and deletes 10MB of data per day, given a 64 MB CF card, the card will be completely rewritten about every 6.4 days assuming the filesystem job does a perfect job of leveling. It won't, of course, though it will be pretty good. Just to be pessimistic, let's assume that it actually does much worse, and rewrites some part of the chip once per day. That will still give you 273 years of service from your CF card, assuming 100,000 erase cycles (which is the manufacturer's *minimum* guaranteed lifetime -- you'll often see an order of magnitude more cycles before real failures occur).
If you're really paranoid about your e-mail and get a lot of it, replace the card every two years or so (which will likely be after a tiny fraction of a percentage point of the useful lifetime). A 256MB card costs less than $50 right now, and two years from now it'll cost less than dirt.
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
OP:
...)
Better yet - you already have it working with the compactflash setup, yes? It already work, and you already like it. And it works. And you have it working.
Did I already mention that it is working?
If it works and you are happy with it, don't fsck with it. You understand the limitations of the media, so work those into your maintenance cycle. 64M CF cards are cheap, so replace it every year, even every 6 months (or better yet, keep a spare and replace it when it starts to show damage, if there is a way of checking
Oil is pretty good at lubricating a car engine, but it needs to be replaced every 3500 miles.
Batterys are pretty good at storing power so you can start your car, but even they wear out and need to be replaced every couple of years.
CompactFlash is doing exactly what you want, but it needs to be replaced every once in a while - so keep using it, and replace it every once in a while.
I am about -:- that close to replacing the hard drive in an older laptop with a CF solution, I just need to wait for the 1G cards to come down in price a little - or wait for the Win2000 version of 98lite to go live so I can buy it (and fit Win2000 plus apps in under 512M of flash-drive.) The thought of a laptop that is silent, with no moving parts, and totally immune to me flopping it around while it is running (without worrying about gyroscopic effects on the drive) simply thrills me.
Glonoinha the MebiByte Slayer