Running Linux from DiskOnModule?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,

I have a PC/104 board that I'm working to get Linux running on.  Are there
any special considerations for installing onto a DiskOnModule or any other
type of flash?  From Linux's point of view it looks just like an IDE drive.
Is it necessary to run Linux out of a ram disk?  Or are access times fast
enough that I can run directly from the DiskOnModule?

Thanks!
Mark



Re: Running Linux from DiskOnModule?
Quoted text here. Click to load it


(DiskOnModule is basically a CompactFlash with a different form factor.)

There are two things to consider when running a Linux System off
a DOM or a CF:

1. Wear

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).

2. 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.

In summary: 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.

Rob

--
Robert Kaiser                     email: rkaiser AT sysgo DOT com
SYSGO AG                          http://www.elinos.com
We've slightly trimmed the long signature. Click to see the full one.
Re: Running Linux from DiskOnModule?
Quoted text here. Click to load it

I do not know if I am credible :-) but I have experienced this myself
whey testing CFs from several makes by cycling power when performing
intensive write. One card was fully damaged whereas the others had
varying degrees of problems varying from recoverable with fsck to
recoverable only by mkfs'ing the partition.

Regards.

Elder.


Re: Running Linux from DiskOnModule?
Quoted text here. Click to load it

And what about a DOM or CF formatted with JFFS2 ?
What about StrataFlash ?
Could they have the same bweird behavoir ?

--Helix



Re: Running Linux from DiskOnModule?
Quoted text here. Click to load it

That 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.

Quoted text here. Click to load it

AFAIK, StrataFlash is just plain flash memory. Yes, it makes sense
to use JFFS2 on Strataflash, and yes, such a configuration should be
resilient to power failures.

Rob

--
Robert Kaiser                     email: rkaiser AT sysgo DOT com
SYSGO AG                          http://www.elinos.com
We've slightly trimmed the long signature. Click to see the full one.
Re: Running Linux from DiskOnModule?
Quoted text here. Click to load it

What's wrong with using a large capacitor (GoldCap??) to allow the write to
finish? If you tie the CF reset line to a power fail detector, the CF should
finish any pending writes safely. Use a 5V cap, a switching buck controller
to 3.3V and calculate the worst case time needed to finish a sector write.

Rob



Re: Running Linux from DiskOnModule?
Quoted text here. Click to load it

That might well do the trick. There have been rumors in this NG that
some special CF devices are available now with a GoldCap integrated
for exactly this purpose. I would like to see a confirmation from
someone who successfully used such a thing (make/model?).

Anyone?

Rob

--
Robert Kaiser                     email: rkaiser AT sysgo DOT com
SYSGO AG                          http://www.elinos.com
We've slightly trimmed the long signature. Click to see the full one.
Re: Running Linux from DiskOnModule?
Quoted text here. Click to load it

That might be difficult, as the flash cards might use internal RAM
sector buffers and they might do a lot of internal shifting, when they
find a wear out condition on a sector that is to be written. I suppose
there are no specs available about the worst case "access to writing
done" time.

-Michael

Re: Running Linux from DiskOnModule?
On Fri, 23 Jan 2004 10:02:31 -0700, "Mark"

Quoted text here. Click to load it

I think you can get the correct drivers and boot sector for the DoM
drive. I have seen them for DoC. Anybody know where to find them?

Bob McConnell
N2SPP


Re: Running Linux from DiskOnModule?
Quoted text here. Click to load it

Note that DOC (DiskOnChip) adn DOM (DiskOnModule) are completely
different beasts:

- 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 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". For more info, look at the Linux MTD
  project at www.infradead.org.

Rob

--
Robert Kaiser                     email: rkaiser AT sysgo DOT com
SYSGO AG                          http://www.elinos.com
We've slightly trimmed the long signature. Click to see the full one.
Re: Running Linux from DiskOnModule?
Quoted text here. Click to load it
drive.

Hi guys, thanks for all the info!

Mark



Site Timeline