FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

LinkBack Thread Tools
Old 01-18-2008, 08:04 AM
आशीष शुक्ल Ashish Shukla
Default "loopback mount" hard-drive image created with dd?

,--[ On Fri, Jan 18, 2008 at 03:19:49AM +0000, Stroller wrote:


> I'm fairly confident that there were originally a couple of partitions on
> the drive, and the one I want to look at will be NTFS, of course. I know
> that a CD iso I can mount using `mount file.iso /mnt/cdrom -t iso9660 -o
> loop`, but is there an equivalent for whole partition tables?

How about using your disk image as HD in a VM, and then inspect it from
VM, hmm... Or look out for some tools which allow you to play with hard
disk images, e.g. mtools .

Ashish Shukla आशीष शुक्ल http://wahjava.wordpress.com/
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
Old 01-18-2008, 05:47 PM
Yahya Mohammad
Default "loopback mount" hard-drive image created with dd?

> Another hack you can try is use to use '--offset' option of
> 'losetup'. First figure out from which byte, NTFS partition starts in
> disk image, and then you create a loopback back device for that image
> and the starting offset using 'losetup' and finally 'mount' the
> loopback as NTFS partition .

Here's more detail on how to do that

# losetup /dev/loop0 /path/to/diskimage
# fdisk -l /dev/loop0
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1044 8385898+ c W95 FAT32 (LBA)
/dev/sdb2 1045 19457 147902422+ 83 Linux

suppose you want to mount the partition on sdb2, the offset for that
would be 8225280 * 1045 = 8595417600.

detach the disk image
# losetup -d /dev/loop0
and setup the loop for the partiion
# losetup -o8595417600 /dev/loop0 /path/to/diskimage
and mount it
# mount -t fstype /dev/loop0 /path/to/mountdir

> Please do post your results, if you're successful

I second that, I'm curious to know if it works

oh, and make a backup just in case
gentoo-user@lists.gentoo.org mailing list

Thread Tools

All times are GMT. The time now is 01:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org