News for hackers. Stuff that matters.
Re:Dd is not a disk writing tool (2015) by mschuster91 on Sunday January 08, 2017 @06:57AM (#13349357)
In theory the native block size (512 bytes for most drives these days) should be the fastest, but the problem is that if you're doing such small sized I/O, you introduce a shitload of overhead for all the individual r/w calls - I guess that a huge blocksize benefits from DMA and look-ahead reads.
Re:Dd is not a disk writing tool (2015) by vmp on Sunday January 08, 2017 @07:35AM (#13349458)
For some reason I cannot reply to your message directly, only to a parent.

Flashbench [1] should be able to tell you what the erase-block and page size is.

[1] https://github.com/bradfa/flashbench

Re:Dd is not a disk writing tool (2015) by kosma on Sunday January 08, 2017 @07:18AM (#13349406)
> native block size (512 bytes for most drives these days)

Not anymore. Advanced Format (4096-byte sector) hard drives have taken the market like a storm, and SSDs benefit even more from using larger I/O sizes (because erase sectors are way larger).

Re:Dd is not a disk writing tool (2015) by mschuster91 on Sunday January 08, 2017 @07:29AM (#13349443)
Ah, I thought it was the other way round. Thanks for the information.

Do you know a way to get an SSD's native erase sector size?

Re:Dd is not a disk writing tool (2015) by zielmicha on Sunday January 08, 2017 @09:08AM (#13349710)
I would guess that using erase sector size as a block size won't help, because SSD controller anyway rearranges blocks all the time.
Re:Dd is not a disk writing tool (2015) by kosma on Sunday January 08, 2017 @10:19AM (#13349989)
There is no simple answer to this. Stack Overflow has some hints but no definite answer.
Re:Dd is not a disk writing tool (2015) by fh973 on Sunday January 08, 2017 @07:49AM (#13349498)
Isn't it: the larger the better until you face diminishing returns as with small block sizes the system call overhead becomes noticeable?
Re:Dd is not a disk writing tool (2015) by morganvachon on Sunday January 08, 2017 @10:31AM (#13350070)
I've always used bs=4M for writing .iso or .img files to USB flash drives, as it gives me the best times. This is on Linux, OpenBSD, and macOS (using /dev/rdiskn for the latter two).
Re:Dd is not a disk writing tool (2015) by koala_man on Sunday January 08, 2017 @09:26PM (#13353509)
Which theory suggests that this should be the fastest?