How Do I Find The Hardware Block Read Size for My Hard Drive?
I'm trying to figure out the optimal size for a large copy from my hard drive using dd. I'm trying to figure out what the best blocksize to use it, which I would assume is the hardware block size for that drive.
The lsblk command is great for this:
lsblk -o NAME,PHY-SeC
The results:
NAME PHY-SEC
sda 512
├─sda1 512
├─sda2 512
└─sda5 512
Linux exposes the physical sector size in files /sys/block/sdX/queue/physical_block_size
. Although, to get the best performance you should probably do a little testing with different sizes and meassure. I could not find a clear answer in that using exactly the physical block size would get the optimal result (although I assume it cannot be a bad choice).