Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to copy an image to a USB thumb drive. As I would like to get "real" speeds, and don't want to wait ages for the device to sync after copying the image, I would like to know which options to use for that.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Reading through the source code shows that you should also be asking about the nocache option as well. The direct option should get you what you want, but it also depends on what version of dd you're playing around with. Doing a large copy an an Ubuntu 11.04 system showed me even slower (=closer to reality?) times with the dsync option uses synchronized i/o for data, which likely loses the aggregation advantage that modern disk controllers give us. To know "exactly" what's going on, you're going to have to dig into the source code for the particular kernel you're running, but even then you're at the mercy of the interface board on the drive, which does its own buffering.

share|improve this answer
    
You're not at the mercy of the drive; when the fsync() or direct write() completes, the data is on the platter. –  psusi Jan 30 '12 at 16:25
add comment

The fsync option will flush the data at the end of the copy. The dsync option will flush the data after every block. The direct option will have similar results as dsync, only without polluting the filesystem cache with the data. This is good for caching the rest of the system, and saves some cpu overhead.

Either dsync or direct will give lower throughput, but that can be mostly offset by using a large block size, such as 1MB or more.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.