<?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>Pario TechnoBlob &#187; RAID Reconstructor</title>
	<atom:link href="http://pario.no/tag/raid-reconstructor/feed/" rel="self" type="application/rss+xml" />
	<link>http://pario.no</link>
	<description>A cronological documentation test project, nothing serious, really!</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:17:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mount a RAID Reconstructor disk image in linux</title>
		<link>http://pario.no/2009/01/19/mount-a-disk-image/</link>
		<comments>http://pario.no/2009/01/19/mount-a-disk-image/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 11:52:12 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[offset]]></category>
		<category><![CDATA[RAID Reconstructor]]></category>
		<category><![CDATA[testdisk]]></category>

		<guid isPermaLink="false">http://pario.no/?p=894</guid>
		<description><![CDATA[This post came to life because I had gotten a image file of a 120GB linux ext2 RAID partition that I couldn&#8217;t access using Windows software. The partition had been rescued by RAID Reconstructor, a Windows software that can rebuild RAID arrays by combining the disks from the RAID and store it as one image [...]]]></description>
			<content:encoded><![CDATA[<p>This post came to life because I had gotten a image file of a 120GB linux ext2 RAID partition that I couldn&#8217;t access using Windows software. The partition had been rescued by <a href="http://www.runtime.org/raid.htm">RAID Reconstructor</a>, a Windows software that can rebuild RAID arrays by combining the disks from the RAID and store it as one image file.</p>
<p>The solution was to use linux and try to mount it as a loop filesystem. My assumption was that the partition itself had an unknown offset, so I used this script to search and mount the partition. The script tries to mount the partition within the first 20000 blocks. I assume the block size is 512 bytes and I already know that the partition is formatted as ext2.</p>
<pre>
for ((i=0 ; $i < 20000 ; i=$i + 1)) ; do
    mount -t ext2 -o loop,offset=$(($i * 512)) diskimage.img /mnt/point &#038;&#038; break
done
</pre>
<p>If it succeeds you can issue the mount command to get the offset value to the mounted partition</p>
<pre>
# mount | grep diskimage

/dev/loop0 on /mnt/point type ext2 (rw,offset=32256)
</pre>
<p>In my case the offset was 32256.</p>
<p>This script can also be used to mount a partition from a backup of your filesystem.</p>
<p><strong>Example</strong><br />
This is my example disk I'm going to create an image of</p>
<pre>
# fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          14      112423+  83  Linux
/dev/hda2              15          96      658665   83  Linux
/dev/hda3              97        3394    26491185   83  Linux
/dev/hda4            3395        9729    50885887+   f  W95 Ext'd (LBA)
/dev/hda5            3395        7218    30716248+  83  Linux
/dev/hda6            7219        8750    12305758+  83  Linux
/dev/hda7            8751        9533     6289416   83  Linux
/dev/hda8            9534        9729     1574338+  83  Linux
</pre>
<p>Create a backup image of your entire disk</p>
<pre>
# dd if=/dev/hda of=imagefile.img</pre>
<p>To mount one of these partitions as a loop filesystem you can issue a mount command and tell it the right offset. Use the script above if you don't know the offset, it will take the guesswork for you and mount the partition.</p>
<p>Example of mounting /dev/hda3 if the offset is known</p>
<pre>
# mount -t ext3 -o loop,offset=49664 /dev/hda3 /mnt/point</pre>
<p>Determining the offset is easy when you know the disk geometry have access to the file table.<br />
In this case the hda3 partition has an offset of 512 bytes * 96 blocks = 49664.</p>
<p><strong>EDIT</strong><br />
This post could have been avoided if I had known about the linux tool <a href="http://www.cgsecurity.org/wiki/TestDisk">TestDisk</a>. testDisk is a powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table). It could also be used as a forensic tool.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/www.runtime.org\/raid.htm","http:\/\/www.cgsecurity.org\/wiki\/TestDisk"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDkvMDEvMTkvbW91bnQtYS1kaXNrLWltYWdlLzx3cHRiPk1vdW50IGEgUkFJRCBSZWNvbnN0cnVjdG9yIGRpc2sgaW1hZ2UgaW4gbGludXg8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2009/01/19/mount-a-disk-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

