From the course: Linux Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Read and write caches

Read and write caches - Linux Tutorial

From the course: Linux Tips

Read and write caches

- [Instructor] Saving files to disk is a reasonably quick operation, though for some media, especially magnetic hard drives and slower flash memory as we find in USB thumb drives and SD cards, the time required to save a file especially if it's large, can be significant. That means that saving a file can seem slow as we wait for an operation to finish before we can move on and do other things. In order to avoid this slowness many systems do something a little bit sneaky. They don't actually write the data to the disk immediately and instead they keep it in a write cache in memory. Ordinarily the system will write the data to disk after a while or when the write cache starts to fill up. But we can force the process using the sync command. A write cache in addition to freeing the system up to move on to other tasks instead of waiting for synchronous writes to disk helps to reduce the wear on solid state drives by reducing…

Contents