Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a SATA hard drive in a USB HDD enclosure, which works well with Windows. Recently I started using it in Linux and something went wrong.
When I write a huge block of data into that drive, the writing process will report that everything is fine. But when I read it back, there is a data corruption about every several GBs, and sometimes even more. The kernel will report an I/O error and a USB disconnected event. The USB HDD enclosure then reconnects again, looks like it has restarted.
If I connect the hard drive to a internal SATA port and do the same read operation, I see a lot of SATA UNC errors.
I've done a lot of tests and here are my results:
-- If data is written while the hard drive is directly connected to an internal SATA port, there will be no data corruption.
-- If data is written while the hard drive is in the HDD enclosure, but under Windows, there will be no data corruption either.
-- Those sectors are not really physically broken. A correct overwrite operation (either with an internal SATA port, or under windows) will fix them.
-- This error is reproducible, although actual positions of broken sectors will be different. I can reproduce it with my debian laptop and Raspberry Pi. And data corruption happens regardless of whether writing is performed in a mounted ext4/NTFS filesystem or directly to the raw device.
I have no other HDD enclosures to test, and I'm not sure if it's a hardware problem or a driver bug.
Does anyone have experience with such problems before? What can I do to fix the problem? Or do I have to buy a new HDD enclosure?