public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Trying to loopback mount partition from a disk image
@ 2009-11-23 18:32 Stroller
  2009-11-23 18:50 ` Volker Armin Hemmann
  0 siblings, 1 reply; 7+ messages in thread
From: Stroller @ 2009-11-23 18:32 UTC (permalink / raw
  To: gentoo-user

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.








^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Trying to loopback mount partition from a disk image
  2009-11-23 18:32 [gentoo-user] Trying to loopback mount partition from a disk image Stroller
@ 2009-11-23 18:50 ` Volker Armin Hemmann
  2009-11-23 19:03   ` Stroller
  2009-11-23 19:11   ` Alex Schuster
  0 siblings, 2 replies; 7+ messages in thread
From: Volker Armin Hemmann @ 2009-11-23 18:50 UTC (permalink / raw
  To: gentoo-user

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.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Trying to loopback mount partition from a disk image
  2009-11-23 18:50 ` Volker Armin Hemmann
@ 2009-11-23 19:03   ` Stroller
  2009-11-23 19:15     ` Volker Armin Hemmann
  2009-11-23 19:11   ` Alex Schuster
  1 sibling, 1 reply; 7+ messages in thread
From: Stroller @ 2009-11-23 19:03 UTC (permalink / raw
  To: gentoo-user


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.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Trying to loopback mount partition from a disk image
  2009-11-23 18:50 ` Volker Armin Hemmann
  2009-11-23 19:03   ` Stroller
@ 2009-11-23 19:11   ` Alex Schuster
  2009-11-23 21:15     ` Stroller
  1 sibling, 1 reply; 7+ messages in thread
From: Alex Schuster @ 2009-11-23 19:11 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Trying to loopback mount partition from a disk image
  2009-11-23 19:03   ` Stroller
@ 2009-11-23 19:15     ` Volker Armin Hemmann
  2009-11-23 21:11       ` Stroller
  0 siblings, 1 reply; 7+ messages in thread
From: Volker Armin Hemmann @ 2009-11-23 19:15 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Trying to loopback mount partition from a disk image
  2009-11-23 19:15     ` Volker Armin Hemmann
@ 2009-11-23 21:11       ` Stroller
  0 siblings, 0 replies; 7+ messages in thread
From: Stroller @ 2009-11-23 21:11 UTC (permalink / raw
  To: gentoo-user


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.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Trying to loopback mount partition from a disk image
  2009-11-23 19:11   ` Alex Schuster
@ 2009-11-23 21:15     ` Stroller
  0 siblings, 0 replies; 7+ messages in thread
From: Stroller @ 2009-11-23 21:15 UTC (permalink / raw
  To: gentoo-user


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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-11-23 22:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23 18:32 [gentoo-user] Trying to loopback mount partition from a disk image Stroller
2009-11-23 18:50 ` Volker Armin Hemmann
2009-11-23 19:03   ` Stroller
2009-11-23 19:15     ` Volker Armin Hemmann
2009-11-23 21:11       ` Stroller
2009-11-23 19:11   ` Alex Schuster
2009-11-23 21:15     ` Stroller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox