HDD Partition won't read after relocation to USB.

Hi,
Finally installed my 2TB SATA SSD on the motherboard to replace the suspect HDD - all good. I wanted to check a few files on the HDD so I connected it to the PC via a USB dock. The HDD has a single ext4 partition.

When connected via USB the HDD’s partition won;t read.

chris@asus-roc:~> lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk 
├─sda1   8:1    0     8M  0 part 
├─sda2   8:2    0    40G  0 part /var
├─sda3   8:3    0  69.8G  0 part /home
└─sda4   8:4    0     2G  0 part [SWAP]
sdb      8:16   0   1.8T  0 disk 
└─sdb1   8:17   0   1.8T  0 part /data
**sdg      8:96   0   1.8T  0 disk** 
sr0     11:0    1  1024M  0 rom 

So I had a look in fdisk and saw the partition exists.

chris@asus-roc:~> sudo fdisk -l /dev/sdg
Disk /dev/sdg: 1.8 TiB, 2000398934016 bytes, 488378646 sectors
Disk model: EZRX-00D8PB0    
Units: sectors of 1 * 4096 = 4096 bytes
**Sector size (logical/physical): 4096 bytes / 4096 bytes**
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdg1           1 488378645 488378645  1.8T ee GPT
chris@asus-roc:~>

I searched a bit and found this thread https://unix.stackexchange.com/questions/642474/gpt-disk-looks-different-in-external-docking-bay-and-internal-swap-bay saying the issue is with USB controllers emulating the wrong sector size. But according to fdisk they are the same size.

I have not yet tried the ‘losetup’ mentioned in the thread as I’m not sure if this is the right approach. Basically I just want to do a quick direct read of the old HDD via USB. Can ‘fdisk’ fix things?

NB. I have NOT lost any data as I backed up my old HDD prior to removal to a separate media and restored that to the new SSD - an 11 hour job :frowning:

Thanks.

I have an external disk container that does what you are showing. A 2TB disk mounted there would show sector size as 4096 logical and 4096 physical. But when the disk is mounted to the using internal SATA port, it shows as 512 logical and 4096 physical.

Yes, that makes the disk unusable due to the sector size mismatch. You will need a usb container that supports the 512 logical sector size.

I thought these USB black boxes were just magic :wink: Ok will read the specs the next time I need to buy one.

Any point playing with fdisk or other tools? I might just as well reformat the HDD?

STOP PRESS I have a second USB container and the HDD works.

chris@asus-roc:~> sudo fdisk -l /dev/sdg
GPT PMBR size mismatch (488378645 != 3907029167) will be corrected by write.
Disk /dev/sdg: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: LucidPort USB300
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: 53A483D5-146F-11E4-8C40-001FE25801E0

Device     Start        End    Sectors  Size Type
/dev/sdg1   2048 3907028991 3907026944  1.8T Linux filesystem

Thanks.

I had thought so to. So I partitioned and prepared a disk using that, and found that it didn’t work when actually installed in the computer. Not a big deal, I just had to repartition.

I also have a couple of SATA docking stations. And those work fine and correctly recognize the 512 logical sector size.

Predicting whether a given combination of USB adapter and SATA disk drive doesn’t work. You need to test:

**3400G:~ #** lsusb -s 002:003                 
Bus 002 Device 003: ID 1f75:0611 Innostor Technology Corporation IS611 SATA/PATA Bridge Controller 
**3400G:~ #
**
[FONT=monospace]**3400G:~ #** smartctl -i /dev/sdc 
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.11.15-1-default] (SUSE RPM) 
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org 

=== START OF INFORMATION SECTION === 
Model Family:     Seagate Barracuda 7200.14 (AF) 
Device Model:     ST2000DM001-1CH164 
Serial Number:    W34*****
LU WWN Device Id: 5 000c50 03d25fc49 
Firmware Version: CC29 
User Capacity:    2,000,398,934,016 bytes [2.00 TB] 
**Sector Sizes:     512 bytes logical, 4096 bytes physical **
Rotation Rate:    7200 rpm 
Form Factor:      3.5 inches 
Device is:        In smartctl database [for details use: -P show] 
ATA Version is:   ACS-2, ACS-3 T13/2161-D revision 3b 
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s) 
Local Time is:    Sun Apr 25 07:56:03 2021 CEST 
SMART support is: Available - device has SMART capability. 
SMART support is: Enabled 
**3400G:~ #

**[/FONT]
[FONT=monospace][FONT=monospace]**3400G:~ #** fdisk -l /dev/sdc 
**Disk /dev/sdc: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors**
Disk model: 001-1CH164       
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: 609FED7F-FC4F-43A7-9D25-44783253D69C 

**Device****     Start****       End****   Sectors**** Size****Type**
/dev/sdc1        2048      34815      32768   16M Microsoft reserved 
/dev/sdc2    33761280 3770382335 3736621056  1.7T Linux filesystem 
/dev/sdc3  3770382336 3770587135     204800  100M EFI System 
/dev/sdc4  3770587136 3905975094  135387959 64.6G Microsoft basic data 
/dev/sdc5  3905976320 3907026943    1050624  513M Windows recovery environment 
**3400G:~ #**[/FONT][/FONT]
**3400G:~ #** fdisk -l /dev/sdc    
**Disk /dev/sdc: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors**
Disk model: ST2000DM001-1CH1 
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: 609FED7F-FC4F-43A7-9D25-44783253D69C 

**Device****     Start****       End****   Sectors**** Size****Type**
/dev/sdc1        2048      34815      32768   16M Microsoft reserved 
/dev/sdc2    33761280 3770382335 3736621056  1.7T Linux filesystem 
/dev/sdc3  3770382336 3770587135     204800  100M EFI System 
/dev/sdc4  3770587136 3905975094  135387959 64.6G Microsoft basic data 
/dev/sdc5  3905976320 3907026943    1050624  513M Windows recovery environment 
**3400G:~ #**



ILL you’re talking about 4K sector support.