The actual disk is about 100 times than volatile memory such as RAM. That is why disks have, in addition to the actual disk, an embedding volatile memory (like RAM) called the buffer. In the case of a write, the data is first quickly written in the buffer before being actually dumped in large blocks (what is more efficient) onto the actual disk (persistent storage). As a consequence, the actual disk may not contain the written data (it is still in the buffer) and the filesystem can be in an inconsistent state even if the write has been achieved from the operating system's point of view. 'sync' simply forces the data in buffer to be written onto the disk.

Reply via email to