Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month at the Massachusetts Institute of Technology, in Building E51.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] systemd reboot



Richard Pieri <richard.pieri at gmail.com> writes:

> The old "sync;sync;sync;halt" mantra is folklore from the days before we
> had a shutdown/reboot command which does this for us. The first sync
> flushes any dirty buffers, the second blocks waiting for the first to
> complete ensuring that there are no dirty buffers when the system goes
> down, and the third... makes us feel good (it has no technical benefit).
>
> This doesn't work as expected today because most drives lie about
> committing writes to permanent storage. The second sync won't block
> unless the size of data in dirty kernel buffers exceeds the drives'
> write cache capacity and then it will block only long enough for that
> ratio to flip. If the system restarts, loses power, whatever, when the
> drives' on-board caches have not been committed then there will be data
> loss. The Linux kernel code which guarantees that writes are committed
> doesn't actually work because it relies on drives not lying about their
> cache commits.

Thanks, this is great info. Curiously, in my local reproduction of the
issue the lying hardware involved is qemu's virtio simulated disk. So
maybe their simulation is super realistic, eh?

-- 
Mike Small
smallm at sdf.org



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org