[DRBD-user] syncing to disk

Lars Marowsky-Bree lmb at suse.de
Wed Mar 9 22:51:45 CET 2005


On 2005-03-09T13:06:38, Scott Beck <sbeck at gossamer-threads.com> wrote:

> I did another test with a drbd partition. In this test I copied the
> linux kernel onto the drbd partition and then I ran `sync` (which should
> make pdflush to wake up and flush all data to all disks). I did hear the
> disk writing after I ran this. I then unplugged the system. After it
> boots up again I am missing 54 files from that linux kernel I copied, a
> total of 2k of data.

I forgot to mention something important here. The "sync" call triggers a
sync, but is actually _asynchronous_, ie that it returns doesn't mean
the sync is _finished_.

Duh. My bad. Sorry.

Admittedly, the sync man page is also less-than-helpful.

You need to actually wait for the sync to have finished, or call fsync()
on the files themselves (which _is_ synchronous).


Sincerely,
    Lars Marowsky-Brée <lmb at suse.de>

-- 
High Availability & Clustering
SUSE Labs, Research and Development
SUSE LINUX Products GmbH - A Novell Business




More information about the drbd-user mailing list