GPT table not on the end of device

Hi again, not sure where to post this, trying here… :wink:

Have Libretrend board with 256 GB SSD for OS (Leap 15.2 server) and added two brand new WDred 4TB drives (SMART Device Model: WDC WD40EFRX-68N32N0, those where you don’t know if they are 5400 or something else U/min). Had no luck to use them with a raspberry pi 2B+ (raspbian buster) or Odroid XU4 (debian stretch) with USB3-SATA adaptors I use for other WDred4 TB drives as RAID1 NAS since last year:

[925205.358058] ldm_validate_partition_table(): Disk read failed.
[925205.382573] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[925205.382578] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[925205.382582] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[925205.382586] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
[925205.382593] blk_update_request: critical target error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[925205.382598] Buffer I/O error on dev sdb, logical block 0, async page read
[925205.383017] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[925205.383021] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[925205.383024] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[925205.383027] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
[925205.383031] blk_update_request: critical target error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[925205.383034] Buffer I/O error on dev sdb, logical block 0, async page read
[925205.383368] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[925205.383372] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[925205.383375] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[925205.383378] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
[925205.383380] blk_update_request: critical target error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[925205.383382] Buffer I/O error on dev sdb, logical block 0, async page read
[925205.383700] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[925205.383704] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[925205.383707] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[925205.383710] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
[925205.383714] blk_update_request: critical target error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[925205.387026]  sdb: unable to read partition table

______________________

[927898.349402] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.349404] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.349405] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.349407] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
[927898.349408] print_req_error: 22 callbacks suppressed
[927898.349410] blk_update_request: critical target error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0                                                          
[927898.349412] buffer_io_error: 18 callbacks suppressed
[927898.349413] Buffer I/O error on dev sdb, logical block 0, async page read
[927898.351375] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.351377] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.351378] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.351380] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 04 00
[927898.351381] blk_update_request: critical target error, dev sdb, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0                                                      
[927898.351658] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.351659] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.351660] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.351661] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
[927898.351663] blk_update_request: critical target error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0                                                          
[927898.351664] Buffer I/O error on dev sdb, logical block 0, async page read
[927898.351962] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.351963] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.351964] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.351965] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
[927898.351967] blk_update_request: critical target error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0                                                          
[927898.351967] Buffer I/O error on dev sdb, logical block 0, async page read
[927898.352254] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.352256] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.352258] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.352260] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 04 00 00 08 00
[927898.352262] blk_update_request: critical target error, dev sdb, sector 32 op 0x0:(READ) flags 0x80700 phys_seg 8 prio class 0                                                     
[927898.352536] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.352539] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.352541] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.352543] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 01 00 00 01 00
[927898.352545] blk_update_request: critical target error, dev sdb, sector 8 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0                                                          
[927898.352547] Buffer I/O error on dev sdb, logical block 1, async page read
[927898.352909] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.352912] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.352915] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.352917] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 02 00 00 01 00
[927898.352920] blk_update_request: critical target error, dev sdb, sector 16 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[927898.352922] Buffer I/O error on dev sdb, logical block 2, async page read
[927898.353470] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.353472] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.353474] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.353477] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 03 00 00 01 00
[927898.353479] blk_update_request: critical target error, dev sdb, sector 24 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[927898.353481] Buffer I/O error on dev sdb, logical block 3, async page read
[927898.353760] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.353762] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.353764] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.353768] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 04 00 00 01 00
[927898.353770] blk_update_request: critical target error, dev sdb, sector 32 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[927898.353771] Buffer I/O error on dev sdb, logical block 4, async page read
[927898.354061] sd 3:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[927898.354064] sd 3:0:0:0: [sdb] tag#0 Sense Key : Illegal Request [current] 
[927898.354066] sd 3:0:0:0: [sdb] tag#0 Add. Sense: Invalid field in cdb
[927898.354069] sd 3:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 05 00 00 01 00
[927898.354071] blk_update_request: critical target error, dev sdb, sector 40 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[927898.354073] Buffer I/O error on dev sdb, logical block 5, async page read
[927898.354357] Buffer I/O error on dev sdb, logical block 6, async page read
[927898.354637] Buffer I/O error on dev sdb, logical block 7, async page read


----------

