Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Trying to loopback mount partition from a disk image
Date: Mon, 23 Nov 2009 20:06:57
Message-Id: ABCEFB7B-AED1-4FCE-9B42-9D2E4341FB69@stellar.eclipse.co.uk
1 Hi there,
2
3 With reference to a couple of previous threads:
4 http://thread.gmane.org/gmane.linux.gentoo.user/193263
5 http://thread.gmane.org/gmane.linux.gentoo.user/197120
6
7 Here's what I'm trying:
8
9 $ ls -lh sda.dd.img
10 -rw-r--r-- 1 stroller users 77G 2009-11-22 03:51 sda.dd.img
11 $ file sda.dd.img
12 sda.dd.img: x86 boot sector, Microsoft Windows XP MBR, Serial
13 0x1890189; partition 1: ID=0x7, active, starthead 1, startsector 63,
14 160810587 sectors, code offset 0xc0
15 $ parted sda.dd.img p
16 WARNING: You are not superuser. Watch out for permissions.
17 Model: (file)
18 Disk /path/to/sda.dd.img: 82.3GB
19 Sector size (logical/physical): 512B/512B
20 Partition Table: msdos
21
22 Number Start End Size Type File system Flags
23 1 32.3kB 82.3GB 82.3GB primary ntfs boot
24
25 $ fdisk -l sda.dd.img
26 You must set cylinders.
27 You can do this from the extra functions menu.
28
29 Disk sda.dd.img: 0 MB, 0 bytes
30 255 heads, 63 sectors/track, 0 cylinders
31 Units = cylinders of 16065 * 512 = 8225280 bytes
32 Disk identifier: 0x01890189
33
34 Device Boot Start End Blocks Id System
35 sda.dd.img1 * 1 10010 80405293+ 7 HPFS/NTFS
36 Partition 1 has different physical/logical endings:
37 phys=(1023, 254, 63) logical=(10009, 254, 63)
38 $
39 $ sudo losetup -o 8225280 /dev/loop0 sda.dd.img
40 $ sudo mount -v /dev/loop0 /mnt/floppy/
41 mount: you didn't specify a filesystem type for /dev/loop0
42 I will try all types mentioned in /etc/filesystems or /proc/
43 filesystems
44 Trying #
45 Trying #vfat
46 Trying fuseblk
47 mount: you must specify the filesystem type
48 $
49
50
51 If I format a USB stick as NTFS I can mount and read it fine, so NTFS
52 driver modules are correctly compiled into the kernel.
53
54 I can `losetup` to a loop device and then `fdisk -l` or `parted /dev/
55 loop0 p` and see the partitions.
56
57 I've tried with an offset of 512 bytes instead of 8225280 with the
58 same results - I guess I'm getting a little confused about what the
59 correct offset should be. Thinking about this now it seems "obvious"
60 that 512 should be correct, but anyway, that isn't working.
61
62 I get the same as Pat trying this: http://article.gmane.org/gmane.linux.gentoo.user/197123
63
64 But:
65
66 $ sudo losetup -d /dev/loop0
67 $ sudo losetup /dev/loop0 sda.dd.img
68 $ sudo fdisk -l /dev/loop0
69
70 Disk /dev/loop0: 82.3 GB, 82348277760 bytes
71 255 heads, 63 sectors/track, 10011 cylinders
72 Units = cylinders of 16065 * 512 = 8225280 bytes
73 Disk identifier: 0x01890189
74
75 Device Boot Start End Blocks Id System
76 /dev/loop0p1 * 1 10010 80405293+ 7 HPFS/NTFS
77 $
78
79 /dev/loop0p1 seems inaccessible to me.
80
81 Really, any suggestions on how to access this "virtual partition"
82 would be great. Oh, I've also tried to run ntfsclone on it, because
83 that can produce images which can be loopback mounted (as per `man
84 ntfsclone`) but again, ntfsclone need to be pointed at a partition of
85 a hard-drive in order to produce the loopback-mountable image in the
86 first place.
87
88 Any thoughts?
89
90 Stroller.

Replies

Subject Author
Re: [gentoo-user] Trying to loopback mount partition from a disk image Volker Armin Hemmann <volkerarmin@××××××××××.com>