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

Using PhotoRec to recover lost data
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
cmonty14
Posts: 2
Joined: 12 Mar 2021, 07:56

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

#1 Post 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

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

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

#2 Post by cgrenier »

No need to mount the filesystem.
Run PhotoRec and select "/dev/mapper/<vg>-data"
Good luck

cmonty14
Posts: 2
Joined: 12 Mar 2021, 07:56

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

#3 Post by cmonty14 »

The original fileystem on the relevant logical volume was: EXT4

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

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

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

#4 Post 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.

Locked