"loopback mount" hard-drive image created with dd?
Hi there,
Before installing on a new laptop which came with Vista pre-installed
I took an image of the hard-drive using dd. (ie: `dd if=/dev/sda of=/
mnt/sdb1/disk.img`, where /mnt/sdb1 was a portable USB hard-drive).
Obviously the intention was that if I b0rked things up I could just
`dd` the image back onto the laptop and all would work as the
manufacturer shipped it, but I'd now find it useful to be able to
take a look inside the image and examine a few files. Is there any
way to do this, please?
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?
Thanks in advance for any suggestions or advices,
Stroller.
--
gentoo-user@lists.gentoo.org mailing list
01-18-2008, 12:02 PM
Stroller
"loopback mount" hard-drive image created with dd?
On 18 Jan 2008, at 09:04, आशीष शुक्ल Ashish Shukla
wrote:
,--[ 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...
Would that work? I've never used VMs - are their drive images exactly
"blocky" as my `dd` command would produce?
(`dd if=/dev/sda of=/mnt/sdb1/disk.img`, where /mnt/sdb1 was a
portable USB hard-drive).
Or look out for some tools which allow you to play with hard
disk images, e.g. mtools .
It looks like mtools is geared towards floppies but will handle a
hard-drive fine. However the manual <http://mtools.linux.lu/
mtools.html> suggests no support for NTFS. (??)
Stroller.--
gentoo-user@lists.gentoo.org mailing list
01-18-2008, 01:40 PM
"loopback mount" hard-drive image created with dd?
Stroller> Would that work? I've never used VMs - are their drive images exactly
Stroller> "blocky" as my `dd` command would produce?
Stroller> (`dd if=/dev/sda of=/mnt/sdb1/disk.img`, where /mnt/sdb1 was a
Stroller> portable USB hard-drive).
I installed FreeBSD on my box, this way, when I didn't have CD-ROM
drive on my box . I've used QEmu (AMD64), and it worked flawlessly .
Stroller> It looks like mtools is geared towards floppies but will handle a
Stroller> hard-drive fine. However the manual <http://mtools.linux.lu/
mtools.html> suggests no support for NTFS. (??)
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 .
"loopback mount" hard-drive image created with dd?
Stroller wrote:
> Hi there,
>
> Before installing on a new laptop which came with Vista pre-installed
> I took an image of the hard-drive using dd. (ie: `dd if=/dev/sda of=/
> mnt/sdb1/disk.img`, where /mnt/sdb1 was a portable USB hard-drive).
>
> Obviously the intention was that if I b0rked things up I could just
> `dd` the image back onto the laptop and all would work as the
> manufacturer shipped it, but I'd now find it useful to be able to
> take a look inside the image and examine a few files. Is there any
> way to do this, please?
>
> 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?
>
> Thanks in advance for any suggestions or advices,
>
> Stroller.
>
Try this...
modprobe loop
modprobe ntfs
mkdir /mnt/iso
mount -t ntfs /path/to/your/iso /mnt/iso -o loop,ro
Assuming the iso is ntfs and you have loop and ntfs as modules...
Cheers.
Jerry McBride (jmcbride@mail-on.us)
--
From the Desk of: Jerome D. McBride
--
gentoo-user@lists.gentoo.org mailing list
01-18-2008, 05:01 PM
Alan McKinnon
"loopback mount" hard-drive image created with dd?
On Friday 18 January 2008, Jerry McBride wrote:
> Stroller wrote:
> > Hi there,
> >
> > Before installing on a new laptop which came with Vista
> > pre-installed I took an image of the hard-drive using dd. (ie: `dd
> > if=/dev/sda of=/ mnt/sdb1/disk.img`, where /mnt/sdb1 was a portable
> > USB hard-drive).
> >
> > Obviously the intention was that if I b0rked things up I could just
> > `dd` the image back onto the laptop and all would work as the
> > manufacturer shipped it, but I'd now find it useful to be able to
> > take a look inside the image and examine a few files. Is there any
> > way to do this, please?
> >
> > 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?
> >
> > Thanks in advance for any suggestions or advices,
> >
> > Stroller.
>
> Try this...
>
> modprobe loop
> modprobe ntfs
>
> mkdir /mnt/iso
>
> mount -t ntfs /path/to/your/iso /mnt/iso -o loop,ro
>
> Assuming the iso is ntfs and you have loop and ntfs as modules...
>
> Cheers.
Won't work. He already said the .iso is a *disk* image, not a *file
system* image.
The ntfs driver (or any sane file system driver) will not know what to
do with a block image complete with partition tables and boot records.
alan
--
Alan McKinnon
alan dot mckinnon at gmail dot com
--
gentoo-user@lists.gentoo.org mailing list
01-18-2008, 05:29 PM
Jerry McBride
"loopback mount" hard-drive image created with dd?
On Friday 18 January 2008 01:01:18 pm Alan McKinnon wrote:
> On Friday 18 January 2008, Jerry McBride wrote:
> > Stroller wrote:
> > > Hi there,
> > >
> > > Before installing on a new laptop which came with Vista
> > > pre-installed I took an image of the hard-drive using dd. (ie: `dd
> > > if=/dev/sda of=/ mnt/sdb1/disk.img`, where /mnt/sdb1 was a portable
> > > USB hard-drive).
> > >
> > > Obviously the intention was that if I b0rked things up I could just
> > > `dd` the image back onto the laptop and all would work as the
> > > manufacturer shipped it, but I'd now find it useful to be able to
> > > take a look inside the image and examine a few files. Is there any
> > > way to do this, please?
> > >
> > > 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?
> > >
> > > Thanks in advance for any suggestions or advices,
> > >
> > > Stroller.
> >
> > Try this...
> >
> > modprobe loop
> > modprobe ntfs
> >
> > mkdir /mnt/iso
> >
> > mount -t ntfs /path/to/your/iso /mnt/iso -o loop,ro
> >
> > Assuming the iso is ntfs and you have loop and ntfs as modules...
> >
> > Cheers.
>
> Won't work. He already said the .iso is a *disk* image, not a *file
> system* image.
>
> The ntfs driver (or any sane file system driver) will not know what to
> do with a block image complete with partition tables and boot records.
>
> alan
>
I don't doubt what you wrote, but I've done exactly that many times and never
had a problem. Is this some kind of ntfs support issue?
Just this morning, I ran dd to make an image of a usbstick I dearly love... I
just now mounted the image as vfat as stated above and I have complete access
to the data on it... Is the ntfs module that different? Just curious.
Cheers.
--
From the Desk of: Jerome D. McBride
--
gentoo-user@lists.gentoo.org mailing list
01-18-2008, 05:54 PM
Alan McKinnon
"loopback mount" hard-drive image created with dd?
On Friday 18 January 2008, Jerry McBride wrote:
> On Friday 18 January 2008 01:01:18 pm Alan McKinnon wrote:
> > Won't work. He already said the .iso is a *disk* image, not a *file
> > system* image.
> >
> > The ntfs driver (or any sane file system driver) will not know what
> > to do with a block image complete with partition tables and boot
> > records.
> >
> > alan
>
> I don't doubt what you wrote, but I've done exactly that many times
> and never had a problem. Is this some kind of ntfs support issue?
>
> Just this morning, I ran dd to make an image of a usbstick I dearly
> love... I just now mounted the image as vfat as stated above and I
> have complete access to the data on it... Is the ntfs module that
> different? Just curious.
Do you have partitions on that memory stick?
--
Alan McKinnon
alan dot mckinnon at gmail dot com
--
gentoo-user@lists.gentoo.org mailing list
01-18-2008, 06:19 PM
Jerry McBride
"loopback mount" hard-drive image created with dd?
On Friday 18 January 2008 01:54:58 pm Alan McKinnon wrote:
> On Friday 18 January 2008, Jerry McBride wrote:
> > On Friday 18 January 2008 01:01:18 pm Alan McKinnon wrote:
> > > Won't work. He already said the .iso is a *disk* image, not a *file
> > > system* image.
> > >
> > > The ntfs driver (or any sane file system driver) will not know what
> > > to do with a block image complete with partition tables and boot
> > > records.
> > >
> > > alan
> >
> > I don't doubt what you wrote, but I've done exactly that many times
> > and never had a problem. Is this some kind of ntfs support issue?
> >
> > Just this morning, I ran dd to make an image of a usbstick I dearly
> > love... I just now mounted the image as vfat as stated above and I
> > have complete access to the data on it... Is the ntfs module that
> > different? Just curious.
>
> Do you have partitions on that memory stick?
>
Yes.
--
From the Desk of: Jerome D. McBride
--
gentoo-user@lists.gentoo.org mailing list
01-18-2008, 06:38 PM
Jerry McBride
"loopback mount" hard-drive image created with dd?
On Friday 18 January 2008 02:19:21 pm Jerry McBride wrote:
> On Friday 18 January 2008 01:54:58 pm Alan McKinnon wrote:
> > On Friday 18 January 2008, Jerry McBride wrote:
> > > On Friday 18 January 2008 01:01:18 pm Alan McKinnon wrote:
> > > > Won't work. He already said the .iso is a *disk* image, not a *file
> > > > system* image.
> > > >
> > > > The ntfs driver (or any sane file system driver) will not know what
> > > > to do with a block image complete with partition tables and boot
> > > > records.
> > > >
> > > > alan
> > >
> > > I don't doubt what you wrote, but I've done exactly that many times
> > > and never had a problem. Is this some kind of ntfs support issue?
> > >
> > > Just this morning, I ran dd to make an image of a usbstick I dearly
> > > love... I just now mounted the image as vfat as stated above and I
> > > have complete access to the data on it... Is the ntfs module that
> > > different? Just curious.
> >
> > Do you have partitions on that memory stick?
>
> Yes.
>
OK... It just got through my dense head! He has "multiple partitions" in his
disk image, not one....
What I proposed will fail in that case, but will work with "just one"
partition in the image...
It's a shame too.
Cheers.
--
From the Desk of: Jerome D. McBride
--
gentoo-user@lists.gentoo.org mailing list
01-18-2008, 07:35 PM
Mick
"loopback mount" hard-drive image created with dd?
On Friday 18 January 2008, Jerry McBride wrote:
> On Friday 18 January 2008 02:19:21 pm Jerry McBride wrote:
> > On Friday 18 January 2008 01:54:58 pm Alan McKinnon wrote:
> > > On Friday 18 January 2008, Jerry McBride wrote:
> > > > On Friday 18 January 2008 01:01:18 pm Alan McKinnon wrote:
> > > > > Won't work. He already said the .iso is a *disk* image, not a *file
> > > > > system* image.
> > > > >
> > > > > The ntfs driver (or any sane file system driver) will not know what
> > > > > to do with a block image complete with partition tables and boot
> > > > > records.
> > > > >
> > > > > alan
> > > >
> > > > I don't doubt what you wrote, but I've done exactly that many times
> > > > and never had a problem. Is this some kind of ntfs support issue?
> > > >
> > > > Just this morning, I ran dd to make an image of a usbstick I dearly
> > > > love... I just now mounted the image as vfat as stated above and I
> > > > have complete access to the data on it... Is the ntfs module that
> > > > different? Just curious.
> > >
> > > Do you have partitions on that memory stick?
> >
> > Yes.
>
> OK... It just got through my dense head! He has "multiple partitions" in
> his disk image, not one....
>
> What I proposed will fail in that case, but will work with "just one"
> partition in the image...
>
> It's a shame too.
>
> Cheers.
I have mounted through loopback USB stick images that I dd onto my hard drive,
but had no partition table (like a floppy sort of thing). I am thinking
aloud here, could the OP chainload the NTFS image using Grub -
notwithstanding that Vista is using a slightly different booting scheme than
the WinXP NTLDR.exe?