Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the conv-fdatasync do in dd command in linux? [closed]

Tags:

linux

dd

I am very new to Linux. I was reading this article on using the dd command to burn ISOs to USB drives. I didn't understand this section on fdatasync. https://www.howtogeek.com/414574/how-to-burn-an-iso-file-to-a-usb-drive-in-linux/

conv=fdatasync: The conv parameter dictates how dd converts the input file as it is written to the output device. dd uses kernel disk caching when it writes to the USB drive. The fdatasync modifier ensure the write buffers are flushed correctly and completely before the creation process is flagged as having finished.

I don't understand what they mean by write buffers and flushing. Not only that, but I think that they mean that instead of caching the information for writing, they immediately transfer the buffer to the USB drive. But I could be wrong.

like image 315
bababooey2 Avatar asked May 22 '26 02:05

bababooey2


2 Answers

Keep in mind that some operations are stored in RAM and postponed to be later written on the disk, so with this flag you tell the dd to write everything on the disk. So you have a complete ISO

like image 131
alabalistic Avatar answered May 24 '26 23:05

alabalistic


Normally dd closes itself without any warning when it said that the copy is done. If you have a USB with light you can see it still writes data even after dd is closed (or check for I/O if you haven't).

conv=fdatasync forces dd to verify if everything is written before closing itself: it's way more secure than leaving it without, expecially when you write a bootable ISO file in a USB key.

like image 24
Marco Scardovi Avatar answered May 24 '26 22:05

Marco Scardovi