Switch to full style
In-depth technology research: finding new ways to recover data, accessing firmware, writing programs, reading bits off the platter, recovering data from dust.

Forum rules

Please do not post questions about data recovery cases here (use this forum instead). This forum is for topics on finding new ways to recover data. Accessing firmware, writing programs, reading bits off the platter, recovering data from dust...
Post a reply

STUart - Seagate sectors over UART driver

August 24th, 2016, 16:26

Hello,

While trying to recover my ST2000DL003 drive I have adapted a BUSE userspace linux block driver.

The block driver handles data as addressable blocks. The userspace client allows the addressing for any application - what about receiving blocks from a faulty Seagate drive.

How this works:

You can learn some of functioning from source code itself, but main sequence of operation is:
  • STUart (userspace driver) inicialize HDD parameters ("/TO1", speed, etc.)
  • STUart connects to NBD (network block device) driver in kernel
  • When you open /dev/nbdX at some address, the NBD driver creates demand with an offset and a block(s) size.
  • STUart compute LBA sector (4k) and number of how many is needed to read
  • By "/ARxxxx", the HDD sectors are read
  • From a drive buffer, the data are transfered over UART by "/FD" command. As console is in a binary mode the sectors are transfered at full UART speed.
  • STUart then parses raw 4k sector data (512B subsector + 2 crc? + 6 thrash? + 512B subsector + 2 crc + 6 thrash ...) into 512B block request
  • ... and sends them to the kernel driver and waits on another request
Funny thing about STUart is you can actually mount /dev/nbdX as HDD and copy some data from it (very slowly, but most likely safer than "/Ti" and/or "/Tm" commands) and mounting is faster than whole drive imaging (it would take about half a year to download whole 2 TB :-/ in my case the drive was partitioned to 4 partitions and only 2 of them are filled with data - around 26%).

Due to a block based adressing you can just skip any bad sectors and continue to copy the data (although you must do it manually as STUart will crash probably). Download speed is pretty slow - about 34kBps of the filesystem with 460kbps UART. My drive supports up to 1.25 Mbps so maximum speed is probably nearly 100kBps. Up to this date it have worked with only one data retrieval failure (probably UART buffer overrun) and transfer run for several hours.

I'm pretty sure that there are similar functionalities in commercial software, but I'm offering you a GPLed source code (as is). If someone wants to maintain this software, I'm OK with it (after recovering all my files I hope I will never need to use it again ;-) ).

If you find my driver useful, you can help me with my drive http://forum.hddguru.com/viewtopic.php?f=1&t=34001 or you can send me some bitcoins ;-)

1HrSeYBcScVunpw6uKWk6Xo81LBZy3ARYo
Attachments
stuart-0.1.tar.bz2
Seagate UART linux block driver
(13.57 KiB) Downloaded 383 times

Re: STUart - Seagate sectors over UART driver

August 24th, 2016, 19:14

Thanks.

You can change the baud rate in two ways.

At level T you can specify the baud rate and delay in msec for the host to respond with a carriage return.

    B[rate in decimal], [delay in msec]

The same command at level F is ...

    b[rate in decimal], [delay in msec]

Note the difference in case.

If you specify an unsupported rate, then you will get a list of supported rates.

The delay parameter is optional.

Re: STUart - Seagate sectors over UART driver

August 25th, 2016, 13:07

I know, but my UART dongle supports only max speed of ~400 kbps and you cannot guess which baudrate is actually set in congen.

Re: STUart - Seagate sectors over UART driver

August 10th, 2017, 7:57

Thank you for sharing the driver.

Can someone please explain how to find the "User Data Base" start LBA address??

Ie, the #define for BASE_512 (0x00991590) in busexmp.c, I do not see it reported in the boot messages on my drive.

Re: STUart - Seagate sectors over UART driver

August 10th, 2017, 8:28

nvm got it, in case anyone is looking BASE_512 is found in the output from "/CU":

Level C 'U': Rev 0002.0000, Overlay, Display / modify media cache
F3 C>U

User Data Base 0043C830
...

Re: STUart - Seagate sectors over UART driver

January 21st, 2018, 7:39

Is there a serial command to show the partition offsets in the drive (for the #define START_512 and #define LEN_512)? I've got a NTFS drive with two partitions that won't show in Win Disk Manger or mount in Linux. The drive seem to be responding to /AR and /FD command though. Also, where does the first bit (the Hi Addr 405B8600) come from in "/FD405B8600,,,1040,1,"?

/FD: Memory Block Display, D [AddrHi], [AddrLo], [CompVal], [NumBytes], [Opts], [SizeInBytes]

Re: STUart - Seagate sectors over UART driver

January 21st, 2018, 7:50

Top-Dog wrote:Is there a serial command to show the partition offsets in the drive (for the #define START_512 and #define LEN_512)? I've got a NTFS drive with two partitions that won't show in Win Disk Manger or mount in Linux.


Not sure the controller works with the PC partition table in such a way, the partition table is an operating system thing. LBA devices (AFAIK) provide simple block access from block 0 to <disk_size> - the DOS partition table exists on top of that, as a data structure inside of the MBR (which begins at LBA block #0).
Post a reply