I can call sync without root privileges. Does it flush all buffers to disk? Is it the same as calling it with root privileges like sudo sync?
1 Answer
Yes,
sync
called with no arguments will cause all dirty buffers to be flushed to disk, regardless of the identity of the user running it.
This is also true of the other modes some implementations of sync support, although in file-based cases other limitations apply — the user running sync has to be able to open the file being synced.
See Why can an unprivileged user execute the `sync` command? for a discussion of the security aspects of this behaviour.