I have a Samsung NVMe SSD 960 PRO M.2.

I was in the process of installing Gentoo on it. gparted notified me that the physical block size, is different than what the kernel reports. I thought the notification was for the M.2 SSD, so I used dd to write zeros for the physical block size in the notification. It turns out it was for my USB drive.

I want to know what the block size is, that the device has out of the box. I know it will work with whatever I give it, but I want it to last.

  • 1
    It doesn't really matter, just use the default for whatever filesystem you are going to use. The filesystem will do its job, the controller on the SSD will do its job and together they'll just work. Each part will then read and write only as much as they need/want to. – Mokubai Jul 4 '18 at 7:54
  • I know the stuff will work, and everything will do it's job. I'm doing it at 4k block size now. But I want to know what block size would be best for this device. I want my stuff to run as best as it can. That's why I'm doing a Gentoo build of Linux. After that, I'm going to do a Linux from Scratch build. I just like playing with my hardware, because it's my toy. I was hoping a file system designer that has one of these drives, might pop in, and tell me something. I guess it wont happen, if it really doesn't matter though. – Herbert Smith Jul 4 '18 at 9:24
  • 1
    Please don't edit the answer into your question. Super User is a question and answer site and answers should be separate from questions. You can answer your own question instead. – DavidPostill Jul 6 '18 at 8:26
  • 1
    @HerbertSmith, what block size do you mean? HDD:s have a block size, 512 B traditionally, 4096 B on newer drives, but you can't change that. SSD:s have some sorts of blocks, but I don't even know how find those out, and I'm not sure what they show for the HDD equivalent value (which is probably what partitioning tools care about), they might fake some numbers there. And then you have the filesystem block size, which you could change, except that it depends on the filesystem, and at least for ext4 you can't even use higher than 4096 on x86... – ilkkachu Jul 6 '18 at 10:19
  • 1
    @HerbertSmith, yes, that's a property of the ZFS filesystem (not the drive), as should be evident from the fact that it's described in the ZFS man page. Your question didn't say anything about ZFS, or any other filesystem, and really wasn't specific at all about what block size you meant. Which is why I tried to ask about that. – ilkkachu Jul 17 '18 at 14:20

Note: this community wiki is in fact the OP's answer originally posted as an edit to the question.

I just did a lot of research to get my answer, which has kept me from installing my OS until now. There is a lot going on with what is stored within different block sizes. Different hardware architectures handle the various quantities of transistors, for various block sizes, differently from each other.

I ran a series of tests. Here are the results, for the device I was inquirring about:

Median Speeds:

      bs =  write speed
     512 = 552 MB/s
    1024 = 783 MB/s
    2048 = 1.4 GB/s
    4096 = 2.0 GB/s
    8192 = 2.3 GB/s
   16384 = 1.7 GB/s
   32768 = 2.5 GB/s
   65536 = 2.6 GB/s // <=== Max Write Speed
  131072 = 2.6 GB/s
  262144 = 2.5 GB/s
  524288 = 2.5 GB/s
 1048576 = 1.7 GB/s
 2097152 = 2.5 GB/s
 4194304 = 2.2 GB/s
 8388608 = 1.9 GB/s
16777216 = 1.9 GB/s
33554432 = 1.8 GB/s
67108864 = 1.7 GB/s

Median Speeds:

      bs =  read speed
     512 = 682 MB/s
    1024 = 1.2 GB/s
    2048 = 1.8 GB/s
    4096 = 2.9 GB/s
    8192 = 2.9 GB/s
   16384 = 3.3 GB/s
   32768 = 3.4 GB/s
   65536 = 3.6 GB/s // <=== Almost max read spead
  131072 = 1.7 GB/s
  262144 = 3.6 GB/s
  524288 = 3.7 GB/s
 1048576 = 3.6 GB/s
 2097152 = 3.6 GB/s
 4194304 = 3.3 GB/s
 8388608 = 3.1 GB/s
16777216 = 1.8 GB/s
33554432 = 2.7 GB/s
67108864 = 2.5 GB/s

I used a calculator to get the medians. From Arch Linux, I ran eight tests per read, and eight tests per write. The tests were less accurate from Linux distros running on USB. The tests were less accurate from Linux distros running a GUI. The tests were also less accurate from Linux distros running on the same drive that is being tested, due to the increase I/O for the device circuitry.

The best results were gained from an external USB 3.0 connected SanDisk Extreme, with the Arch Linux installation ISO. This is because several of the block size speeds, of every other way that I tried, had a limit that was being reached, which made it impossible to determine what the most optimal speed would be to use for this device. Many of the block sizes kept testing out at the same speed, which was 1.7 GB/s with the OS running off a thumbdrive, and around 1.8 GB/s from the drive being tested.

The speed tells me how the device handles the information stored within the pages per block.

Four of the tests were ran with ext4 file system. The other four tests were ran with the drive containing zeros. The first two tests, for both of those sets, were of the drive using 512B block size. The second two tests for both of those sets, were with the device using 4096B block size.

So, the answer is 65536B.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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