4 ms·
I've been told to type sync into terminal whenever I want writes to complete.
by em3rgent0rdr 11y ago
I've been told to type sync into terminal whenever I want writes to complete.
- jclulow 11y agoThe sync(1M) command provided on many UNIX systems is often a thin wrapper around the sync(2) system call. The sync(2) entry point does not, as specified, guarantee that all inflight data _has_ been written; it's more of a guideline than an actual rule. The user must subsequently wait for the data to actually make it to disk, often for an arbitrarily long amount of time.
- rsync 11y ago"I've been told to type sync into terminal whenever I want writes to complete." If you'd really like a guarantee, you can always unmount the filesystem, or alternatively, mount it read-only: mount -ur /mnt/blah That will guarantee, at least at the filesystem/OS level, that the writes are committed.
- rocky1138 11y agoMy understanding that, after that point, the hardware drivers could lie and say they've written it and we'd never know, correct? And even after that, the hardware could return a "written OK" value but not actually do the job, right? So the point is that without complete transparency from end-to-end, there's no way to tell. Is that correct?
- tremon 11y agoYes, and there's also the problem that magnetization of material isn't permanent so your data may disappear after N days even if it were written correctly (typically, N > 5000). Should your "complete transparency" model also include expected longevity of the written bits?