<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Fat32 on RESEARCHUT</title><link>https://researchut.com/tags/fat32/</link><description>Recent content in Fat32 on RESEARCHUT</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>rrs@researchut.com (Ritesh Raj Sarraf)</managingEditor><webMaster>rrs@researchut.com (Ritesh Raj Sarraf)</webMaster><lastBuildDate>Tue, 16 Aug 2011 16:29:49 -0400</lastBuildDate><atom:link href="https://researchut.com/tags/fat32/index.xml" rel="self" type="application/rss+xml"/><item><title>File System corruption and Recovery</title><link>https://researchut.com/blog/fat-data-recovery/</link><pubDate>Tue, 16 Aug 2011 16:29:49 -0400</pubDate><author>rrs@researchut.com (Ritesh Raj Sarraf)</author><guid>https://researchut.com/blog/fat-data-recovery/</guid><description>&lt;p>So this is the 2nd time I ran into a problem like this again. My FAT32 file
system on the external USB HDD, all of a sudden, started reporting:&lt;/p>
&lt;p>00:47:32 rrs@champaran:/tmp$ sudo dosfsck /dev/sdb1dosfsck 3.0.9, 31 Jan 2010,
FAT32, LFNLogical sector size is zero.&lt;/p>
&lt;p>I had been taking a lot of care to ensure that I don&amp;rsquo;t run into situation like
this. No body likes losing data. The good part is that I&amp;rsquo;ve been lucky enough
that, even without backups (now who&amp;rsquo;s gonna backup a backup disk), I have
recovered all my data. All thanks to Christophe GRENIER for Testdisk.&lt;/p>
&lt;h2 id="so-what-caused-the-problem">So what caused the problem&lt;/h2>
&lt;p>I don&amp;rsquo;t know. I do remember what I did last that must have triggered the
problem. I started 5 copy operations from my Laptop HDD to the External HDD
(FAT32 which got corrupted) using the File Manager, effectively triggering a
random write for the I/O Scheduler.&lt;/p>
&lt;p>And at the very same time, I was also running Handbrake to try re-encode a
corrupted MP4 video from my camera - CPU Intensive task.&lt;/p>
&lt;p>Well nothing RTOS or Mission critical, but unfortunately, the linux kernel
couldn&amp;rsquo;t take much. The moment it ran out of VM, it started paging. And looks
like paging is the ugliest state for the linux kernel. Because the moment it
starts paging, you have a very high probability of hitting an OOM. And that&amp;rsquo;s
what happened in my case.&lt;/p>
&lt;p>I wish Linux actually thawed processes instead of trying to give every a fair
share, and thus ending up in an OOM situation. But anyways, having become good
at predicting Linux&amp;rsquo;s behavior, I decided to not touch the laptop at all. Left
it as it is over night thinking it would eventually trigger OOM and the prime
candidate would be Handbrake. And once Handbrake is killed, everything would
recover.&lt;/p>
&lt;p>In the morning, every thing was back to normal. The HDD was idle and showed no
more signs of the paging abuse the kernel did last night. The only evidence
was syslog which did impress me for my predictability of Linux&amp;rsquo;s OOM. The
kernel did trigger OOM and just kill the most abusive (CPU intensive) process,
Handbrake, and everything else had recovered to normal.&lt;/p>
&lt;p>Well. All good. I did not have to reboot my laptop. So just hibernated and
pushed to work.&lt;/p>
&lt;h2 id="why-fat32-is-that-the-best">Why FAT32? Is that the best?&lt;/h2>
&lt;p>My beautiful Playstation 3, with which I like to share some of the files, does
not understand anything else apart from FAT32.&lt;/p>
&lt;p>So back to home, plugged-in the External HDD and&amp;hellip;&amp;hellip;&amp;hellip;.. sigh!!! Does not
detect.&lt;/p>
&lt;p>Plugged it into my laptop &amp;hellip;&amp;hellip; No KDE automount&amp;hellip;&lt;/p>
&lt;p>Something wrong&amp;hellip;.&lt;/p>
&lt;p>00:47:32 rrs@champaran:/tmp$ sudo dosfsck /dev/sdb1dosfsck 3.0.9, 31 Jan 2010,
FAT32, LFNLogical sector size is zero.&lt;/p>
&lt;p>I wonder why does a file system have to get corrupted for extensive I/O on
it..&lt;/p>
&lt;h2 id="the-recovery">The Recovery..&lt;/h2>
&lt;p>Done is done. Having run into similar problems before, I looked back at
testdisk.&lt;/p>
&lt;p>It started off with a disappointment stating that the file system was
damaged.&lt;img src="https://researchut.com/images/testdisk1.jpeg" alt="">&lt;/p>
&lt;p>Luckily, doing an advanced mode lookup did show some hope.
&lt;img src="https://researchut.com/images/testdisk2.jpeg" alt="">&lt;/p>
&lt;p>And doing a listing further yielded that the boot sector was
available.&lt;img src="https://researchut.com/images/testdisk3.jpeg" alt="">&lt;/p>
&lt;p>Which when rebuilt, allowed me access to the
partition.&lt;img src="https://researchut.com/images/testdisk4.jpeg" alt="">&lt;/p>
&lt;p>For some reason, the [undelete] option listed no data. It reported that there
was no data available.&lt;/p>
&lt;p>Selecting the [Boot] option listed down all my files, which I quickly copied
over to my other External USB HDD with a btrfs file system ;-)&lt;/p>
&lt;p>Testdisk has twice turned out to be my favorite data recovery tool from b0rken
file systems.&lt;/p></description></item></channel></rss>