what should i do? using DOM and CF's problem
ganganwen at hotmail.com
Sun Oct 9 23:53:21 EDT 2005
I want to use DOM or CF in a ATM-like machine. In this machine I have to
record after each exchange, and there is no UPS, so sudden Power loss must
be accepted. I don't select DOC for its high price, not using harddisk for
its high heat and easy damage.
There is a article talking about the DOM,CF & DOC. And from this article
there is no safe way to use a DOM,CF even DOC under such environment. what
should I do?
here is the article:http://www.koansoftware.com/en/art.php?art=40
Linux DiskOnChip, DiskOnModule, Compact Flash
Note that DOC (DiskOnChip) adn DOM (DiskOnModule) are completely different
A DOM device is interface compatible with a standard IDE drive, the
software can't tell the difference, so consequently, you don't need any
special boot sector or driver for it, the normal IDE driver and boot
techniques will do. They do have some problems which I have tried to
summarize in another posting in this thread.
A a DOC is basically a bank-switched flash memory device that comes with a
tricky boot firmware preinstalled which replaces the BIOS's handlers for
disk access calls. So the device *appears* as an IDE drive, but only as
long as all accesses go through the BIOS. Since Linux does not use the
BIOS, using a DOC requires a special device driver (which has been
available for quite some time under "MTD Devices".
There are two things to consider when running a Linux system off a DOM, DOC
or a CF
These devices use flash memory as their storage media. You can write to
each block of flash memory only so many times (typically in the range of
ten thousand to hundred thousand times). They do presumably implement some
kind ow wear levelling internally (transparently distribute write accesses
evenly over all available flash blocks) which improves things,
but nevertheless, if the Linux system keeps writing data to files, such a
device can be worn out in a matter of weeks. To deal with this, the system
should avoid write accesses where possible (best is to mount it read only,
if not possible, at least use the "-noatime" mount option).
Sudden power loss
These devices are made to replace IDE disks, so they have apparently copied
some of the problems of rotating had disk as well: It appears that, if
power is lost while a write access was in progress, such a device can be
seriously damaged. This has never been officialy acknowledged nor denied by
any manufacturer as far as I am aware, but I have read numerous reports
from credible people who have seen it happen. Some said that the device was
damaged completely in the process, others said they were able to bring it
back to life by doing a low-level format. In any case, all data on the
device was lost.
If a sudden loss of power is an even remote possiblity for your
application, the only way to safely use a DOM or CF is to keep it mounted
read-only, and even if a power failure can be ruled out, there are still
good reasons to keep it like that.
Neither a DOM or CF formatted with JFFS2 won't help for several reasons:
1. No read/write filesystem (neither JFFS* nor any other) can prevent a
situation where a power failure happens while a write access is pending.
2. In order to do proper wear-levelling, JFFS needs to know the underlying
media's block structure. But this information is invisible at the IDE
interface. It may even vary across different CF makes/models.
StrataFlash is just plain flash memory and it makes sense
to use JFFS2 on Strataflash, because such a configuration should be
resilient to power failures.
与联机的朋友进行交流，请使用 MSN Messenger: http://messenger.msn.com/cn
More information about the linux-mtd