All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 4th, 2019, 19:57 
Offline

Joined: September 15th, 2017, 4:48
Posts: 25
Location: Ukraine, Lugansk city
Hello and Happy New Year friends!

I have a whole bunch of refurbished (arco/selfscan) WD Royl drives which are about to be sold to a reseller. The thing about all this is that the SMART attributes of the drives were zeroed after performing arco/selfcan tests. I don't want the reseller to sell them as brand-new drives so I decided to change the "Power-on-hours" and "Start/stop count" SMART attributes to their original values.

At first I wanted to write back the native 21-th modules and clear G+Relo list but this only worked for a very few drives. Clearing G+Relo affects RAW values of "Relocated sector count", "Relocated event count" and "Current pending sector" attributes but does nothing to "WORST" column and other attributes (such as "Raw read error rate" etc)

Eventually, I decided that the best option would be to find the offsets of the "Power-on-hours" and "Start/stop count" attributes in 21th module and change them to original values manually. So I compared 21th modules of the same drive before and after resseting the SMART data (recently-reseted 21-th VS same module copied after a few hours of being powered-on) in HEX editor but the difference was SO huge that I am at a loss.

How do I find the needed offsets? Gimme a clue guys.


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 4th, 2019, 20:02 
Offline
User avatar

Joined: April 3rd, 2011, 0:19
Posts: 1877
Location: Providence, RI
I doubt anyone has ever taken the time to deconstruct S.M.A.R.T. modules in great detail. Beyond clearing/disabling it there isn't much benefit from a data recovery standpoint to figure this all out.

You're probably the first person to ever care about setting back those values.

_________________
Data Medics - Hard Drive, SSD, and RAID Data Recovery Service Company


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 4th, 2019, 21:22 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 11075
Location: Australia
Extracting SMART data from WD MODs 20 - 26:
http://www.hddoracle.com/viewtopic.php?f=22&t=968

If my ugly source code is too hard to understand, let me know and I'll try to explain it.

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 4th, 2019, 21:30 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 11075
Location: Australia
Extracting SMART data from WD MODs 20 - 26:
http://www.hddoracle.com/viewtopic.php?f=22&t=968

If my ugly source code is too hard to understand, let me know and I'll try to explain it.

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 5th, 2019, 15:05 
Offline

Joined: September 15th, 2017, 4:48
Posts: 25
Location: Ukraine, Lugansk city
fzabkar wrote:
Extracting SMART data from WD MODs 20 - 26:
http://www.hddoracle.com/viewtopic.php?f=22&t=968

If my ugly source code is too hard to understand, let me know and I'll try to explain it.


Thank you friend for sharing your tool. There is no problems with running your awesome utility cause a long while ago you shared your wdromv11 tool with me and taught me how to run utilities like these. Just one question, does the "Flg" column indicate the offsets I am looking for? If it doesn't, how do I interpret those hex characters?

Image


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 5th, 2019, 16:44 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 11075
Location: Australia
Can you upload module 0x21?

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 5th, 2019, 16:52 
Offline
User avatar

Joined: December 19th, 2006, 8:49
Posts: 10322
Location: Portugal
It might be easy to replace the module template that is used when clearing S.M.A.R.T. to the values that you do need for the drive to have and execute the VSC to clear S.M.A.R.T. otherwise you might have "problems" editing module 21 as the values might not survive a power cycle if they "stick" at all to start with.

_________________
1Q9xrDTzTddUXeJAFRn37aqh1Yr6buDCdw - (Bitcoin Donations)
paypal.me/Spildit - (PayPal Donations)
The HDD Oracle - Platform for OPEN research on Data Recovery.


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 5th, 2019, 16:59 
Offline

Joined: September 15th, 2017, 4:48
Posts: 25
Location: Ukraine, Lugansk city
fzabkar wrote:
Can you upload module 0x21?


Sure


Attachments:
21.zip [2.57 KiB]
Downloaded 4 times
Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 5th, 2019, 17:12 
Offline

