Hi All,

I have a 4TB drive that was originally in a PC connected via SATA. I now wish to put it in an external enclosure and connect it via USB, however this is proving more difficult than I expected, and from what I understand it’s Windows XP’s fault.

On attempting to mount the drive with sudo mount /dev/sdc /mnt, I receive the following error:

mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sdc, missing codepage or helper program, or other error.

The output of fdisk -l is as follows:

Disk /dev/sdc: 3.64 TiB, 4000787025920 bytes, 976754645 sectors
Disk model: Expansion Desk
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/sdc1           1 4294967295 4294967295  16T ee GPT

As can be seen, the disk is detected correctly as a 3.64TiB drive, but there is a partition that’s read as 16TB. This, AFAIK, is because the sectors are incorrectly read as 4096 bytes long when they should be 512 bytes, and this is a thing that external enclosures do to ensure MBR compatibility with Windows XP.

I tried overcoming this by mounting as follows:

$ sudo mount -o ro,offset=$((1*512)) /dev/sdc1 /mnt

however now I have a new error:

mount: /mnt: failed to setup loop device for /dev/sdc1.

Trying to mount with sudo mount /dev/sdc1 /mnt only yields

mount: /mnt: special device /dev/sdc1 does not exist.

I’m at a loss as to how to mount this drive - at least, without reformatting it. Is it at all possible? Once I’ve cracked the code, can I configure /etc/fstab to do it automatically for me, or am I stuck in this limbo-land where I have data on my disk that’s only readable with a hacky workaround? As a last resort, I think I can plug it back in via SATA, copy all 4TB off, plug it in via USB, reformat it and copy everything back on, but I want to avoid that hassle.

Edit: Output of fdisk -l when connected via SATA. Note the sector size is now 512 and the drive mounts happily.

Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HDN724040AL
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: 5852E3A7-A2E4-4589-9D93-F8020C2D7E54

Device     Start        End    Sectors  Size Type
/dev/sdb1   2048 7814035455 7814033408  3.7T Linux filesystem
11 points

Your fdisk output shows a single partition of type ee which according to https://en.wikipedia.org/wiki/GUID_Partition_Table is the type for the protective MBR partition shown by MBR tools when looking at GPT partition tables.

Try using gdisk -l instead of show the GPT partition table.

permalink
report
reply
6 points
*

i have a some sata->usb adapters/enclosures/docks that can’t be used with > 2tb drives or with 4Kn (native 4k sectors, no 512 emulation) drives. i also have a 2-bay cheap nas that can only do 2x1tb or smaller and there’s no new firmware or hacks to ‘fix’ it even though it’s linux under-the-hood.

start with hooking it back up to sata to copy anything on it you want elsewhere, check the filesystem, and run the extended diagnostics.

permalink
report
reply
0 points
*

This is the most likely problem. There is no way the output from fdisk should be different between the two connections (the USB and SATA) if they are both working correctly.

permalink
report
parent
reply
1 point

Probably I’m wrong, but it feels like nobody has read the post. As I understand it’s not a problem between 2 computers, but 1 computer and the drive being connected over USB with an enclosure or normally through SATA.

permalink
report
parent
reply
5 points
*
Deleted by creator
permalink
report
reply
4 points

Commenting because id also like to know.

In my case I resorted to using another enclosure/ adapter

permalink
report
reply

The only enclosure I have that works out of the box is one of those “SATA to USB adaptors” rather than a bona fide “3.5 inch drive enclosure”. It’s not ideal for long-term use.

I wonder if there’s a place to find out if any given make/model of enclosure will report the sector size as 512 bytes. Then, presumably, one could purchase an enclosure off that list and be confident the disk will be readable.

permalink
report
parent
reply
1 point

I dont know either. I used a seagate usb to sata adapter too and that gave me problems with large drives. Nothing on the datasheet mentioned anything, so i had an old backup external drive and swapped the drives to do my formatting/ transfer before putting the original back together

permalink
report
parent
reply
4 points

I have no experience in this specific matter, but you could look up how to switch the sector size from 512 bytes to 4096 and, you know, just do the opposite.

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by AlpĂĄr-Etele MĂ©der, licensed under CC BY 3.0

Community stats

  • 9.8K

    Monthly active users

  • 5.8K

    Posts

  • 162K

    Comments