All times are UTC - 5 hours [ DST ]


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 new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: STUart - Seagate sectors over UART driver
PostPosted: August 24th, 2016, 16:26 
Offline

Joined: August 15th, 2016, 6:05
Posts: 15
Location: Czech Republic
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:
File comment: Seagate UART linux block driver
stuart-0.1.tar.bz2 [13.57 KiB]
Downloaded 1311 times

_________________
Support opensource code reverse engineering tool radare2.
Top
 Profile  
 
 Post subject: Re: STUart - Seagate sectors over UART driver
PostPosted: August 24th, 2016, 19:14 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 15463
Location: Australia
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.

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: STUart - Seagate sectors over UART driver
PostPosted: August 25th, 2016, 13:07 
Offline

Joined: August 15th, 2016, 6:05
Posts: 15
Location: Czech Republic
I know, but my UART dongle supports only max speed of ~400 kbps and you cannot guess which baudrate is actually set in congen.

_________________
Support opensource code reverse engineering tool radare2.


Top
 Profile  
 
 Post subject: Re: STUart - Seagate sectors over UART driver
PostPosted: August 10th, 2017, 7:57 
Offline

Joined: August 10th, 2017, 0:44
Posts: 6
Location: New Zealand
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.


Top
 Profile  
 
 Post subject: Re: STUart - Seagate sectors over UART driver
PostPosted: August 10th, 2017, 8:28 
Offline

Joined: August 10th, 2017, 0:44
Posts: 6
Location: New Zealand
nvm got it, in case anyone is looking BASE_512 is found in the output from "/CU":

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

User Data Base 0043C830
...


Top
 Profile  
 
 Post subject: Re: STUart - Seagate sectors over UART driver
PostPosted: January 21st, 2018, 7:39 
Offline

Joined: January 21st, 2018, 6:24
Posts: 1
Location: New Zealand
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]


Top
 Profile  
 
 Post subject: Re: STUart - Seagate sectors over UART driver
PostPosted: January 21st, 2018, 7:50 
Offline

Joined: August 10th, 2017, 0:44
Posts: 6
Location: New Zealand
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).


Top
 Profile  
 
 Post subject: Re: STUart - Seagate sectors over UART driver
PostPosted: December 18th, 2018, 17:49 
Offline

Joined: August 15th, 2016, 6:05
Posts: 15
Location: Czech Republic
Yeah these values are taken from partition table. Just for the sake of the mountable partition.

_________________
Support opensource code reverse engineering tool radare2.


Top
 Profile  
 
 Post subject: Re: STUart - Seagate sectors over UART driver
PostPosted: February 27th, 2019, 5:15 
Offline

Joined: October 3rd, 2005, 0:40
Posts: 4311
Location: Hungary
Quote:
(very slowly, but most likely safer than "/Ti" and/or "/Tm" commands)


running a defective drive for weeks or months is not what i would say to be safe either.
There are good process steps taking us to the data in a safer and more timely manner.

However, the util is a nice idea on the other hand, congrats.

pepe

_________________
Adatmentés - Data recovery


Top
 Profile  
 
 Post subject: Re: STUart - Seagate sectors over UART driver
PostPosted: February 19th, 2020, 4:36 
Offline

Joined: August 15th, 2016, 6:05
Posts: 15
Location: Czech Republic
pepe wrote:
Quote:
(very slowly, but most likely safer than "/Ti" and/or "/Tm" commands)


running a defective drive for weeks or months is not what i would say to be safe either.
There are good process steps taking us to the data in a safer and more timely manner.

However, the util is a nice idea on the other hand, congrats.

pepe

Actually it is "years" by now :-D, my ST2000DL003 went "No HOST FIS" in 2012. It didn't contain any really important data, so I didn't bother to sent it to drive repair facility, but the data were important enough to not try any hazardous commands which were around the internet in 2012. But if it is possible to restore SATA functionality in some easy and safe (for data) way with just console commands I'm one big ear :-D.

Still, I've managed to recover many data by this program. And lately I was playing with usb classes in MCU so I've decided to peek at this problem once more time.

Here is the updated version compatible with the fastest transmission speed and with CRC checking.


Attachments:
stuart-0.9.tar.bz2 [17.35 KiB]
Downloaded 749 times

_________________
Support opensource code reverse engineering tool radare2.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group