<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Dd%3A_mount_hasil_dd</id>
	<title>Dd: mount hasil dd - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Dd%3A_mount_hasil_dd"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Dd:_mount_hasil_dd&amp;action=history"/>
	<updated>2026-04-19T18:05:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Dd:_mount_hasil_dd&amp;diff=42562&amp;oldid=prev</id>
		<title>Onnowpurbo: New page: Sumber: https://major.io/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/   This situation might not affect everyone, but it struck me today and left me scratch...</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Dd:_mount_hasil_dd&amp;diff=42562&amp;oldid=prev"/>
		<updated>2015-03-05T01:12:32Z</updated>

		<summary type="html">&lt;p&gt;New page: Sumber: https://major.io/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/   This situation might not affect everyone, but it struck me today and left me scratch...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sumber: https://major.io/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This situation might not affect everyone, but it struck me today and left me scratching my head. Consider a situation where you need to clone one drive to another with dd or when a hard drive is failing badly and you use dd_rescue to salvage whatever data you can.&lt;br /&gt;
&lt;br /&gt;
Let’s say you cloned data from a drive using something like this:&lt;br /&gt;
&lt;br /&gt;
 # dd if=/dev/sda of=/mnt/nfs/backup/harddrive.img&lt;br /&gt;
&lt;br /&gt;
Once that’s finished, you should end up with your partition table as well as the grub data from the MBR in your image file. If you run file against the image file you made, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
 # file harddrive.img&lt;br /&gt;
&lt;br /&gt;
 harddrive.img: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, stage2 &lt;br /&gt;
 address 0x2000, stage2 segment 0x200, GRUB version 0.97; partition 1: ID=0x83, &lt;br /&gt;
 active, starthead 1, startsector 63, 33640047 sectors, code offset 0x48&lt;br /&gt;
&lt;br /&gt;
What if you want to pull some files from this image without writing it out to another disk? Mounting it like a loop file isn’t going to work:&lt;br /&gt;
&lt;br /&gt;
 # mount harddrive /mnt/temp&lt;br /&gt;
&lt;br /&gt;
 mount: you must specify the filesystem type&lt;br /&gt;
&lt;br /&gt;
The key is to mount the file with an offset specified. In the output from file, there is a particular portion of the output that will help you:&lt;br /&gt;
&lt;br /&gt;
 ... startsector 63 ...&lt;br /&gt;
&lt;br /&gt;
This means that the filesystem itself starts on sector 63. You can also view this with fdisk -l:&lt;br /&gt;
&lt;br /&gt;
 # fdisk -l harddrive.img&lt;br /&gt;
&lt;br /&gt;
                     Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
 harddrive.img                *          63    33640109    16820023+  83  Linux&lt;br /&gt;
&lt;br /&gt;
Since we need to scoot 63 sectors ahead, and each sector is 512 bytes long, we need to use an offset of 32,256 bytes. Fire up the mount command and you’ll be on your way:&lt;br /&gt;
&lt;br /&gt;
 # mount -o ro,loop,offset=32256 harddrive.img /mnt/loop&lt;br /&gt;
 # mount | grep harddrive.img&lt;br /&gt;
 /root/harddrive.img on /mnt/loop type ext3 (ro,loop=/dev/loop1,offset=32256)&lt;br /&gt;
&lt;br /&gt;
If you made this image under duress (due to a failing drive or other emergency), you might have to check and repair the filesystem first. Doing that is easy if you make a loop device:&lt;br /&gt;
&lt;br /&gt;
 # losetup --offset 32256 /dev/loop2 harddrive.img&lt;br /&gt;
 # fsck /dev/loop2&lt;br /&gt;
&lt;br /&gt;
Once that’s complete, you can save some time and mount the loop device directly:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/loop2 /mnt/loop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Referensi==&lt;br /&gt;
&lt;br /&gt;
* https://major.io/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>