
On Wednesday 24 October 2007 16:13:11 Glenn Enright wrote:
On 24/10/2007, Chris O'Halloran <cmoman(a)gmail.com> wrote:
However, I notice that somehow I made an image of the whole harddrive (12 partitions) and it stored on my USB drive too as /kubuntu/dev/hda
The following link appears to have the answer...
Thanks very much for the feedback. It seems I might be pretty close
From the website it talks about using the file, fdisk and mount commands.
File returns some information but sfdisk -l / returns <quote> cmoman(a)neptune:/mnt$ sfdisk -l /media/disk/kubuntu/kubuntu/dev/hda Disk /media/disk/kubuntu/kubuntu/dev/hda: cannot get geometry Disk /media/disk/kubuntu/kubuntu/dev/hda: 0 cylinders, 0 heads, 0 sectors/track read: Inappropriate ioctl for device sfdisk: read error on /media/disk/kubuntu/kubuntu/dev/hda - cannot read sector 59922450 Warning: The partition table looks like it was made for C/H/S=*/255/63 (instead of 0/0/0). For this listing I'll assume that geometry. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /media/disk/kubuntu/kubuntu/dev/hda1 0+ 63 64- 514048+ 82 Linux swap / Solaris /media/disk/kubuntu/kubuntu/dev/hda2 64 9727 9664 77626080 f W95 Ext'd (LBA) /media/disk/kubuntu/kubuntu/dev/hda3 0 - 0 0 0 Empty /media/disk/kubuntu/kubuntu/dev/hda4 0 - 0 0 0 Empty /media/disk/kubuntu/kubuntu/dev/hda5 64+ 67 4- 32098+ 83 Linux /media/disk/kubuntu/kubuntu/dev/hda6 68+ 1373 1306- 10490413+ 83 Linux /media/disk/kubuntu/kubuntu/dev/hda7 1374+ 1896 523- 4200966 83 Linux /media/disk/kubuntu/kubuntu/dev/hda8 * 1897+ 1900 4- 32098+ 83 Linux /media/disk/kubuntu/kubuntu/dev/hda9 1901+ 3206 1306- 10490413+ 83 Linux /media/disk/kubuntu/kubuntu/dev/hda10 3207+ 3729 523- 4200966 83 Linux </quote> Now provided the disk isn't entirely corrupt I can supposedly calculate the offset and use the following command where 559319040 is the offset in bytes. cmoman(a)neptune:/mnt$ sudo mount -t ext2 -o loop,offset=559319040 /media/disk/kubuntu/kubuntu/dev/hda partition1/ the following error is returned. mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so 8225280*68=559319040 8225280 being the bytes per cylinder and 68 being the number of cylinders to the mount point of /hda6 And trying 8225280*(68+64)=1085736960 doesn't seem to work either (I am not sure how the extended partition works). Obviously I can't really brute force this so I am trying to work out the number of bytes I need to put in the offset variable to start the mount point on the image. Thanks again for your ideas. Cheers Chris