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.
[ Parent
| on HN ]
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.
> 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.
There is no simple answer to this. Stack Overflow has some hints but no definite answer.
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).