D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Ensuring data is on disk

 

On Sat, 10 Jul 2010 21:01:32 +0100
Simon Waters <simon@xxxxxxxxxxxxxx> wrote:

> Curiosity driven question.
> 
> If I write data to my external hard disk, how can I ensure that a read
> to verify that data isn't using a cache?

Check the source code of the mount/umount command and the shutdown
command - the only sure way is to persuade the device that the rest of
the system is about to poweroff, at which point it would be too late for
the device to clear the cache, therefore you pretend to tell the device
that the next operation (at assembly code level) will be to pull the
power and the device has to do everything necessary before the
operation returns.

We do the same with various systems and chipsets, whatever filesystem
and whatever the kernel, persuade the device that it is about to lose
power and all devices have to get their cached data out of RAM and
onto more permanent storage.

How you do that is specific to that kind of device.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

Attachment: pgpso1VMC5Ho2.pgp
Description: PGP signature

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq