Just imagine this scenario: one day you turn off your pc and you try to turn it on the following day. And it doesn’t or, more precisely, your trustworthy Maxtor/Seagate HDD (Model No. STM3320614AS) is no longer detected during the boot or shows a size of 0GB. You get mad, you get angry. Then you try to figure out how to get your data back.
It appears that, due to a firmware bug, some particular Maxtor and Seagate HDDs lock up their SATA port (BSY bug) or corrupt show as 0 sized (0 LBA). Seagate, which now owns Maxtor, released a firmware update to prevent these errors from happening. If you are not lucky enough to learn about this problem before it appears, fear thou not. You can still try to recover your data by fixing the drive through some tinkering and hacking as described in this excellent and life saving guide, connecting your PC to the HDD via an USB to Serial adapter.
If you own a RaspberryPi (RPi) you don’t need to buy or build such adapter: you can use the RPi’s GPIO port.
What do we need?
- Female-Female single pin Dupont connectors (x3).
- A Raspberry Pi.
- A SATA power source.
Step 1. Preparing the Raspberry Pi.
By default, the RPi uses the UART pins of the GPIO port as a serial console. We need to disable this function in order to use those pins ourselves. As reported here, this is as easy as editing two files when using the Raspbian distribution. But since we’re VeryLazy ™, we can use the script found here.
sudo wget https://raw.github.com/lurch/rpi-serial-console/master/rpi-serial-console -O /usr/bin/rpi-serial-console sudo chmod +x /usr/bin/rpi-serial-console sudo rpi-serial-console disable
Now just reboot the RPi:
Once the RPi is back online, install the minicom software, which we’ll use to communicate with the HDD.
sudo apt-get install minicom
Step 2. Connecting the Raspberry Pi to the HDD.
Be sure the HDD is not powered (i.e. do not connect the SATA power cable just yet). Connect the Dupont connectors to the GND, GPIO 14 (TX) and GPIO 15 (RX) pins on the GPIO. They should be the pins 6, 8 and 10 respectively. Please check the Raspberry Pi documentation if you are not sure.
Now connect the cable from the GND pin on the RPi to the GND jumper pin on the HDD, the TX on the RPi to the RX on the HDD and the RX on the RPi to the TX on the HDD.
Step 3. Starting the terminal and fixing the drive.
Now that everything is set up, we need to connect to the HDD using minicom. This is as simple as issuing the following command:
minicom -b 38400 -o -D /dev/ttyAMA0
Now plug the SATA power cable and wait a few seconds. Press CTRL+Z. You should see a prompt like “F3 T>”. Now you’re ready to follow the instructions to fix the HDD, which are explained here. Once you’ve recovered your data, try to update the firmware of your HDD.
If you’re unable to see the prompt, you probably connected the RX and TX cables to the wrong pins on the HDD. Just swap the RX with the TX and you should be good to go! If you are still having troubles, just leave a comment here and I’ll try to help.
Note: even though my HDD is labelled as a STM3320614AS on the sticker attached over it, the system reports it as a STM3320613AS. Because of this, I’m not able to update the firmware. Did anybody have a similar experience and knows how to proceed?
Disclaimer: please, follow this guide at your own risk. I’m not responsible for any damage you cause to your stuff.