Comment 35 for bug 204133

Revision history for this message
Colin Ian King (colin-king) wrote :

I've looked at the sysctl's again and think there is a cleaner solution than using:

sysctl -w vm.dirty_background_ratio=0
sysctl -w vm.dirty_ratio=40
sysctl -w vm.dirty_expire_centisecs=2
sysctl -w vm.dirty_writeback_centisecs=2

1. mount the Linux filesystems on the loopback using mount options -o loop,sync
2. modify ntfs3g with the attached debdiff which adds a -o syncio mount option to open the NTFS device using O_SYNC, e.g.

ntfs-3g /path/to/ntfs-test.img /path/to/mountpoint -o syncio

  this makes all ntfs dirty writes to get written back synchronously.

3. don't use the sysctl's

I've tested an ext3 file system mounted via the loopback with -o sync (point 1 above) and used my patched ntfs3g with the -o syncio mount option and using vmstat 1 shows that I/O is flushed immediately, reducing the possibility of file system corruption on power outages.