SATA controller corrupts data, writes secondary GPT in the center of the drive
translate.google.com
translate.google.com
Disk corruption can be hard to detect under Linux because of the disk cache. Remember to drop it before testing backups.
Sharkoon isn't the only one that uses those controllers (Astone might also) and I keep some of them around for testing purposes.
USB to ATA/ATAPI Bridge:
Product ID: 0x2338
Vendor ID: 0x152d (JMicron Technology Corp.)
Version: 1.00
Serial Number: 152D203380B6
Speed: Up to 480 Mb/sec
Manufacturer: JMicron
Location ID: 0x24112000 / 6
Current Available (mA): 500
Current Required (mA): 2If the problem is caused by the controller wrapping at 2tb then I wouldn't expect zfs to figure it out until later when it tries to read files back and finds damage.
Lets say zfs writes a file at 2tb but due to wrapping its actually written to 0 tb. Then zfs reads the file at 2tb to verify that is good. But the file appears to be fine because its really reading it again at 0tb. At some point zfs will detect a problem but I don't see how it can catch the problem instantly.
Whats likely to happen in this case is this: The first blocks of the disk contain the superblock, labels-descriptors and other filesystem metadata. Most of which will be sitting in cache. The damaged overwritten area at 0mb won't be noticed for some time - like next time the volume is mounted. The filesystem will eventually notice the damage and go into some recovery mode or halt to protect itself. Zfs has lots of redundancy so the beginning volume labels could be rebuilt.
One benefit of zfs will be that you can tell which recovered files are good or bad.
(Actually, the real problem is the race to the bottom because most buyers buy on price alone.)
Customer had an external usb/firewire box with a 3tb drive. At 2tb the writes 'wrapped' back to block 0. Its a mac filesystem. Everything worked great until he wrote past 2tb. At that point it overwrote the beginning of the mac volume. The next time he connected the drive the mac thought that it was a new raw drive and told him that he needed to initialize the drive.
This is the second time he did this - the first time he didn't reinitialize it and we got it all back.
Unfortunately this time they initialized the drive. This zeroed out all the metadata, catalogs, maps etc - much bigger mess.
So some bridge controllers cannot handle drives larger than 2tb. 2tb is the last sector that you can address with a 4 byte disk address. So for sectors 0-0xffffffff .....works fine. The next sector is 0x100000000 - 5 bytes, it only sees the lower 4 bytes 0x00000000 and starts overwriting the beginning of the drive.
NTFS filesystems are more recoverable in this situation because their master file table starts 6 million sectors out on the drive so you would have to write alot more data before you start losing all your filenames and folder structures and pointers to the data.