I recently transferred a whole bunch of data onto a HFS+ hard drive as a backup for a reinstall of a Mac machine. After the reinstall was done, I wanted to load all the data back onto my machine. The (external) hard drive was not recognized by the machine anymore though.
diskutil
, system report, nothing.__
output of fdisk -l
:
Disk /dev/sdb: 1,8 TiB, 2000398934016 bytes, 3907029168 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: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2 488378644 488378643 232,9G af HFS / HFS+
Partition 1 does not start on physical sector boundary.
And this is what the GUI shows me on Debian
I am suspecting (and hoping) something went wrong with the partition table or something similar that can be reconstructed. Anyone has any ideas? Unfortunately, there are 500gb of private memories on this drive and my NAS failed a few days earlier, which is why this was my last backup... I was getting ready for the new NAS :-X
thanks, Pascal
At least part of your problem is likely caused by sector-size issues. The vast majority of hard disks use 512-byte logical sector size on their native (usually SATA) interfaces. (Note that the "physical" sector size reported by fdisk
is irrelevant to this discussion.) Many external USB enclosures "translate" sets of eight 512-byte sectors into one 4096-byte sector. This enables over-2TiB disks to be used with the old Master Boot Record (MBR) partitioning system, and I suspect it's also necessary to fully address the disks over a USB interface, at least with certain enclosures.
Thus, I think that what happened was that your disk was partitioned via a USB interface that did this translation, which meant that your disk had approximately 488,378,646 4096-byte sectors; however, when you plugged it directly into a computer's SATA port, it was read as having 3,907,029,168 512-byte sectors. (That value's from your fdisk
output.) The partition table was written with the assumption of fewer but bigger sectors. Because partition tables record partition starting points and sizes in number of sectors but don't provide any hint about the size of the sectors, you end up seeing the mis-match you've identified.
Fundamentally, there are two fixes to this problem:
fdisk
, but you'll almost certainly have to change the alignment policy. This used to be possible, but when I tried it just now with the fdisk
in Ubuntu 16.04, I didn't see the option to change alignment. Your best bet might be to find an older version of fdisk
, either by compiling it from source code in an archive or by using an old emergency or installation disk. Alternatively, you could delete the existing partition with fdisk
and then rely on TestDisk or something similar to recover the partition using the current disk sector size. This is a bit hit-or-miss, but it will probably work.The second option should work; however, if you make a mistake or run into some unexpected problem, you might end up making matters worse, especially if you write to the altered partition. Also, this option will lock you into using the disk either directly via SATA or via a USB enclosure that does not do sector-size translation. Overall, therefore, I recommend you focus on the first option. This may require buying a replacement enclosure.
User contributions licensed under CC BY-SA 3.0