In the same server I have a bunch of 4 TB Seagate disks. I just installed them and I realized that some are recognized as 4 TB, but some as 2 TB. What could be the issue?
$ dmesg | grep '8:0:3:0'
[ 10.810825] scsi 8:0:3:0: Direct-Access ATA ST4000DM005-2DP1 0001 PQ: 0 ANSI: 5
[ 11.508060] sd 8:0:3:0: [sdf] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[ 11.508061] sd 8:0:3:0: [sdf] 4096-byte physical blocks
[ 11.508064] sd 8:0:3:0: Attached scsi generic sg5 type 0
[ 11.508089] sd 8:0:3:0: [sdf] Write Protect is off
[ 11.508090] sd 8:0:3:0: [sdf] Mode Sense: 00 3a 00 00
[ 11.508100] sd 8:0:3:0: [sdf] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 11.524947] sd 8:0:3:0: [sdf] Attached SCSI disk
$ dmesg | grep 9:0:4:0
[ 13.235315] scsi 9:0:4:0: Direct-Access ATA ST4000DM005-2DP1 0001 PQ: 0 ANSI: 5
[ 13.240191] sd 9:0:4:0: Attached scsi generic sg14 type 0
[ 13.241734] sd 9:0:4:0: [sdo] 4294967294 512-byte logical blocks: (2.20 TB/2.00 TiB)
[ 13.278030] sd 9:0:4:0: [sdo] Write Protect is off
[ 13.278031] sd 9:0:4:0: [sdo] Mode Sense: 73 00 00 08
[ 13.280316] sd 9:0:4:0: [sdo] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 13.392557] sd 9:0:4:0: [sdo] Attached SCSI disk
smartctl says that both drives are 4 TB. parted sees them as 4 TB and 2 TB, respectively:
$ parted /dev/sdf unit s print
Model: ATA ST4000DM005-2DP1 (scsi)
Disk /dev/sdf: 7814037168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 7814035455s 7814033408s primary raid
$ parted /dev/sdo unit s print
Model: ATA ST4000DM005-2DP1 (scsi)
Disk /dev/sdo: 4294967294s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 4294965247s 4294963200s primary raid
Update:
It seems the issue is that some drives are attached to the LSI SAS1068E SCSI storage controller and that one has a 2 TB drive limitation.
Not sure if there is a workaround for this. :-(
The drives are in RAID format. As long as the RAID shows up as 4G or 8G, you're fine. If the RAID shows up as something else, then one of your GPT partition tables is corrupt, and needs to be re-written.
Try this (after wiping the partitions from the disk so it's empty):
You can replace "primary" with another name for the partition.
"4096GB" corresponds to the maximum usable size of the disk so you might have to lower this to match the actual usable space, to something like "3906GB", etc.
You should be able to check the available space with fdisk:
then type p to list partitions and drive data.
If everything worked, you should see the drive as a 4TB one in parted and if so, just proceed to formatting and mounting as usual with mkfs and mount.