Joined: September 15th, 2017, 4:48
Posts: 25
Location: Ukraine, Lugansk city
Spildit wrote:
It might be easy to replace the module template that is used when clearing S.M.A.R.T. to the values that you do need for the drive to have and execute the VSC to clear S.M.A.R.T. otherwise you might have "problems" editing module 21 as the values might not survive a power cycle if they "stick" at all to start with.


Which module do I have to edit, 22, 23,24, 25 or 26? And how do I find the needed offsets? Sorry if I sound retarded but I honestly have never done any reseach on SMART modules architecture :)


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 5th, 2019, 17:49 
Offline
User avatar

Joined: December 19th, 2006, 8:49
Posts: 10322
Location: Portugal
Here it is the procedure :

1 - Write patched module 23.

2 - Clear S.M.A.R.T. .

3 - Done.

It's the way i did found to work for me.

23 is the S.M.A.R.T. template that will be used when you clear S.M.A.R.T.

The FLAGS are NOT the offsets.

Whait for @fzabkar to answer about how to change the desired valus that you do want to change on your S.M.A.R.T. module. When you do have your module patched just write it to 23 and use the command to clear S.M.A.R.T.

_________________
1Q9xrDTzTddUXeJAFRn37aqh1Yr6buDCdw - (Bitcoin Donations)
paypal.me/Spildit - (PayPal Donations)
The HDD Oracle - Platform for OPEN research on Data Recovery.


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 5th, 2019, 18:19 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 11075
Location: Australia
Here is the table of SMART attributes:

Code:
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B

00003FB4              01 2F 00 64 FD 00 00 00
00003FC0  00 00 00 00 03 27 00 64 FD 00 00 00
00003FCC  00 00 00 00 04 32 00 64 64 00 00 00
00003FD8  00 00 00 00 05 33 00 C8 C8 00 00 00
00003FE4  00 00 00 00 07 2E 00 64 FD 00 00 00
00003FF0  00 00 00 00 09 32 00 64 64 01 00 00
00003FFC  00 00 00 00 0A 32 00 64 FD 00 00 00
00004008  00 00 00 00 0B 32 00 64 FD 00 00 00
00004014  00 00 00 00 0C 32 00 64 64 00 00 00
00004020  00 00 00 00 B8 B2 00 64 64 00 00 00
0000402C  00 00 00 00 BB B2 00 64 64 00 00 00
00004038  00 00 00 00 BC B2 00 64 64 00 00 00
00004044  00 00 00 00 BE A2 00 3B 3B 29 00 00
00004050  00 00 00 00 C0 32 00 C8 C8 00 00 00
0000405C  00 00 00 00 C1 32 00 C8 C8 05 00 00
00004068  00 00 00 00 C2 22 00 6A 6A 29 00 00
00004074  00 00 00 00 C3 B6 00 64 FD 00 00 00
00004080  00 00 00 00 C4 32 00 C8 C8 00 00 00
0000408C  00 00 00 00 C5 32 00 C8 C8 33 00 00
00004098  00 00 00 00 C6 30 00 64 FD 00 00 00
000040A4  00 00 00 00 C7 32 00 C8 FD 00 00 00
000040B0  00 00 00 00 C8 08 00 64 FD 00 00 00
000040BC  00 00 00 00 F0 B2 00 64 64 01 00 00
000040C8  00 00 00 00 F1 B2 00 C8 C8 0B 00 00
000040D4  00 00 00 00 F2 B2 00 C8 C8 1F 02 00
000040E0  00 00 00 00

It's easier to make sense of it if you choose 12 bytes per line in your hex editor.

Each attribute record has the following format:

    ID (1 byte)
    Type (or flags, 1 byte)
    Null byte ???
    Current Normalised Value (1 byte)
    Worst Normalised Value (1 byte)
    Raw data (little-endian, 7 bytes)

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Editing some S.M.A.R.T. values on WD-Royl drives
PostPosted: January 5th, 2019, 18:42 
Offline

Joined: September 15th, 2017, 4:48
Posts: 25
Location: Ukraine, Lugansk city
Yeahhh I got it! Thank you guys for taking your time to guide me and help me learn! People like you both are the ones who make this forum a great pleace to be a part of!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google Adsense [Bot] and 52 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