Sujet : Re: Move bookworm system from SSD to NVME
De : bnl (at) *nospam* nowhere.com (Björn Lundin)
Groupes : comp.sys.raspberry-piDate : 03. Aug 2024, 13:35:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v8l876$3easg$3@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
User-Agent : Mozilla Thunderbird
On 2024-08-03 13:59, The Natural Philosopher wrote:
I simply do not know how a command to something purporting to resemble a hard drive, that isnt can guarantee all data in it is flushed.
We might talk about different things.
I'm thinking of what the OS is caching. That sync is flushing that part of the OS cache.
Not whatever clever memory that is inside a storage device.
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.
This may not be true with new and shiny fast NVM storage, but the principle holds.
do a sync after a dd operation.
-- /Björn