SD card unpartitioned space -- used for swap?

Chris Ball cjb at laptop.org
Sun Dec 5 20:04:55 EST 2010


Hi,

   > That's strange, wherever I have used flash memory to serve as
   > boot drive, the kernel/userspace waits for the writes to be
   > complete before powering down. I have not experienced corruption
   > that looks anything similar to what's described. So the software
   > is thinking it has written it but it doesn't?

There are two separate transitions, and you're each talking about
a different one:

(1) From kernel to flash device:
  * This can be waited on as you describe, because the kernel knows
    when its dirty page cache has been written to the device.  "sync"
    and reboot/shutdown all wait on this completing before they return.

(2) From flash device to flash media:
  * The flash device has internal memory that it uses to stage blocks
    to be written to the media.  The kernel can't know when this is
    happening, because it happens internally to the flash device.

We've found instances of flash devices where you need to continue
providing power for two seconds after (1) has finished, such that
(2) can finish before power is lost, else corruption happens.
(Requiring this is in violation of the relevant specs, but that's
hardware for you.)

- Chris.
-- 
Chris Ball   <cjb at laptop.org>
One Laptop Per Child



More information about the Devel mailing list