Raspi 2B+ 09.09.2020

  186.229827] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
  186.681984] usb 1-1.3: New USB device found, idVendor=abcd, idProduct=6103, bcdDevice= 0.06
  186.682003] usb 1-1.3: New USB device strings: Mfr=4, Product=5, SerialNumber=6
  186.682011] usb 1-1.3: Product: Ext. HDD
  186.682019] usb 1-1.3: Manufacturer: Innostor
  186.682027] usb 1-1.3: SerialNumber: 20190402
  186.683073] usb-storage 1-1.3:1.0: USB Mass Storage device detected
  186.700118] scsi host0: usb-storage 1-1.3:1.0
  186.744140] usbcore: registered new interface driver uas
  187.760828] scsi host0: scsi scan: INQUIRY result too short (5), using 36
  187.760855] scsi 0:0:0:0: Direct-Access     WDC WD40 EFRX-68N32N0          PQ: 0 ANSI: 0
  187.762409] sd 0:0:0:0: [sda] 976754646 4096-byte logical blocks: (4.00 TB/3.64 TiB)
  187.763376] sd 0:0:0:0: [sda] Write Protect is off
  187.763391] sd 0:0:0:0: [sda] Mode Sense: 3b 00 00 00
  187.764330] sd 0:0:0:0: [sda] No Caching mode page found
  187.764341] sd 0:0:0:0: [sda] Assuming drive cache: write through
  187.772211] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
  187.772237] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current] 
  187.772248] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0 
  187.772265] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 00 00 00 00 00 00 01 00
  187.772276] print_req_error: critical target error, dev sda, sector 0
  187.772289] Buffer I/O error on dev sda, logical block 0, async page read
  187.773093] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
  187.773108] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current] 
  187.773120] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0 
  187.773134] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 00 00 00 00 00 00 01 00
  187.773144] print_req_error: critical target error, dev sda, sector 0
  187.773154] Buffer I/O error on dev sda, logical block 0, async page read
  187.773859] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
  187.773876] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current] 
  187.773887] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0 
  187.773902] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 00 00 00 00 00 00 01 00
  187.773912] print_req_error: critical target error, dev sda, sector 0
  187.773921] Buffer I/O error on dev sda, logical block 0, async page read
  187.773973]  sda: unable to read partition table
  187.777645] sd 0:0:0:0: [sda] Attached SCSI disk
  187.783367] sd 0:0:0:0: Attached scsi generic sg0 type 0
  187.826217] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
  187.826239] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current] 
  187.826250] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0 
  187.826264] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 3a 38 17 c0 00 00 01 00
  187.826277] print_req_error: critical target error, dev sda, sector 7814036992
  187.827156] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
  187.827176] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current] 
  187.827187] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0 
  187.827200] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 3a 38 17 c0 00 00 01 00
  187.827210] print_req_error: critical target error, dev sda, sector 7814036992
  187.827221] Buffer I/O error on dev sda, logical block 976754624, async page read

OK, so I used Yast on Libretrend with Leap 15.2 (server) to create a RAID1 from the two WDred 4TB, formatted with EXT4 and mounted it, made samba serve the new RAID as my new NAS.

I waited until the resync was over and let it sit another night but I still have here:

sudo fdisk -l
[sudo] password for root: 
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EFRX-68N
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 94268C9A-B84D-4450-AB1D-720F005B89E8

Device     Start        End    Sectors  Size Type
/dev/sda1   2048 7814036830 7814034783  3.7T Linux filesystem


The backup GPT table is not on the end of the device. This problem will be corrected by write.
Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EFRX-68N
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 94268C9A-B84D-4450-AB1D-720F005B89E8

Device     Start        End    Sectors  Size Type
/dev/sdb1   2048 7814036830 7814034783  3.7T Linux filesystem


Disk /dev/sdc: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Disk model: WDC WDS250G2B0B 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E349C97B-536D-4F20-B283-6391689D2BBC

Device         Start       End   Sectors   Size Type
/dev/sdc1       2048     18431     16384     8M BIOS boot
/dev/sdc2      18432  73418751  73400320    35G Linux filesystem
/dev/sdc3   73418752 484202495 410783744 195.9G Linux filesystem
/dev/sdc4  484202496 488397134   4194639     2G Linux swap


