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 04-06-2008, 09:52 PM
"pat"
 
Default mounting disk image

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
 
Old 04-06-2008, 09:54 PM
"pat"
 
Default mounting disk image

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
 
Old 04-06-2008, 10:07 PM
Alan McKinnon
 
Default mounting disk image

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
 
Old 04-06-2008, 10:17 PM
"pat"
 
Default mounting disk image

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
 
Old 04-06-2008, 10:18 PM
"Andrey Falko"
 
Default mounting disk image

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
 
Old 04-06-2008, 10:24 PM
Alan McKinnon
 
Default mounting disk image

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
 
Old 04-06-2008, 10:25 PM
"pat"
 
Default mounting disk image

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
 
Old 04-06-2008, 10:30 PM
"pat"
 
Default mounting disk image

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
 
Old 04-07-2008, 04:38 AM
Stroller
 
Default mounting disk image

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
 
Old 04-07-2008, 11:10 AM
David Relson
 
Default mounting disk image

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
 

Thread Tools




All times are GMT. The time now is 07:34 AM.

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