How to mount a file created using dd command

I created an exact copy of a bootable USB drive using the dd command (which is an extremely cool tool by the way) using the following command:

dd if=/dev/sdb of=myFile.img

After that, to mount it, you can simply use the kpartx command, as follows:

=================================================

mkdir hobba

sudo kpartx -a myFile.img
sudo mount /dev/mapper/loop0p1 hobba -o loop,ro

=================================================

where loop0p1 is the first partition, loop0p2 will be the second partition, and so on.

Enjoy!

Source: GrGr on http://superuser.com/questions/117136/how-can-i-mount-a-partition-from-dd-created-image-of-a-block-device-e-g-hdd-u

About SoCRaT

Systems Engineer, OSS & Linux Geek
This entry was posted in Linux, Ubuntu and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s