Disk /dev/md0: 3.7 TiB, 4000786874368 bytes, 7814036864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 94268C9A-B84D-4450-AB1D-720F005B89E8

Device     Start        End    Sectors  Size Type
/dev/md0p1  2048 7814036830 7814034783  3.7T Linux filesystem

Is this “GPT table not on the end of device” something to worry about? What does it mean by “will be corrected by write”?

Many thanks in advance!

It is potentially a problem. I’m not sure how serious a problem.

With GPT, there are two copies of the partition table. One of those copies is supposed to be at the end of the disk.

If you formatted the disk on a different computer, maybe that computer has a different idea on where the end of the disk is. So best to do whatever you did on the computer where it will finally be used.

You might want to see what “parted” says about the disk, as with:

sudo parted -l

“fdisk” is telling you that if you do something like:


fdisk /dev/sda
w

then on that “w” command to write the changes, it will fix the partitioning problem.

Hi and thanks!

sudo parted -l
[sudo] password for root: 
Warning: Not all of the space available to /dev/sda appears to be used, you can
fix the GPT to use all of the space (an extra 304 blocks) or continue with the
current setting? 
Fix/Ignore? I
Model: ATA WDC WD40EFRX-68N (scsi)
Disk /dev/sda: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  4001GB  4001GB  ext4


Warning: Not all of the space available to /dev/sdb appears to be used, you
can fix the GPT to use all of the space (an extra 304 blocks) or continue with
the current setting? 
Fix/Ignore? I
Model: ATA WDC WD40EFRX-68N (scsi)
Disk /dev/sdb: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  4001GB  4001GB  ext4


Model: ATA WDC WDS250G2B0B (scsi)
Disk /dev/sdc: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  9437kB  8389kB                        bios_grub
 2      9437kB  37.6GB  37.6GB  ext4                  legacy_boot
 3      37.6GB  248GB   210GB   ext4
 4      248GB   250GB   2148MB  linux-swap(v1)        swap


Model: Linux Software RAID Array (md)
Disk /dev/md0: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  4001GB  4001GB  ext4


I said IGNORE at both “Warnings”.

I read something on the interwebs that software RAID (mdadm) and GPT both try to write essential data to the END of the HDD and that this may end in conflicts. Not sure why it works flawlessly on an Odroid XU4 with 2x4TB WDred HDDs as RAID1 (4.14 kernel iirc)…

I thought with building the RAID and formatting the RAID as EXT 4 in YaST Partitioner all previous partitioning would be history…? Should I start from the scratch with a fresh GPT on both disks via YaST? Did fresh 3 times now, always takes some 8-9h for resync.

I have seen this before.
It appears that every brand of ssd / nvme controller decides on the format of the attached drive.
Some pretend to have 512byte sectors and some 1024byte some 2048byte and some 4096byte and that is where the problem comes from.
Some autoalign partitons for better performance, some don’t. That can cause the sectors to be off by a couple of sectors at the end of the drive.
I have learned to use gparted and create a new gpt table anytime I move a large ssd or nvme to a new device because the controller might be a different brand.
I know it is ok to move them between the same model of laptops but even the USB of the same brand might have different controllers between runs of the manufacturer.

OK, I did it new in YaST -> Partitioner

  • removed RAID

  • new GPT for each drive

  • created RAID1

  • created new partition (EXT4)

now I have:

sudo fdisk -l
Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EFRX-68N
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EFRX-68N
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdc: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Disk model: WDC WDS250G2B0B 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E349C97B-536D-4F20-B283-6391689D2BBC

Device         Start       End   Sectors   Size Type
/dev/sdc1       2048     18431     16384     8M BIOS boot
/dev/sdc2      18432  73418751  73400320    35G Linux filesystem
/dev/sdc3   73418752 484202495 410783744 195.9G Linux filesystem
/dev/sdc4  484202496 488397134   4194639     2G Linux swap


Disk /dev/md0: 3.7 TiB, 4000786874368 bytes, 7814036864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3A6047E8-117A-4669-A216-17D997F57F29

Device     Start        End    Sectors  Size Type
/dev/md0p1  2048 7814036830 7814034783  3.7T Linux filesystem


Better now, or?

That does seem to be a likely explanation.