<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Some stuff &#187; seagate drive</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=seagate-drive" rel="self" type="application/rss+xml" />
	<link>https://blog.yhuang.org</link>
	<description>here.</description>
	<lastBuildDate>Wed, 27 Aug 2025 08:50:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Today I can go no farther (part 6)</title>
		<link>https://blog.yhuang.org/?p=46</link>
		<comments>https://blog.yhuang.org/?p=46#comments</comments>
		<pubDate>Sun, 31 Dec 2006 03:53:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[certificate store]]></category>
		<category><![CDATA[ddrescue]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[external storage device]]></category>
		<category><![CDATA[hard disk recovery]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[logical conclusion]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[Seagate]]></category>
		<category><![CDATA[seagate drive]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=46</guid>
		<description><![CDATA[This is part of the hard disk recovery documentation. Part 6. Today I can go no farther (so I stopped) The last days of this project are spent on two tiring tasks that do not gain me very much, but must be done to carry this project to its logical conclusion. One of these is [...]]]></description>
			<content:encoded><![CDATA[<p>This is part of the hard disk recovery documentation.</p>
<p>Part 6.</p>
<p><font color="#770033"><br />
Today I can go no farther (so I stopped)</p>
<p>The last days of this project are spent on two tiring tasks that do not gain me very much, but must be done to carry this project to its logical conclusion. One of these is to decrypt a few very small, but important NTFS-encrypted files. The other is to wring the last readable bits out of the broken Seagate drive by splitting all the error regions to isolate the unreadable regions as much as possible. These can proceed in parallel.</font><br />
<span id="more-46"></span><br />
<font color="#770033">I set Knoppix to slave away on the broken Seagate drive using ddrescue again. This ended up taking more than one day constantly running and made the disk really hot. I had to manually intervene from time to time just so this will get somewhere. This is where I wished ddrescue was smarter about skipping around unreadable regions.</p>
<p>The other task was more interesting from a learning perspective. When a file is to be encrypted by NTFS, it generates a file-specific symmetric &#8220;file encryption key&#8221; and stores the key with the file. Of course the key isn&#8217;t stored in plaintext but is encrypted using the user&#8217;s public key and is only decodeable by the user&#8217;s private key. Normally the user should export the private key into a .pfx certificate file and store it on a smart card or USB pen drive or something, and more importantly, remove it from the certificate store on Windows. I did make a copy of the private key off the computer. I could just re-import the certificate, and then decrypting the data would be trivial. But the external storage device that holds the private key isn&#8217;t with me during the break, unfortunately. On the other hand, I didn&#8217;t bother to remove the private key from the computer either, because I wasn&#8217;t really serious about this particular piece of data, just toying around with the NTFS encryption feature, mostly.</p>
<p>That made the encrypted file potentially recoverable without delay. Windows doesn&#8217;t store the user&#8217;s private key in plaintext either, of course. From what I understand, the user&#8217;s private key is encrypted somehow with user&#8217;s password hash, then maybe it is encrypted again with a master key belonging to the system. Somehow, the system&#8217;s master key is the weak link. I think it is stored in the SAM database of the system registry, which is in %SYSTEMROOT%\system32\config, though I may be mistaken on this point. The user&#8217;s various keys are stored in %USERPROFILE%\Application Data\Microsoft\Protect and %USERPROFILE%\Application Data\Microsoft\Crypto. Here is <a href="http://www.beginningtoseethelight.org/efsrecovery/index.php">another explanation</a> of this.</p>
<p>To make a long story short, if all of these files are available, and the user&#8217;s password is known, then it is possible to recover the encrypted files directly from the drive without an explicitly exported private key (hence encryption with these files around is ultimately pointless).</p>
<p>I ended up using the <a href="http://www.elcomsoft.com/aefsdr.html">Elcomsoft Advanced EFS Data Recovery</a> tool (AEFSDR). They have a trial version, too. Unfortunately it&#8217;s crippleware, unlike Mount Image Pro. All I can say is, if you really want to decrypt files, you find a way around the &#8220;cripple&#8221; in crippleware. Enough said.</p>
<p>For the record, AEFSDR is pretty good and fast. However, I am also not completely satisfied by it. I haven&#8217;t found any bugs, but the problem with it is its incompleteness. I don&#8217;t know what file system access method it uses, but it cannot see any removable drives, including removable USB drives or any mounted virtual disks (e.g. by Mount Image Pro). This is severely limiting, because encrypted files are not easily copied (Windows says Permission Denied), and I basically ran into a wall because of this. Please, AEFSDR, go work on this some more. You are selling a <b>recovery</b> tool, so your users are most likely in desperate straits with limited resources&#8230; they don&#8217;t want to deal with your programming kludges.</p>
<p>The way around it is to use NTBACKUP (part of Windows), which can archive encrypted files to a backup image, and then you can restore these files onto a permanent physical disk. After also copying the security related files from Windows to a permanent physical disk, AEFSDR decrypts all files successfully.</p>
<p>RELOADING THE DDRESCUE IMAGE</p>
<p>After I got as much as I am ever going to get out of the Seagate disk using ddrescue (I got another few tens of megabytes out of the disk), I retraced the steps on the new image. This time, the image loads as a valid NTFS partition and Windows will read it (apparently the last few bits recovered was pretty important). However, the Windows directory is still not readable, although almost all other directories are directly readable. NFI also works on the image &#8212; this is very good, as it means I can finally profile what I lost down to the last sector. I also ran chkdsk on it again &#8212; fewer errors to correct this time, but hopefully fewer zero-filled data issues to deal with at the end of the day. This chkdsk&#8217;d image is now the gold recovery image. I backed it up immediately.</p>
<p>That is the end of it. The story has a happy ending, but what a giant waste of time. Back up your data.</font></p>
<p>Lessons today:</p>
<ul>
<li>AEFSDR is nice. But I wouldn&#8217;t buy it, either.</li>
<li>Remove your private keys from the computer.</li>
<li>Near total data recovery is very possible from an apparently dead drive, but a delicate procedure needs to be followed.</li>
<li>The right tools are very important, and a complete disk recovery toolchain simply does not exist &#8212; you are left to find your own pieces.</li>
</ul>
<p>On to <a href="http://scripts.mit.edu/~zong/wpress/?p=47">the Appendix</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=46</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The tide turns (part 5)</title>
		<link>https://blog.yhuang.org/?p=45</link>
		<comments>https://blog.yhuang.org/?p=45#comments</comments>
		<pubDate>Thu, 28 Dec 2006 15:13:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[ext2 partition]]></category>
		<category><![CDATA[external usb drive]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[knoppix linux]]></category>
		<category><![CDATA[letter]]></category>
		<category><![CDATA[mode]]></category>
		<category><![CDATA[ntfs partition]]></category>
		<category><![CDATA[seagate drive]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=45</guid>
		<description><![CDATA[This is part of the hard disk recovery documentation. Part 5. The tide turns (rather quickly) After the exceedingly annoying but ultimately inconsequential ext2 interlude, I&#8217;m back on track with the original problem of recovering data from the broken Seagate drive. After the disaster with file-copying using the Windows ext2ifs driver last time, I made [...]]]></description>
			<content:encoded><![CDATA[<p>This is part of the hard disk recovery documentation.</p>
<p>Part 5.</p>
<p><font color="#770033"><br />
The tide turns (rather quickly)</p>
<p>After the exceedingly annoying but ultimately inconsequential ext2 interlude, I&#8217;m back on track with the original problem of recovering data from the broken Seagate drive.</font><br />
<span id="more-45"></span><br />
<font color="#770033">After the disaster with file-copying using the Windows ext2ifs driver last time, I made sure to make a copy of the disk image while the external USB drive holding it was mounted under Knoppix Linux. The destination was another external drive formatted with ext2.</p>
<p>Then I took the copy of the image under Windows. This way I didn&#8217;t care what the ext2ifs driver wanted to do. But this time it didn&#8217;t mangle the partition (probably because this ext2 partition actually has a legal physical formatting!).</p>
<p>Finally I can run NTFS tools on the broken disk, but I need to mount the (broken) NTFS image first. There is a free tool, <a href="http://www.acc.umu.se/~bosse/">FileDisk</a> by Bo Branten, to do this. Unfortunately, it gives a drive letter to the whole disk, instead of to the partitions. This is nearly impossible to work with because (1) there are 63 sectors of MBR, partition table, and filler at the front of the disk, and (2) there is the Dell diagnostic partition. And FileDisk doesn&#8217;t virtualize a physical disk device, which would be the more correct metaphor.</p>
<p>A way around this is to use VMWare, and virtualize the disk image as a disk. But no, that&#8217;s too much trouble&#8230; although, after this incident, I&#8217;m really considering putting a VMWare image with Windows preinstalled onto a DVD or something &#8212; that would be the complement to Knoppix.</p>
<p>A somewhat more advanced tool called <a href="http://www.mountimage.com/">Mount Image Pro</a> (MIP) exists that does what I want. It isn&#8217;t free (<a href="#footnote">*</a>), but who cares when there is a one-month trial? (For the record, I&#8217;m not entirely happy with this thing, either. It works, but almost every other time it fails to load the system driver and requires a reboot and retry.)</p>
<p>With MIP, the NTFS partition comes up and is mounted under K:, but it is completely broken as expected. The file system cannot be read normally by Windows, nor would the diagnostic tool NFI (part of the <a href="http://support.microsoft.com/kb/253066">OEM Support Tools</a>) work on it. NFI relates what files a sector contains and what sectors a file resides in.</p>
<p>The next step is then to run chkdsk:</p>
<p>  > chkdsk /v K:</p>
<p>Very specific errors relating to the file table are immediately detected and chkdsk says it cannot continue in the (default) read-only mode.</p>
<p>So let&#8217;s try</p>
<p>  > chkdsk /v /r K:</p>
<p>Same complaint by chkdsk. What? It turns out MIP (at least the GUI) only mounts images in read-only mode, but it doesn&#8217;t specify this anywhere! Nor does it give an indication of how to get around this. Wow great.</p>
<p>After poking around, I noticed there is a command-line interface to MIP, too, and it is there that you can specify mounting in &#8220;read-write&#8221; mode, instead of &#8220;write-block&#8221; mode. (I would also call &#8220;write-block&#8221; mode &#8220;read-only&#8221; mode, but that&#8217;s just me, so what do I know!) Moving on:</p>
<p>  > mip mount rescue.image /rw /p:2 /l:K</p>
<p>Finally, the second partition in the disk image is mounted on the drive letter K: (hence the last two parameters). Unfortunately, MIP screws up again and says there is only &#8220;1&#8243; partition, and the drive letter K is associated with the first, Dell diagnostic, partition&#8230; even though it clearly displays two partitions and that the drive letter K is in reality associated with the second partition. No matter, it still works, so I&#8217;ll leave the MIP people unflogged. But they should still go home and fix these.</p>
<p>Trying chkdsk again and it slaves away through a 5-step process, dumping output on all the files and directories on which it detected problems. The disk image is broken enough that chkdsk had to kill most of the NTFS file permission. After about 2 or 3 hours, K: is miraculously readable again in Windows, with the basic directory structure at first glance intact. Very glaring, however, was that K:\windows isn&#8217;t there. There is a new K:\found.000 folder with all the directory trees that lost their names (but otherwise fairly intact) re-rooted there. There were 30+ such re-rooted directories, and it was trivial to find the one that should be K:\windows.</p>
<p>Running through the directories on the disk image that had been combed over by chkdsk, everything was readable and accessible. I&#8217;m more worried about the data parts that got zero-filled by ddrescue, which makes for a much more insidious type of data corruption. On the other hand, I am comforted by the high percentage of data that must not be zero-filled based on the percentage of raw recovered bits recovered by ddrescue. Also, anything that chkdsk had a problem with (in the file table) must have been due to zero-filling. Thus, the more problems chkdsk found, the less problems remain in the data portion, so statistically I am satisfied. With NFI, the extent of the damage at the file level can be ascertained precisely, but for all practical purposes, the recovery is near total. Certainly, all the files that I care about (defined as those not &#8220;easily&#8221; regenerated), which was maybe 20GB of the 40GB, are recovered, including really small text files to fairly large (hundreds of MB) NTFS compressed files.</p>
<p>There is a lot more to do and this project is far from over, but I can see the end-game now, and so the recovery effort can be declared a success.</font></p>
<p>Lessons today:</p>
<ul>
<li>MIP is pretty useful, but I still won&#8217;t buy it.</li>
<li>NTFS is truly robust, and the NTFS version of chkdsk is remarkable.</li>
</ul>
<p>On to <a href="http://scripts.mit.edu/~zong/wpress/?p=46">Part 6</a>.</p>
<p><a name=footnote>*</a> Edit: I&#8217;ve since found a free tool called <a href="http://chitchat.at.infoseek.co.jp/vmware/vdk.html">vdk</a> that makes Mount Image Pro obsolete. Yes, it mounts ddrescue images. Yay!</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=45</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
