Page 1 of 1

Recover files after mkfs.ext4 /dev/mapper/<vg>-data.

Posted: 12 Mar 2021, 08:04
by cmonty14
Hello,

I have accidently deleted all files in a logical volume by executing

Code: Select all

mkfs.ext4 /dev/mapper/<vg>-data
.

The disk is not damaged, the partition table is correct, all partitions are accessible, LVM is showing no errrors.

Based on the documentation I cannot undelete files of an ext4 filesystems, instead I can use photorec.
If this is correct, can you please advise how to proceed?
Should I run photorec on the logical volume? Or should I mount the logical volume and then run photorec?

THX

Re: Recover files after mkfs.ext4 /dev/mapper/<vg>-data.

Posted: 12 Mar 2021, 13:20
by cgrenier
No need to mount the filesystem.
Run PhotoRec and select "/dev/mapper/<vg>-data"
Good luck

Re: Recover files after mkfs.ext4 /dev/mapper/<vg>-data.

Posted: 13 Mar 2021, 10:29
by cmonty14
The original fileystem on the relevant logical volume was: EXT4

Is there any other "promising" option for data recovery?

Re: Recover files after mkfs.ext4 /dev/mapper/<vg>-data.

Posted: 15 Mar 2021, 08:18
by cgrenier
PhotoRec is usually the easiest solution.

You can also try to recover your files by using the ext4 journal: https://gist.github.com/ebautistabar/cc ... 15f53fac4a
Usually it only works if the amount of files is limited.