Re: dd, close(), sync, and the Linux disk cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/19/20 9:32 AM, Christoph Hellwig wrote:
On Wed, Feb 12, 2020 at 05:02:43PM -0700, Stephen Warren wrote:
Jens et. al.,

If I dd to an SD card (e.g. via a USB SD card reader), is it required to run
sync afterward in order to guarantee that all written data is written to the
SD card? I'm running dd with a simple command-line like "dd if=file.img
of=/dev/sdc".

Yes.  Or use of=dsync on the dd command line.

Can you explain further why it's necessary given that the kernel explicitly blocks execution of close() to flush buffers to disk, assuming the process is the last one with the device open? Am I misinterpreting the code path I mentioned later in my email? In practice, I can see this happening when I use dd.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux