Gentoo Archives: gentoo-user

From: pat <pat@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] mounting disk image
Date: Sun, 06 Apr 2008 21:52:40
Message-Id: 20080406214532.M76693@xvalheru.org
In Reply to: Re: [gentoo-user] mounting disk image by Andrey Falko
1 On Sun, 6 Apr 2008 17:19:33 -0400, Andrey Falko wrote
2 > On Sun, Apr 6, 2008 at 5:03 PM, pat <pat@××××××××.org> wrote:
3 > > Hello,
4 > >
5 > > I have a question about mounting disk image as the disk. I have disk image
6 > > which was created using:
7 > > dd if=/dev/sda of=./file.iso
8 > > and the sda contained two partitions sda1 and sda2. I know, that if I have
9 > > only image of the sda1 I can mount it using loop device like
10 > > #losetup /dev/loop0 file.iso
11 > > #mount -t ... /dev/loop0 /mnt/tmp
12 > >
13 > > But, how to do it if the file structure is: sda -> sda1, sda2? I need to get
14 > > data from sda1 and sda2 :-|
15 > >
16 > > Thanks a lot for help.
17 > >
18 > > Pat
19 > > --
20 > > gentoo-user@l.g.o mailing list
21 > >
22 > >
23 >
24 > I don't have time to test, but try something like this:
25 >
26 > (from: http://lwn.net/Articles/110426/)
27 >
28 > losetup /dev/loop0 file.iso
29 > blockdev --rereadpt /dev/loop0
30 > mount /dev/loop0p2 /mnt/temp (for p2 replace with other partition,
31 > check ls /sys/block/loop0/dev)
32 > --
33 > gentoo-user@l.g.o mailing list
34
35 Thanks, but it ends with:
36 BLKRRPART: Invalid argument
37
38 The problem can be that I did dd at disk with broken partition table. So over
39 the disk image I've run testdisk utility and it found the partitions - labels
40 and the correct sizes (as far as I remember). There are two partitions NTFS
41 and FAT32 and using the testdisk utility, it enables me to browse the FAT
42 partition, so I thing the testdisk succeeded.
43
44 Any idea at that?
45
46 Thanks a lot.
47
48 Pat
49 --
50 gentoo-user@l.g.o mailing list