1

Let's say I copy a file using cp and the proccess returns immedietly because the file was written to cache. Then I leave the PC alone for 1 hour. Nothing special running on it.

Is the cache flushed automatically in this time?

Does it matter if the file (writing to) is a block device file, a mapper file or normal file?

2
  • Please avoid what this question describes. Commented Nov 26, 2022 at 15:28
  • @KamilMaciorowski did it Commented Nov 26, 2022 at 17:28

1 Answer 1

0

First of all, the cache is flushed as soon as OS is able to do it. Second, even the least important process has a chance to do its work.

For example, even if you have a super-high priority process, which is constantly touching hard drive, then even a super-low shell operation will have a chance to remind cache that it has some data to flush.

So, the answer is no.

1
  • I think you mean "yes". See my edit... Maybe you can answer if this applies to all kind of files like block devices and mapper files ? Commented Nov 26, 2022 at 17:28

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.