Sujet : Re: Move bookworm system from SSD to NVME
De : not (at) *nospam* telling.you.invalid (Computer Nerd Kev)
Groupes : comp.sys.raspberry-piDate : 04. Aug 2024, 00:30:38
Autres entêtes
Organisation : Ausics - https://newsgroups.ausics.net
Message-ID : <66aebd9e@news.ausics.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/2.4.31 (i586))
Bj?rn Lundin <
bnl@nowhere.com> wrote:
looking at <https://linux.die.net/man/8/sync>
"""
The kernel keeps data in memory to avoid doing (relatively slow) disk
reads and writes. This improves performance, but if the computer
crashes, data may be lost or the file system corrupted as a result. sync
ensures that everything in memory is written to disk.
"""
So, what I think is that dd writes to a slow device, and it is cached by
the OS.
sync forces the OS to actually write to slow device.
I've used the "conv=fsync" option to dd so that sync is done
automatically. Since the man page is rather vague about it, I did
a web search to double check that I wasn't imagining things and
found this page which describes the behaviour with some examples:
https://abbbi.github.io/dd/This may not be true with new and shiny fast NVM storage, but the
principle holds.
The tests at that link were done with a RAM disk, and the kernel
was caching writes to that, so it doesn't look like the caching
system is smart enough to know when a device is fast enough that
the cache isn't required.
-- __ __#_ < |\| |< _#