I have accidentally deleted a file that I want to recover. The partition is an ext4 partition inside an LVM partition that is encrypted with dm-crypt/LUKS.

The encrypted LUKS partition is: /dev/sda2
which contains a physical volume, with a single volume group, mapped to: /dev/mapper/system
And the logical volume, the ext4 partition is mapped to: /dev/mapper/system-home

A # testdisk /dev/mapper/system-home will notice it as an ext4 partition but tells me that the partition seems damaged when I try to list the files. If I # testdisk /dev/mapper/system it will detect all the partitions, but the same happens if I try to list their files.

Am I doing something wrong or is it a known bug? I have searched but haven’t found any clue.

2 Answers 2


You're doing something wrong.

testdisk is meant to operate on and recover disk partitions, which is not the problem you're having. Most likely you want to use its companion tool photorec instead, which recovers deleted files (and not just photos).

  • df says that /dev/mapper/system-home is mounted at home. blkid tells me that /dev/mapper/system-home has TYPE="ext4", do you know what can be wrong in this case? I have listed files from ext4 partitions before, I do not see why testdisk won’t let me now.
    – user134316
    Sep 25, 2012 at 1:56
Disk /dev/mapper/VolGroup-lv_home - 210 GB / 196 GiB 

[Proceed ]  

choose the default

[None   ] Non partitioned media 

if you choose :

[Intel  ] Intel/PC partition 

will lead in error that you describe

You must log in to answer this question.