How to Recover Deleted Files on Linux from ext4 and Btrfs
If you just ran rm on something important and you are reading this in a panic - stop what you are doing on that filesystem right now. Run mount -o remount,ro /dev/sdX to remount the partition read-only before anything else. Every write operation that hits the disk after deletion reduces your chances of getting those files back. With that out of the way, here is a direct answer: for ext4, use extundelete
or debugfs as your first recovery attempt, and PhotoRec
as a fallback. For Btrfs, roll back a snapshot if you have one, or use btrfs restore if you do not. The details matter quite a bit depending on your situation, so read on.
Botmonster Tech












