External USB-SATA bridge rewriting logical block sizes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I'm having troubles using WD40EZRX [1] in a USB3 -> SATA dock. The trouble I'm hitting is that the data I get back when reading the first partition differ depending on whether I access the drive via the enclosure, or directly as a SATA disk.

Here is how it looks directly attached:

plejtvak ~ # sg_readcap -l /dev/sdc
Read Capacity results:
  Protection: prot_en=0, p_type=0, p_i_exponent=0
  Logical block provisioning: lbpme=0, lbprz=0
Last logical block address=7814037167 (0x1d1c0beaf), Number of logical blocks=7814037168
  Logical block length=512 bytes
  Logical blocks per physical block exponent=3
  Lowest aligned logical block address=0
Hence:
  Device size: 4000787030016 bytes, 3815447.8 MiB, 4000.79 GB

And this is how it looks through the USB convertor:

svist ~ # sg_readcap -l /dev/sdb
Read Capacity results:
  Protection: prot_en=0, p_type=0, p_i_exponent=0
  Logical block provisioning: lbpme=0, lbprz=0
Last logical block address=976754645 (0x3a3817d5), Number of logical blocks=976754646
  Logical block length=4096 bytes
  Logical blocks per physical block exponent=0
  Lowest aligned logical block address=0
Hence:
  Device size: 4000787030016 bytes, 3815447.8 MiB, 4000.79 GB

My partition table is probably borked -- IIRC I created it via `cfdisk` over the USB connection, but I am not sure about that anymore. This is what gdisk reports when directly attached:

Command (? for help): p
Disk /dev/sdc: 7814037168 sectors, 3.6 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): AD1C809E-45FC-4CDD-A9EC-2855D4AF1E6E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 7814037134
Partitions will be aligned on 8-sector boundaries
Total free space is 4294972395 sectors (2.0 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name
  1              63      3519064768   1.6 TiB     0700  Linux/Windows data

...and through the USB dock:

Command (? for help): p
Disk /dev/sdb: 976754646 sectors, 3.6 TiB
Logical sector size: 4096 bytes
Disk identifier (GUID): DFE2C96D-8A4C-4516-86B2-4F6DA0EB8609
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 976754640
Partitions will be aligned on 8-sector boundaries
Total free space is 57 sectors (228.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
  1              63      3519064768   13.1 TiB    8300  Linux filesystem

I have a filesystem on the first partition. Accessing it works fine via the USB reduction, but mount refuses to proceed when accessing the SATA disk directly. I assume that this is because the partition starts at byte (63*4096) from the beginning of the disk, which matches the detected partition start when using the USB thingy. However, when accessing the disk directly over SATA, the partition is presumably expected to begin at (63*512), which is a very different location, and stuff therefore breaks.

I have already read the discussion from January [3] and believe that this is a different situation -- I haven't disassembled anything, this is a standalone USB->SATA convertor and a standalone SATA disk.

I would appreciate a couple of pointers here:

- Did I screw up somehow? If so, how? Perhaps by using wrong partition table layout, i.e. by tying myself to logical blocks?

- Can I salvage the data by rewriting the partition table in some magic way which would work with both "physical 4k, logic 4k" and "physical 512, logic 4k" modes at the same time?

- Is the USB enclosure which I'm using just a crappy piece of hardware that I should stay away from?

- What is the cleanest way of accessing the drive in the safest possible manner? I would like to put my backups in there, and I wasn't really happy when I plugged the drive directly in order to test the contents and found out that it won't even mount.

- I guess I could just give up on partitioning altogether and use filesystem on the whole device without much trouble. However, I'm afraid that this might confuse the kernel's partition layout detection, and it also seems a bit ugly.

Help is much appreciated. There's an unsolved Stackoverflow post at [4] which appears to be dealing with the exactly same problem, btw.

With kind regards,
Jan

[1] WD40EZRX-00SPEB0, a 4TB WD Green
[2] "174c:5106 ASMedia Technology Inc. Transcend StoreJet 25M3" (lsusb), also known as "IcyBox IB-116StU3-B" (label)
[3] http://www.spinics.net/lists/raid/msg45555.html
[4] http://superuser.com/questions/679725/how-to-correct-512-byte-sector-mbr-on-a-4096-byte-sector-disk

--
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux