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 11-23-2009, 05:32 PM
Stroller
 
Default Trying to loopback mount partition from a disk image

Hi there,

With reference to a couple of previous threads:
http://thread.gmane.org/gmane.linux.gentoo.user/193263
http://thread.gmane.org/gmane.linux.gentoo.user/197120

Here's what I'm trying:

$ ls -lh sda.dd.img
-rw-r--r-- 1 stroller users 77G 2009-11-22 03:51 sda.dd.img
$ file sda.dd.img
sda.dd.img: x86 boot sector, Microsoft Windows XP MBR, Serial
0x1890189; partition 1: ID=0x7, active, starthead 1, startsector 63,
160810587 sectors, code offset 0xc0

$ parted sda.dd.img p
WARNING: You are not superuser. Watch out for permissions.
Model: (file)
Disk /path/to/sda.dd.img: 82.3GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 82.3GB 82.3GB primary ntfs boot

$ fdisk -l sda.dd.img
You must set cylinders.
You can do this from the extra functions menu.

Disk sda.dd.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x01890189

Device Boot Start End Blocks Id System
sda.dd.img1 * 1 10010 80405293+ 7 HPFS/NTFS
Partition 1 has different physical/logical endings:
phys=(1023, 254, 63) logical=(10009, 254, 63)
$
$ sudo losetup -o 8225280 /dev/loop0 sda.dd.img
$ sudo mount -v /dev/loop0 /mnt/floppy/
mount: you didn't specify a filesystem type for /dev/loop0
I will try all types mentioned in /etc/filesystems or /proc/
filesystems

Trying #
Trying #vfat
Trying fuseblk
mount: you must specify the filesystem type
$


If I format a USB stick as NTFS I can mount and read it fine, so NTFS
driver modules are correctly compiled into the kernel.


I can `losetup` to a loop device and then `fdisk -l` or `parted /dev/
loop0 p` and see the partitions.


I've tried with an offset of 512 bytes instead of 8225280 with the
same results - I guess I'm getting a little confused about what the
correct offset should be. Thinking about this now it seems "obvious"
that 512 should be correct, but anyway, that isn't working.


I get the same as Pat trying this: http://article.gmane.org/gmane.linux.gentoo.user/197123

But:

$ sudo losetup -d /dev/loop0
$ sudo losetup /dev/loop0 sda.dd.img
$ sudo fdisk -l /dev/loop0

Disk /dev/loop0: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x01890189

Device Boot Start End Blocks Id System
/dev/loop0p1 * 1 10010 80405293+ 7 HPFS/NTFS
$

/dev/loop0p1 seems inaccessible to me.

Really, any suggestions on how to access this "virtual partition"
would be great. Oh, I've also tried to run ntfsclone on it, because
that can produce images which can be loopback mounted (as per `man
ntfsclone`) but again, ntfsclone need to be pointed at a partition of
a hard-drive in order to produce the loopback-mountable image in the
first place.


Any thoughts?

Stroller.
 
Old 11-23-2009, 05:50 PM
Volker Armin Hemmann
 
Default Trying to loopback mount partition from a disk image

On Montag 23 November 2009, Stroller wrote:
> Hi there,
>
> With reference to a couple of previous threads:
> http://thread.gmane.org/gmane.linux.gentoo.user/193263
> http://thread.gmane.org/gmane.linux.gentoo.user/197120
>
> Here's what I'm trying:
>
> $ ls -lh sda.dd.img
> -rw-r--r-- 1 stroller users 77G 2009-11-22 03:51 sda.dd.img
> $ file sda.dd.img
> sda.dd.img: x86 boot sector, Microsoft Windows XP MBR, Serial
> 0x1890189; partition 1: ID=0x7, active, starthead 1, startsector 63,
> 160810587 sectors, code offset 0xc0
> $ parted sda.dd.img p
> WARNING: You are not superuser. Watch out for permissions.
> Model: (file)
> Disk /path/to/sda.dd.img: 82.3GB
> Sector size (logical/physical): 512B/512B
> Partition Table: msdos
>
> Number Start End Size Type File system Flags
> 1 32.3kB 82.3GB 82.3GB primary ntfs boot
>
> $ fdisk -l sda.dd.img
> You must set cylinders.
> You can do this from the extra functions menu.
>
> Disk sda.dd.img: 0 MB, 0 bytes
> 255 heads, 63 sectors/track, 0 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> Disk identifier: 0x01890189
>
> Device Boot Start End Blocks Id System
> sda.dd.img1 * 1 10010 80405293+ 7 HPFS/NTFS
> Partition 1 has different physical/logical endings:
> phys=(1023, 254, 63) logical=(10009, 254, 63)
> $
> $ sudo losetup -o 8225280 /dev/loop0 sda.dd.img
> $ sudo mount -v /dev/loop0 /mnt/floppy/
> mount: you didn't specify a filesystem type for /dev/loop0
> I will try all types mentioned in /etc/filesystems or /proc/
> filesystems
> Trying #
> Trying #vfat
> Trying fuseblk
> mount: you must specify the filesystem type
> $
>
>
> If I format a USB stick as NTFS I can mount and read it fine, so NTFS
> driver modules are correctly compiled into the kernel.
>
> I can `losetup` to a loop device and then `fdisk -l` or `parted /dev/
> loop0 p` and see the partitions.
>
> I've tried with an offset of 512 bytes instead of 8225280 with the
> same results - I guess I'm getting a little confused about what the
> correct offset should be. Thinking about this now it seems "obvious"
> that 512 should be correct, but anyway, that isn't working.
>
> I get the same as Pat trying this:
> http://article.gmane.org/gmane.linux.gentoo.user/197123
>
> But:
>
> $ sudo losetup -d /dev/loop0
> $ sudo losetup /dev/loop0 sda.dd.img
> $ sudo fdisk -l /dev/loop0
>
> Disk /dev/loop0: 82.3 GB, 82348277760 bytes
> 255 heads, 63 sectors/track, 10011 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> Disk identifier: 0x01890189
>
> Device Boot Start End Blocks Id System
> /dev/loop0p1 * 1 10010 80405293+ 7 HPFS/NTFS
> $
>
> /dev/loop0p1 seems inaccessible to me.
>
> Really, any suggestions on how to access this "virtual partition"
> would be great. Oh, I've also tried to run ntfsclone on it, because
> that can produce images which can be loopback mounted (as per `man
> ntfsclone`) but again, ntfsclone need to be pointed at a partition of
> a hard-drive in order to produce the loopback-mountable image in the
> first place.
>
> Any thoughts?
>
> Stroller.
>

yeah, you don't need to use losetup. I mounted a lot of images over the years
and I never used losetup.
 
Old 11-23-2009, 06:03 PM
Stroller
 
Default Trying to loopback mount partition from a disk image

On 23 Nov 2009, at 18:50, Volker Armin Hemmann wrote:

On Montag 23 November 2009, Stroller wrote:

Hi there,

With reference to a couple of previous threads:
http://thread.gmane.org/gmane.linux.gentoo.user/193263
http://thread.gmane.org/gmane.linux.gentoo.user/197120

Here's what I'm trying:

$ ls -lh sda.dd.img
-rw-r--r-- 1 stroller users 77G 2009-11-22 03:51 sda.dd.img
$ file sda.dd.img
sda.dd.img: x86 boot sector, Microsoft Windows XP MBR, Serial
0x1890189; partition 1: ID=0x7, active, starthead 1, startsector 63,
160810587 sectors, code offset 0xc0
...


yeah, you don't need to use losetup. I mounted a lot of images over
the years

and I never used losetup.


How do I do it then, please?

Note, it's an image of an entire hard-drive, imaged using `dd` or GNU
`ddrescue`, so it also includes the MBR & partition table. It's not
just a partition or an .iso optical disk image.


Stroller.
 
Old 11-23-2009, 06:11 PM
Alex Schuster
 
Default Trying to loopback mount partition from a disk image

Volker Armin Hemmann writes:

> On Montag 23 November 2009, Stroller wrote:

> > $ fdisk -l sda.dd.img
> > You must set cylinders.
> > You can do this from the extra functions menu.
> >
> > Disk sda.dd.img: 0 MB, 0 bytes
> > 255 heads, 63 sectors/track, 0 cylinders
> > Units = cylinders of 16065 * 512 = 8225280 bytes
> > Disk identifier: 0x01890189
> >
> > Device Boot Start End Blocks Id System
> > sda.dd.img1 * 1 10010 80405293+ 7 HPFS/NTFS
> > Partition 1 has different physical/logical endings:
> > phys=(1023, 254, 63) logical=(10009, 254, 63)
> > $
> > $ sudo losetup -o 8225280 /dev/loop0 sda.dd.img

Try -o $(( 63*512 )). 63 is the start sector, you see this when you enter
the U command in fdisk in order to change the units.

> yeah, you don't need to use losetup. I mounted a lot of images over the
> years and I never used losetup.

Um, even if the partition does not start at the beginning? I tried this a
while ago, giving the offset directly as mount option, but it did not work
at all. But when I also tried it manually with losetup, I succeeded.

Wonko
 
Old 11-23-2009, 06:15 PM
Volker Armin Hemmann
 
Default Trying to loopback mount partition from a disk image

On Montag 23 November 2009, Stroller wrote:
> On 23 Nov 2009, at 18:50, Volker Armin Hemmann wrote:
> > On Montag 23 November 2009, Stroller wrote:
> >> Hi there,
> >>
> >> With reference to a couple of previous threads:
> >> http://thread.gmane.org/gmane.linux.gentoo.user/193263
> >> http://thread.gmane.org/gmane.linux.gentoo.user/197120
> >>
> >> Here's what I'm trying:
> >>
> >> $ ls -lh sda.dd.img
> >> -rw-r--r-- 1 stroller users 77G 2009-11-22 03:51 sda.dd.img
> >> $ file sda.dd.img
> >> sda.dd.img: x86 boot sector, Microsoft Windows XP MBR, Serial
> >> 0x1890189; partition 1: ID=0x7, active, starthead 1, startsector 63,
> >> 160810587 sectors, code offset 0xc0
> >> ...
> >
> > yeah, you don't need to use losetup. I mounted a lot of images over
> > the years
> > and I never used losetup.
>
> How do I do it then, please?
>
> Note, it's an image of an entire hard-drive, imaged using `dd` or GNU
> `ddrescue`, so it also includes the MBR & partition table. It's not
> just a partition or an .iso optical disk image.
>
> Stroller.
>

modprobe loop
mount -o loop /image /pfad
 
Old 11-23-2009, 08:11 PM
Stroller
 
Default Trying to loopback mount partition from a disk image

On 23 Nov 2009, at 19:15, Volker Armin Hemmann wrote:


On Montag 23 November 2009, Stroller wrote:

On 23 Nov 2009, at 18:50, Volker Armin Hemmann wrote:

On Montag 23 November 2009, Stroller wrote:

Hi there,

With reference to a couple of previous threads:
http://thread.gmane.org/gmane.linux.gentoo.user/193263
http://thread.gmane.org/gmane.linux.gentoo.user/197120

Here's what I'm trying:

$ ls -lh sda.dd.img
-rw-r--r-- 1 stroller users 77G 2009-11-22 03:51 sda.dd.img
$ file sda.dd.img
sda.dd.img: x86 boot sector, Microsoft Windows XP MBR, Serial
0x1890189; partition 1: ID=0x7, active, starthead 1, startsector
63,

160810587 sectors, code offset 0xc0
...


yeah, you don't need to use losetup. I mounted a lot of images over
the years
and I never used losetup.


How do I do it then, please?

Note, it's an image of an entire hard-drive, imaged using `dd` or GNU
`ddrescue`, so it also includes the MBR & partition table. It's not
just a partition or an .iso optical disk image.



modprobe loop
mount -o loop /image /pfad


Where /pfad is the mountpoint?

Because that's not working here.

$ sudo mount -o loop /path/to/sda.dd.img /mnt/floppy/ -t ntfs
mount: wrong fs type, bad option, bad superblock on /dev/loop/1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

$

Stroller.
 
Old 11-23-2009, 08:15 PM
Stroller
 
Default Trying to loopback mount partition from a disk image

On 23 Nov 2009, at 19:11, Alex Schuster wrote:


Volker Armin Hemmann writes:


On Montag 23 November 2009, Stroller wrote:



$ fdisk -l sda.dd.img
You must set cylinders.
You can do this from the extra functions menu.

Disk sda.dd.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x01890189

Device Boot Start End Blocks Id System
sda.dd.img1 * 1 10010 80405293+ 7 HPFS/NTFS
Partition 1 has different physical/logical endings:
phys=(1023, 254, 63) logical=(10009, 254, 63)
$
$ sudo losetup -o 8225280 /dev/loop0 sda.dd.img


Try -o $(( 63*512 )). 63 is the start sector, you see this when you
enter

the U command in fdisk in order to change the units.


Brilliant! That's it!

Many thanks.

Stroller.
 

Thread Tools




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

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