Clan x86

Technical (Development, Security, etc.) => Unix / Linux Discussion => Topic started by: MyndFyre on September 19, 2005, 11:07:17 PM

Title: Mounting a full hard drive image?
Post by: MyndFyre on September 19, 2005, 11:07:17 PM
Hey --

I need to mount a full hard drive image as if it's an actual hard drive.  Is this possible?

Essentially I direct copied a full hard drive (such as /dev/hda) and want to mount its main /dev/hda1 partition, which is NTFS.

Is it possible?
Title: Re: Mounting a full hard drive image?
Post by: Joe on September 19, 2005, 11:33:29 PM
hm..

get root

cd /
mkdir hd
mount /dev/hda1 /hd
Title: Re: Mounting a full hard drive image?
Post by: iago on September 19, 2005, 11:59:17 PM
Quote from: MyndFyrex86] link=topic=2969.msg28482#msg28482 date=1127185637]
Hey --

I need to mount a full hard drive image as if it's an actual hard drive.  Is this possible?

Essentially I direct copied a full hard drive (such as /dev/hda) and want to mount its main /dev/hda1 partition, which is NTFS.

Is it possible?

I don't quite understand you.  If you want to mount /dev/hda1, then what Joe said.

If you have a "dd" (.iso) image, you can mount it like this:
iago@Slayer:~$ sudo mount -o loop /mnt/vmware/iso/BroodWar.iso  /mnt/tmp
iago@Slayer:~$ ls /mnt/tmp
autorun.inf*  bw.ico*  install.exe*  isp/  setup.exe*  smackw32.dll*  support/

If it's ntfs, you might have to specify "-t ntfs" to the mount command.  I don't have an iso of a NTFS drive, so I'm not sure if that works, but I don't see why not. 
Title: Re: Mounting a full hard drive image?
Post by: MyndFyre on September 20, 2005, 01:55:53 AM
I didn't dd /dev/hda1, I dd'd /dev/hda.  I know how to mount /dev/hda1 or individual partitions.  But I copied the entire thing, partition table included.

So, if I did something like:

mkdir /tmp/hd
mount notebook-backup.img /tmp/hd

would it spawn:

/tmp/hd/hda1 (ntfs)
/tmp/hd/hda2 (ext3)
/tmp/hd/hda3 (swap)
/tmp/hd/hda5 (ntfs)
/tmp/hd/hda6 (ntfs)
Title: Re: Mounting a full hard drive image?
Post by: Newby on September 20, 2005, 02:10:05 AM
Hmm. Sounds difficult. =P
Title: Re: Mounting a full hard drive image?
Post by: iago on September 20, 2005, 09:33:54 AM
Quote from: MyndFyrex86] link=topic=2969.msg28525#msg28525 date=1127195753]
I didn't dd /dev/hda1, I dd'd /dev/hda.  I know how to mount /dev/hda1 or individual partitions.  But I copied the entire thing, partition table included.

So, if I did something like:

mkdir /tmp/hd
mount notebook-backup.img /tmp/hd

would it spawn:

/tmp/hd/hda1 (ntfs)
/tmp/hd/hda2 (ext3)
/tmp/hd/hda3 (swap)
/tmp/hd/hda5 (ntfs)
/tmp/hd/hda6 (ntfs)

I don't know, but I kinda doubt it. 

I have no clue how to do that.  But there's likely a way.  www.linuxquestions.org might be a good place to ask this one.