Re: btrfs recovery
From: Duncan <hidden>
Date: 2017-02-01 04:36:20
Austin S. Hemmelgarn posted on Tue, 31 Jan 2017 07:45:42 -0500 as excerpted:
quoted
There's actually a btrfs-undelete script on github that turns the otherwise multiple manual steps into a nice, smooth, undelete operation. Or at least it's supposed to. I've never actually used it, tho I have examined the script out of curiosity to see what it did and how, and it /looks/ like it should work. I've kept that trick (and knowledge of where to look for the script) filed away in the back of my head in case I need it someday. =:^)
I've not used the script itself before, but I've used the method before on a couple of occasions to pull out old versions of files that I should have had under some kind of VCS but didn't, and the method does work reliably as long as you do it soon.
From reading the script, the two potentially difficult steps the script
helpfully automates for you are... 1) going thru the roots find-root has found to find a good one to use ... and... 2) the fiddly regex escaping, so you don't have to pay too much attention to that, just feed it a normal path. IOW, it should be a great help to users that don't know btrfs command or filesystem internals very well, and/or who don't find regex use particularly easy. IOW, it'd be an excellent tool to either include in btrfs-tools as-is or C-codify and add as a btrfs subcommand, at some point as btrfs nears true stability and readiness for for ordinary less technical users. -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman