okei, here is what i have done till this moment.
I really hope other people never have to read this on stressful moments.
So i need two things
a. partition table
b. LVM configuration.
are there any in my disk image ?
Search for strings at your disk image to extract any useful info.
# strings -t d laptop.img > laptop.img.str
keep in mind that this could be a very large file. For a 250Gb disk my laptop.img.str is about 60Gb !
We need to do this cause ... its much more efficient to search in a 60Gb file and not in 250Gb disk image file.
# head -1 /etc/lvm/backup/VG_file
will return something like this:
# Generated by LVM2 version 2.02.98(2) (2012-10-15): Mon Nov 5 09:10:16 2012
so i now that i should search for "# Generated by LVM2 version " in laptop.img.str
and i did
# grep -E --color '# Generated by LVM2 version ' laptop.img.str > LVM2.extracts
i've found a lot. Sorted my date and something like:
24956608512 # Generated by LVM2 version 2.02.97(2) (2012-08-07): Sat Sep 22 16:22:39 2012
was the result.
okei so there is something useful about lvm2 configuration.
Almost every disk has a 512 bytes sector, so calculate it:
# echo 24956608512/512|bc
hmmm lets hope to find something interesting :
# dd if=laptop.img bs=512 skip=48743376 count=1
and in fact something very beatiful came to my screen
# Generated by LVM2 version 2.02.97(2) (2012-08-07): Sat Sep 22 16:22:39 2012
contents = "Text Format Volume Group"
version = 1
description = "Created *after* executing 'lvextend -l +100%FREE /dev/vg01/mmoviess'"
creation_host = "mylaptop" # Linux mylaptop 3.5.3-1-ARCH #1 SMP PREEMPT Sun Aug 26 09:14:51 CEST 2012 x86_64
creation_time = 1348320159 # Sat Sep 22 16:22:39 2012
changing count from 1 to 4 and i now have my entire LVM2 conf file. Backup somewhere safe and continue with the partition table.
I now that i had three (3) primary partitions. sda1 - sda2 - sda3
So i thought to search for them at laptop.img.str.
Finally and with the above steps i found this:
Disk /dev/sda: 250.1 GB, 250059350016 bytes, 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b13ab
Device Boot Start End Blocks Id System
/dev/sda1 * 20 41945087 20972534 7 HPFS/NTFS/exFAT
/dev/sda2 41945088 42469375 262144 83 Linux
/dev/sda3 42469376 488397167 222963896 8e Linux LVM
Testdisk report didnt help at all.
hexdump became my new best friend !
also useful: grep with -a -b parameters and losetup with offset paramater !
no extra software - no extra installs - nothing.
just basic cmds with powerful use.