How can I recover partiton from disk LVM2-ext4 (or photorec files /home/user/*)

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
joku
Posts: 3
Joined: 12 Apr 2017, 15:02

How can I recover partiton from disk LVM2-ext4 (or photorec files /home/user/*)

#1 Post by joku »

Need your advice what to do to recover one of LVM2 ext4 partitions (label wattsOS)
  • file /proc/partitions is absent, here is approximately what I had before system fault:
    • Code: Select all

      [[primary SDA1-146M][Extended with 2 partitions-lost][and 3 partitions created in free space (pv, vg)-lost]
      • this info I got from testdisk (cursor placed on Linux LVM):

      Code: Select all

      Disk /dev/sda - 1000 GB/931 GiB - CHS 121601 255 63
                          Partition           Start             End     Size in sectors
      148Mb/141MiB D Linux             0     1    1     17  254  63      289107  [boot]
      51Gb/48GiB   D Linux            18    26    9   6314  178   8   101154816   [Lin]
      903Gb/841GiB D Linux           6708   27   40 116501  240  27  1763837952  [Ruby]
                  >D Linux LVM      116501 240   28 121601   90  25    81922048
      got this "no partition found" (LVM2, 41GB/39GiB)
      PS: don't understand why pgcfgrestore didn't work(no pv?) and what kind of strategy to use to get files from my profile on one of the LVM volumes (wattsOS)

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: How can I recover partiton from disk LVM2-ext4 (or photorec files /home/user/*)

#2 Post by cgrenier »

Please copy and paste the testdisk.log file content.

joku
Posts: 3
Joined: 12 Apr 2017, 15:02

Re: How can I recover partiton from disk LVM2-ext4 (or photorec files /home/user/*)

#3 Post by joku »

Here is it:

Code: Select all


Fri Apr 14 12:54:42 2017
Command line: TestDisk

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
OS: Linux, kernel 4.5.0-2-686 (#1 SMP Debian 4.5.2-1 (2016-04-28)) i686
Compiler: GCC 5.3
ext2fs lib: 1.43-WIP, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.0
/dev/sda: LBA, HPA, LBA48, DCO support
/dev/sda: size       1953525168 sectors
/dev/sda: user_max   1953525168 sectors
/dev/sda: native_max 1953525168 sectors
/dev/sda: dco        1953525168 sectors
Warning: can't get size for Disk /dev/mapper/control - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/md - 0 B - 0 sectors (RO), sector size=512
Hard disk list
Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63, sector size=512 - WDC WD10SPCX-21KHST0, S/N:WD-WXG1A958X943, FW:01.01A01
Disk /dev/sdb - 7964 MB / 7596 MiB - CHS 1019 246 62, sector size=512 - Mass Storage Device
Disk /dev/sdc - 15 GB / 14 GiB - CHS 15175 64 32, sector size=512 - Mass Storage Device

Partition table type (auto): Intel
Disk /dev/sda - 1000 GB / 931 GiB - WDC WD10SPCX-21KHST0
Partition table type: Intel
New options :
 Dump : Yes
 Align partition: Yes
 Expert mode : Yes

Analyse Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63
Geometry from i386 MBR: head=255 sector=63
get_geometry_from_list_part_aux head=255 nbr=2
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=16 nbr=1
get_geometry_from_list_part_aux head=32 nbr=1
get_geometry_from_list_part_aux head=64 nbr=1
get_geometry_from_list_part_aux head=128 nbr=1
get_geometry_from_list_part_aux head=240 nbr=1
get_geometry_from_list_part_aux head=255 nbr=2
Current partition structure:
 1 * Linux                    0   1  1    17 254 63     289107

search_part()
Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63

EXT2/EXT3 magic value at 0/1/1
0000 408d0000 2a8d0000 0e070000 90780000   @...*........x..
0010 358d0000 00000000 02000000 02000000   5...............
0020 00800000 00800000 a0460000 00000000   .........F......
0030 7d74ea58 0000ffff 53ef0100 01000000   }t.X....S.......
0040 7d74ea58 00000000 00000000 01000000   }t.X............
0050 00000000 0b000000 80000000 3c000000   ............<...
0060 c2020000 6b040000 c541cc7b 20664c7d   ....k....A.{ fL}
0070 90baf07d 8ccdd58f 00000000 00000000   ...}............
0080 00000000 00000000 00000000 00000000   ................
0090 00000000 00000000 00000000 00000000   ................
00A0 00000000 00000000 00000000 00000000   ................
00B0 00000000 00000000 00000000 00000000   ................
00C0 00000000 00000000 00000000 00001100   ................
00D0 00000000 00000000 00000000 00000000   ................
00E0 08000000 00000000 00000000 f6f7cb96   ................
00F0 bbac49a0 a960ae24 7d280b69 01014000   ..I..`.$}(.i..@.
0100 0c000000 00000000 3974ea58 0af30100   ........9t.X....
0110 04000000 00000000 00000000 00100000   ................
0120 87040000 00000000 00000000 00000000   ................
0130 00000000 00000000 00000000 00000000   ................
0140 00000000 00000000 00000000 00000001   ................
0150 00000000 00000000 00000000 00000000   ................
0160 01000000 00000000 00000000 00000000   ................
0170 00000000 04010000 e5400000 00000000   .........@......
0180 00000000 00000000 00000000 00000000   ................
0190 00000000 00000000 00000000 00000000   ................
01A0 00000000 00000000 00000000 00000000   ................
01B0 00000000 00000000 00000000 00000000   ................
01C0 00000000 00000000 00000000 00000000   ................
01D0 00000000 00000000 00000000 00000000   ................
01E0 00000000 00000000 00000000 00000000   ................
01F0 00000000 00000000 00000000 00000000   ................

recover_EXT2: s_block_group_nr=0/1, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=18080
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 36138
recover_EXT2: part_size 289104
     Linux                    0   1  1    17 254 60     289104
     ext4 blocksize=4096 Large_file Sparse_SB, 148 MB / 141 MiB

EXT2/EXT3 magic value at 18/26/9
0000 c00f3000 00f0c000 98a50900 172f7300   ..0........../s.
0010 66802900 00000000 02000000 02000000   f.).............
0020 00800000 00800000 e01f0000 3a71cb58   ............:q.X
0030 797dcc58 0100ffff 53ef0100 01000000   y}.X....S.......
0040 ae70cb58 00000000 00000000 01000000   .p.X............
0050 00000000 0b000000 00010000 3c000000   ............<...
0060 42020000 7b000000 3e665f94 f6e14463   B...{...>f_...Dc
0070 8f72b5a2 51f1c011 4c756269 74000000   .r..Q...Lubit...
0080 00000000 00000000 2f6d6564 69612f73   ......../media/s
0090 616c6573 73696f6e 61746f2f 4c756269   alessionato/Lubi
00A0 74002d34 3436332d 38663732 2d623561   t.-4463-8f72-b5a
00B0 32353166 31633031 31000000 00000000   251f1c011.......
00C0 00000000 00000000 00000000 0000fc03   ................
00D0 00000000 00000000 00000000 00000000   ................
00E0 08000000 00000000 00000000 f3ae6f16   ..............o.
00F0 57434ec4 9473f052 39d484ed 01010000   WCN..s.R9.......
0100 0c000000 00000000 5f92a655 0af30200   ........_..U....
0110 04000000 00000000 00000000 ff7f0000   ................
0120 01842800 ff7f0000 01000000 00042900   ..(...........).
0130 00000000 00000000 00000000 00000000   ................
0140 00000000 00000000 00000000 00000008   ................
0150 00000000 00000000 00000000 1c001c00   ................
0160 01000000 00000000 00000000 00000000   ................
0170 00000000 04000000 be67a37e 00000000   .........g.~....
0180 00000000 00000000 00000000 00000000   ................
0190 00000000 00000000 00000000 00000000   ................
01A0 00000000 00000000 00000000 00000000   ................
01B0 00000000 00000000 00000000 00000000   ................
01C0 00000000 00000000 00000000 00000000   ................
01D0 00000000 00000000 00000000 00000000   ................
01E0 00000000 00000000 00000000 00000000   ................
01F0 00000000 00000000 00000000 00000000   ................

recover_EXT2: s_block_group_nr=0/385, s_mnt_count=1/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8160
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 12644352
recover_EXT2: part_size 101154816
     Linux                   18  26  9  6314 178  8  101154816 [Lubit]
     ext4 blocksize=4096 Large_file Sparse_SB, 51 GB / 48 GiB

EXT2/EXT3 magic value at 6708/27/40
0000 00204903 0041240d 7136a800 1ecb6003   . I..A$.q6....`.
0010 f0134803 00000000 02000000 02000000   ..H.............
0020 00800000 00800000 00200000 0efeca58   ......... .....X
0030 0efeca58 e300ffff 53ef0100 01000000   ...X....S.......
0040 1cfdb257 00000000 00000000 01000000   ...W............
0050 00000000 0b000000 00010000 3c000000   ............<...
0060 c6020000 6b040000 4c9e7711 491c4f5e   ....k...L.w.I.O^
0070 a1532abb 4f8c03f0 52756279 00000000   .S*.O...Ruby....
0080 00000000 00000000 2f6d6564 69612f73   ......../media/s
0090 616c6573 73696f6e 61746f2f 52756279   alessionato/Ruby
00A0 00373131 2d343931 632d3466 35652d61   .711-491c-4f5e-a
00B0 3135332d 32616262 34663863 30336630   153-2abb4f8c03f0
00C0 00000000 00000000 00000000 00000004   ................
00D0 00000000 00000000 00000000 00000000   ................
00E0 08000000 00000000 00000000 04811d2d   ...............-
00F0 ade4463e 904f13b3 00d96163 01014000   ..F>.O....ac..@.
0100 0c000000 00000000 1ab25c57 0af30100   ..........\W....
0110 04000000 00000000 00000000 00800000   ................
0120 0080b006 00000000 00000000 00000000   ................
0130 00000000 00000000 00000000 00000000   ................
0140 00000000 00000000 00000000 00000008   ................
0150 00000000 00000000 00000000 20002000   ............ . .
0160 01000000 00000000 00000000 00000000   ................
0170 00000000 04010000 76786353 00000000   ........vxcS....
0180 00000000 00000000 00000000 00000000   ................
0190 00000000 00000000 00000000 00000000   ................
01A0 00000000 00000000 00000000 00000000   ................
01B0 00000000 00000000 00000000 00000000   ................
01C0 00000000 00000000 00000000 00000000   ................
01D0 00000000 00000000 00000000 00000000   ................
01E0 00000000 00000000 00000000 00000000   ................
01F0 00000000 00000000 00000000 00000000   ................

recover_EXT2: s_block_group_nr=0/6728, s_mnt_count=227/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 220479744
recover_EXT2: part_size 1763837952
     Linux                 6708  27 40 116501 240 27 1763837952 [Ruby]
     ext4 blocksize=4096 Large_file Sparse_SB Recover, 903 GB / 841 GiB

LVM2 magic value at 116501/240/28
0000 4c414245 4c4f4e45 01000000 00000000   LABELONE........
0010 998766bd 20000000 4c564d32 20303031   ..f. ...LVM2 001
0020 74313674 51576439 55505254 4a463373   t16tQWd9UPRTJF3s
0030 4f494138 50566e65 34427579 54555752   OIA8PVne4BuyTUWR
0040 00600bc4 09000000 00001000 00000000   .`..............
0050 00000000 00000000 00000000 00000000   ................
0060 00000000 00000000 00100000 00000000   ................
0070 00f00f00 00000000 00000000 00000000   ................
0080 00000000 00000000 00000000 00000000   ................
0090 00000000 00000000 00000000 00000000   ................
00A0 00000000 00000000 00000000 00000000   ................
00B0 00000000 00000000 00000000 00000000   ................
00C0 00000000 00000000 00000000 00000000   ................
00D0 00000000 00000000 00000000 00000000   ................
00E0 00000000 00000000 00000000 00000000   ................
00F0 00000000 00000000 00000000 00000000   ................
0100 00000000 00000000 00000000 00000000   ................
0110 00000000 00000000 00000000 00000000   ................
0120 00000000 00000000 00000000 00000000   ................
0130 00000000 00000000 0000000
...waiting for deeper search to finish (pv0's uuid t16tQWd9UPRTJF3s... was found!)

There is log after deeper search:https://gist.github.com/JuPlutonic/2624 ... 0c05202d20The log contains strange hints about changing block size for almost all found partitions like
recover_EXT2: "e2fsck -b 11239424 -B 4096 device" may be needed

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: How can I recover partiton from disk LVM2-ext4 (or photorec files /home/user/*)

#4 Post by cgrenier »

Set the following three partitions as *(bootable) or P(rimary) as following

Code: Select all

   * Linux                    0   1  1    17 254 63     289107
     ext4 blocksize=4096 Large_file Sparse_SB, 148 MB / 141 MiB
   P Linux                   18  26  9  6314 178  8  101154816 [Lubit]
     ext4 blocksize=4096 Large_file Sparse_SB, 51 GB / 48 GiB
   P Linux LVM            101416  23 48 106515 128 45   81922048
     LVM2, 41 GB / 39 GiB
On next screen, choose Write, confirm, Quit and restart your computer

joku
Posts: 3
Joined: 12 Apr 2017, 15:02

Re: How can I recover partiton from disk LVM2-ext4 (or photorec files /home/user/*)

#5 Post by joku »

Thank you,
set lvm to primary and writed and got profit!
cgrenier wrote: 15 Apr 2017, 08:35 Set the following three partitions as *(bootable) or P(rimary) as following

Code: Select all

   * Linux                    0   1  1    17 254 63     289107
     ext4 blocksize=4096 Large_file Sparse_SB, 148 MB / 141 MiB
   P Linux                   18  26  9  6314 178  8  101154816 [Lubit]
     ext4 blocksize=4096 Large_file Sparse_SB, 51 GB / 48 GiB
   P Linux LVM            101416  23 48 106515 128 45   81922048
     LVM2, 41 GB / 39 GiB
On next screen, choose Write, confirm, Quit and restart your computer

Locked