Hi,

Alex King wrote:
> I've installed a large disk in a new machine and loaded Debian (bookworm) on
> it, but it's showing as limited to 2TB when the disk should be larger.

> root@fj2:/home/installer# smartctl -i /dev/sdb
> [...]
> User Capacity:    8,001,563,222,016 bytes [8.00 TB]
> Sector Sizes:     512 bytes logical, 4096 bytes physical

> root@fj2:/home/installer# cat /proc/partitions
> major minor  #blocks  name
> [...]
>    8       16 2147483647 sdb

Observation:

  2147483647 = 2 exp 31 - 1

This could mean that the kernel bonks at a 31-bit limit.


> root@fj2:/home/installer# cat /proc/version
> Linux version 6.1.0-29-amd64 [...]

But where would an amd64 kernel have such an ancient limitation ?


> root@fj2:/home/installer# gdisk -l /dev/sdb
> [...]
> Disk /dev/sdb: 4294967294 sectors, 2.0 TiB
> [...]
> Sector size (logical/physical): 512/512 bytes

This agrees to /proc/partitions. man proc_partitions says that it
counts blocks of 1024 bytes.
  4294967294 / 2 = 2147483647

Could there be confusion about the physical block size ?
Probably not:
The byte count resulting from block count multiplied by the physical
block size 4096 as reported by smartctl does not match the reported
"User Capacity" of smartctl:
  2147483647 * 4096 = 8,796,093,018,112
That's higher than the smartctl value by nearly 10 percent, which makes
it rather improbable as miscalculation suspect.


So there remains only a simple 31-bit ceiling as suspect.
It's not a 32-bit rollover where the result remainder of this division
would have to be near to 0 , 1/2 or 1:
  8001563222016 / 512 / 4294967296 = 7.277379356324673


Have a nice day :)

Thomas

Reply via email to