* [gentoo-user] mounting disk image @ 2008-04-06 21:03 pat 2008-04-06 21:16 ` Alan McKinnon ` (2 more replies) 0 siblings, 3 replies; 13+ messages in thread From: pat @ 2008-04-06 21:03 UTC (permalink / raw To: Gentoo Hello, I have a question about mounting disk image as the disk. I have disk image which was created using: dd if=/dev/sda of=./file.iso and the sda contained two partitions sda1 and sda2. I know, that if I have only image of the sda1 I can mount it using loop device like #losetup /dev/loop0 file.iso #mount -t ... /dev/loop0 /mnt/tmp But, how to do it if the file structure is: sda -> sda1, sda2? I need to get data from sda1 and sda2 :-| Thanks a lot for help. Pat -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 21:03 [gentoo-user] mounting disk image pat @ 2008-04-06 21:16 ` Alan McKinnon 2008-04-06 21:54 ` pat 2008-04-06 21:19 ` Andrey Falko 2008-04-07 4:38 ` Stroller 2 siblings, 1 reply; 13+ messages in thread From: Alan McKinnon @ 2008-04-06 21:16 UTC (permalink / raw To: gentoo-user On Sunday 06 April 2008, pat wrote: > Hello, > > I have a question about mounting disk image as the disk. I have disk > image which was created using: > dd if=/dev/sda of=./file.iso > and the sda contained two partitions sda1 and sda2. I know, that if I > have only image of the sda1 I can mount it using loop device like > #losetup /dev/loop0 file.iso > #mount -t ... /dev/loop0 /mnt/tmp > > But, how to do it if the file structure is: sda -> sda1, sda2? I need > to get data from sda1 and sda2 :-| losetup -o <offset_value> /dev/loop<something> see man losetup -- Alan McKinnon alan dot mckinnon at gmail dot com -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 21:16 ` Alan McKinnon @ 2008-04-06 21:54 ` pat 2008-04-06 22:07 ` Alan McKinnon 0 siblings, 1 reply; 13+ messages in thread From: pat @ 2008-04-06 21:54 UTC (permalink / raw To: gentoo-user On Sun, 6 Apr 2008 23:16:54 +0200, Alan McKinnon wrote > On Sunday 06 April 2008, pat wrote: > > Hello, > > > > I have a question about mounting disk image as the disk. I have disk > > image which was created using: > > dd if=/dev/sda of=./file.iso > > and the sda contained two partitions sda1 and sda2. I know, that if I > > have only image of the sda1 I can mount it using loop device like > > #losetup /dev/loop0 file.iso > > #mount -t ... /dev/loop0 /mnt/tmp > > > > But, how to do it if the file structure is: sda -> sda1, sda2? I need > > to get data from sda1 and sda2 :-| > > losetup -o <offset_value> /dev/loop<something> > > see man losetup > > -- > Alan McKinnon > alan dot mckinnon at gmail dot com > > -- > gentoo-user@lists.gentoo.org mailing list Thanks. How to count the offset? And where can I get the partitions offsets? Pat -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 21:54 ` pat @ 2008-04-06 22:07 ` Alan McKinnon 2008-04-06 22:17 ` pat 2008-04-06 22:18 ` Andrey Falko 0 siblings, 2 replies; 13+ messages in thread From: Alan McKinnon @ 2008-04-06 22:07 UTC (permalink / raw To: gentoo-user On Sunday 06 April 2008, pat wrote: > On Sun, 6 Apr 2008 23:16:54 +0200, Alan McKinnon wrote > > > On Sunday 06 April 2008, pat wrote: > > > Hello, > > > > > > I have a question about mounting disk image as the disk. I have > > > disk image which was created using: > > > dd if=/dev/sda of=./file.iso > > > and the sda contained two partitions sda1 and sda2. I know, that > > > if I have only image of the sda1 I can mount it using loop device > > > like #losetup /dev/loop0 file.iso > > > #mount -t ... /dev/loop0 /mnt/tmp > > > > > > But, how to do it if the file structure is: sda -> sda1, sda2? I > > > need to get data from sda1 and sda2 :-| > > > > losetup -o <offset_value> /dev/loop<something> > > > > see man losetup > > Thanks. How to count the offset? And where can I get the partitions > offsets? Is the original disk still intact? Then fdisk would tell you the offset -- Alan McKinnon alan dot mckinnon at gmail dot com -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 22:07 ` Alan McKinnon @ 2008-04-06 22:17 ` pat 2008-04-06 22:24 ` Alan McKinnon 2008-04-06 22:18 ` Andrey Falko 1 sibling, 1 reply; 13+ messages in thread From: pat @ 2008-04-06 22:17 UTC (permalink / raw To: gentoo-user On Mon, 7 Apr 2008 00:07:58 +0200, Alan McKinnon wrote > On Sunday 06 April 2008, pat wrote: > > On Sun, 6 Apr 2008 23:16:54 +0200, Alan McKinnon wrote > > > > > On Sunday 06 April 2008, pat wrote: > > > > Hello, > > > > > > > > I have a question about mounting disk image as the disk. I have > > > > disk image which was created using: > > > > dd if=/dev/sda of=./file.iso > > > > and the sda contained two partitions sda1 and sda2. I know, that > > > > if I have only image of the sda1 I can mount it using loop device > > > > like #losetup /dev/loop0 file.iso > > > > #mount -t ... /dev/loop0 /mnt/tmp > > > > > > > > But, how to do it if the file structure is: sda -> sda1, sda2? I > > > > need to get data from sda1 and sda2 :-| > > > > > > losetup -o <offset_value> /dev/loop<something> > > > > > > see man losetup > > > > Thanks. How to count the offset? And where can I get the partitions > > offsets? > > Is the original disk still intact? Then fdisk would tell you the offset > > -- > Alan McKinnon > alan dot mckinnon at gmail dot com > > -- > gentoo-user@lists.gentoo.org mailing list Well, yes and no :-( The partition table of the original table has crashed, so I've created the ISO image of the disk and now playing with it ... but, the original drive is still untouched. So, I should play with hard drive directly instead using the dd copy? To partition table recovery in the ISO image I've used the testdisk utility. Any suggestions? Thanks a lot. Pat -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 22:17 ` pat @ 2008-04-06 22:24 ` Alan McKinnon 2008-04-06 22:30 ` pat 0 siblings, 1 reply; 13+ messages in thread From: Alan McKinnon @ 2008-04-06 22:24 UTC (permalink / raw To: gentoo-user On Monday 07 April 2008, pat wrote: > Well, yes and no :-( The partition table of the original table has > crashed, so I've created the ISO image of the disk and now playing > with it ... but, the original drive is still untouched. So, I should > play with hard drive directly instead using the dd copy? To partition > table recovery in the ISO image I've used the testdisk utility. > > Any suggestions? To be safe I would mount the .iso devices read-only till you are sure you have found the correct offsets. Only use the original disk if you really have no other option -- Alan McKinnon alan dot mckinnon at gmail dot com -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 22:24 ` Alan McKinnon @ 2008-04-06 22:30 ` pat 0 siblings, 0 replies; 13+ messages in thread From: pat @ 2008-04-06 22:30 UTC (permalink / raw To: gentoo-user On Mon, 7 Apr 2008 00:24:55 +0200, Alan McKinnon wrote > On Monday 07 April 2008, pat wrote: > > > Well, yes and no :-( The partition table of the original table has > > crashed, so I've created the ISO image of the disk and now playing > > with it ... but, the original drive is still untouched. So, I should > > play with hard drive directly instead using the dd copy? To partition > > table recovery in the ISO image I've used the testdisk utility. > > > > Any suggestions? > > To be safe I would mount the .iso devices read-only till you are > sure you have found the correct offsets. Only use the original disk > if you really have no other option > > -- > Alan McKinnon > alan dot mckinnon at gmail dot com > > -- > gentoo-user@lists.gentoo.org mailing list OK. Thanks. Pat -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 22:07 ` Alan McKinnon 2008-04-06 22:17 ` pat @ 2008-04-06 22:18 ` Andrey Falko 2008-04-06 22:25 ` pat 1 sibling, 1 reply; 13+ messages in thread From: Andrey Falko @ 2008-04-06 22:18 UTC (permalink / raw To: gentoo-user On Sun, Apr 6, 2008 at 6:07 PM, Alan McKinnon <alan.mckinnon@gmail.com> wrote: > On Sunday 06 April 2008, pat wrote: > > On Sun, 6 Apr 2008 23:16:54 +0200, Alan McKinnon wrote > > > > > On Sunday 06 April 2008, pat wrote: > > > > Hello, > > > > > > > > I have a question about mounting disk image as the disk. I have > > > > disk image which was created using: > > > > dd if=/dev/sda of=./file.iso > > > > and the sda contained two partitions sda1 and sda2. I know, that > > > > if I have only image of the sda1 I can mount it using loop device > > > > like #losetup /dev/loop0 file.iso > > > > #mount -t ... /dev/loop0 /mnt/tmp > > > > > > > > But, how to do it if the file structure is: sda -> sda1, sda2? I > > > > need to get data from sda1 and sda2 :-| > > > > > > losetup -o <offset_value> /dev/loop<something> > > > > > > see man losetup > > > > > Thanks. How to count the offset? And where can I get the partitions > > offsets? > > Is the original disk still intact? Then fdisk would tell you the offset > > > I'm pretty sure you can fdisk -l test.iso....maybe not, but worth a try if you don't have the original disk :). > > -- > Alan McKinnon > alan dot mckinnon at gmail dot com > > -- > gentoo-user@lists.gentoo.org mailing list > > -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 22:18 ` Andrey Falko @ 2008-04-06 22:25 ` pat 0 siblings, 0 replies; 13+ messages in thread From: pat @ 2008-04-06 22:25 UTC (permalink / raw To: gentoo-user On Sun, 6 Apr 2008 18:18:57 -0400, Andrey Falko wrote > On Sun, Apr 6, 2008 at 6:07 PM, Alan McKinnon > <alan.mckinnon@gmail.com> wrote: > > On Sunday 06 April 2008, pat wrote: > > > On Sun, 6 Apr 2008 23:16:54 +0200, Alan McKinnon wrote > > > > > > > On Sunday 06 April 2008, pat wrote: > > > > > Hello, > > > > > > > > > > I have a question about mounting disk image as the disk. I have > > > > > disk image which was created using: > > > > > dd if=/dev/sda of=./file.iso > > > > > and the sda contained two partitions sda1 and sda2. I know, that > > > > > if I have only image of the sda1 I can mount it using loop device > > > > > like #losetup /dev/loop0 file.iso > > > > > #mount -t ... /dev/loop0 /mnt/tmp > > > > > > > > > > But, how to do it if the file structure is: sda -> sda1, sda2? I > > > > > need to get data from sda1 and sda2 :-| > > > > > > > > losetup -o <offset_value> /dev/loop<something> > > > > > > > > see man losetup > > > > > > > > Thanks. How to count the offset? And where can I get the partitions > > > offsets? > > > > Is the original disk still intact? Then fdisk would tell you the offset > > > > > > > I'm pretty sure you can fdisk -l test.iso....maybe not, but worth a > try if you don't have the original disk :). > > > > -- > > Alan McKinnon > > alan dot mckinnon at gmail dot com > > > > -- > > gentoo-user@lists.gentoo.org mailing list > > > > > -- > gentoo-user@lists.gentoo.org mailing list Well, I'm not the low level guru :-) This is the first time I playing with data/partitions recovery :-\ The fdisk gives me: Partition 1 has different physical/logical endings: phys=(1023, 254, 63) logical=(19456, 254, 63) /mnt/tmp/recovery.dd.2.iso5 16612 19457 22860463+ c W95 FAT32 (LBA) Which number should I use? Pat -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 21:03 [gentoo-user] mounting disk image pat 2008-04-06 21:16 ` Alan McKinnon @ 2008-04-06 21:19 ` Andrey Falko 2008-04-06 21:52 ` pat 2008-04-07 4:38 ` Stroller 2 siblings, 1 reply; 13+ messages in thread From: Andrey Falko @ 2008-04-06 21:19 UTC (permalink / raw To: gentoo-user On Sun, Apr 6, 2008 at 5:03 PM, pat <pat@xvalheru.org> wrote: > Hello, > > I have a question about mounting disk image as the disk. I have disk image > which was created using: > dd if=/dev/sda of=./file.iso > and the sda contained two partitions sda1 and sda2. I know, that if I have > only image of the sda1 I can mount it using loop device like > #losetup /dev/loop0 file.iso > #mount -t ... /dev/loop0 /mnt/tmp > > But, how to do it if the file structure is: sda -> sda1, sda2? I need to get > data from sda1 and sda2 :-| > > Thanks a lot for help. > > Pat > -- > gentoo-user@lists.gentoo.org mailing list > > I don't have time to test, but try something like this: (from: http://lwn.net/Articles/110426/) losetup /dev/loop0 file.iso blockdev --rereadpt /dev/loop0 mount /dev/loop0p2 /mnt/temp (for p2 replace with other partition, check ls /sys/block/loop0/dev) -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 21:19 ` Andrey Falko @ 2008-04-06 21:52 ` pat 0 siblings, 0 replies; 13+ messages in thread From: pat @ 2008-04-06 21:52 UTC (permalink / raw To: gentoo-user On Sun, 6 Apr 2008 17:19:33 -0400, Andrey Falko wrote > On Sun, Apr 6, 2008 at 5:03 PM, pat <pat@xvalheru.org> wrote: > > Hello, > > > > I have a question about mounting disk image as the disk. I have disk image > > which was created using: > > dd if=/dev/sda of=./file.iso > > and the sda contained two partitions sda1 and sda2. I know, that if I have > > only image of the sda1 I can mount it using loop device like > > #losetup /dev/loop0 file.iso > > #mount -t ... /dev/loop0 /mnt/tmp > > > > But, how to do it if the file structure is: sda -> sda1, sda2? I need to get > > data from sda1 and sda2 :-| > > > > Thanks a lot for help. > > > > Pat > > -- > > gentoo-user@lists.gentoo.org mailing list > > > > > > I don't have time to test, but try something like this: > > (from: http://lwn.net/Articles/110426/) > > losetup /dev/loop0 file.iso > blockdev --rereadpt /dev/loop0 > mount /dev/loop0p2 /mnt/temp (for p2 replace with other partition, > check ls /sys/block/loop0/dev) > -- > gentoo-user@lists.gentoo.org mailing list Thanks, but it ends with: BLKRRPART: Invalid argument The problem can be that I did dd at disk with broken partition table. So over the disk image I've run testdisk utility and it found the partitions - labels and the correct sizes (as far as I remember). There are two partitions NTFS and FAT32 and using the testdisk utility, it enables me to browse the FAT partition, so I thing the testdisk succeeded. Any idea at that? Thanks a lot. Pat -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-06 21:03 [gentoo-user] mounting disk image pat 2008-04-06 21:16 ` Alan McKinnon 2008-04-06 21:19 ` Andrey Falko @ 2008-04-07 4:38 ` Stroller 2008-04-07 11:10 ` David Relson 2 siblings, 1 reply; 13+ messages in thread From: Stroller @ 2008-04-07 4:38 UTC (permalink / raw To: gentoo-user On 6 Apr 2008, at 22:03, pat wrote: > ... > I have a question about mounting disk image as the disk. I have > disk image > which was created using: > dd if=/dev/sda of=./file.iso > and the sda contained two partitions sda1 and sda2. I know, that if > I have > only image of the sda1 I can mount it using loop device like > #losetup /dev/loop0 file.iso > #mount -t ... /dev/loop0 /mnt/tmp > > But, how to do it if the file structure is: sda -> sda1, sda2? I > need to get > data from sda1 and sda2 :-| Hi there, I have a similar disk image I need to access in the same way. I asked about this on the list a while ago & received some helpful replies. Unfortunately I got busy with work right after posting, and haven't had a chance to try them, yet, but maybe you'll find them useful: http://thread.gmane.org/gmane.linux.gentoo.user/193263 Stroller. -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] mounting disk image 2008-04-07 4:38 ` Stroller @ 2008-04-07 11:10 ` David Relson 0 siblings, 0 replies; 13+ messages in thread From: David Relson @ 2008-04-07 11:10 UTC (permalink / raw To: gentoo-user On Mon, 7 Apr 2008 05:38:54 +0100 Stroller wrote: > > On 6 Apr 2008, at 22:03, pat wrote: > > ... > > I have a question about mounting disk image as the disk. I have > > disk image > > which was created using: > > dd if=/dev/sda of=./file.iso > > and the sda contained two partitions sda1 and sda2. I know, that > > if I have > > only image of the sda1 I can mount it using loop device like > > #losetup /dev/loop0 file.iso > > #mount -t ... /dev/loop0 /mnt/tmp > > > > But, how to do it if the file structure is: sda -> sda1, sda2? I > > need to get > > data from sda1 and sda2 :-| > > Hi there, > > I have a similar disk image I need to access in the same way. I > asked about this on the list a while ago & received some helpful > replies. > > Unfortunately I got busy with work right after posting, and haven't > had a chance to try them, yet, but maybe you'll find them useful: > http://thread.gmane.org/gmane.linux.gentoo.user/193263 > > Stroller. On an occasion or two, I've had linux installs overwrite a partition table when I wasn't paying close occasion. Using google I found TestDisk which is a program that is able to recover partition tables. I've used it successfully 2 or 3 times. I've also encountered one situation where I broke the partition table with dd and TestDisk wasn't able to help. So, mileage varies :-> David -- gentoo-user@lists.gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-04-07 11:11 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-04-06 21:03 [gentoo-user] mounting disk image pat 2008-04-06 21:16 ` Alan McKinnon 2008-04-06 21:54 ` pat 2008-04-06 22:07 ` Alan McKinnon 2008-04-06 22:17 ` pat 2008-04-06 22:24 ` Alan McKinnon 2008-04-06 22:30 ` pat 2008-04-06 22:18 ` Andrey Falko 2008-04-06 22:25 ` pat 2008-04-06 21:19 ` Andrey Falko 2008-04-06 21:52 ` pat 2008-04-07 4:38 ` Stroller 2008-04-07 11:10 ` David Relson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox