2 ms·
I did something like that recently, deleting a project directory with a mistyped git command intended to preserve the contents for safekeeping, ironically. (Th
by jlokier 6y ago
I did something like that recently, deleting a project directory with a mistyped git command intended to preserve the contents for safekeeping, ironically. (That's an interesting lesson in itself).
It was in a VM, so rather than remount read-only, I snapshotted the VM drive, then rebooted to perform recovery, confident I could try out things non-destructively by reverting to the snapshot.
Used ext4magic to undelete, and that tool did a really great job. Some files ended up with contents that should have been in other files, so it isn't perfect. But it was a project with only a few files, so I was able to reconstruct it easily enough because all the contents were at least recovered.
Did something similar for a customer a few years ago who had wiped a significant directory on a live system. That was on a RAID-1 (mirrored).
Rather than remounting read-only, to allow production to continue I detached one of the mirrored drives to preserve it for safekeeping, while allowing operations to continue using the other drive.