linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* btrfs-undelete shell-script
@ 2013-01-24 15:56 Jörg Walter
  2015-10-28  6:06 ` JDAIII
  0 siblings, 1 reply; 2+ messages in thread
From: Jörg Walter @ 2013-01-24 15:56 UTC (permalink / raw)
  To: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

Hi,

I tried to recover an accidentally deleted text file from a btrfs volume using 
the trusty old 'grep --text -C 500' method and failed, since the filesystem was 
compressed. So I wrote a shell script that uses btrfs-progs for a proper 
undelete functionality.

Attached is the script that implements a working btrfs-undelete using the find-
root and restore tools from btrfs-progs. It is fairly complete and solid and 
it even has some command  line help. It needs bash and common unix utilities 
(sed, grep, wc, dirname, sort). I have successfully used it to recover a 
couple of files I deleted accidentally and was able to recover 2/3 of them just 
fine. The rest was zero-sized, I assume that's because the file blocks have 
already been reused.

If you like it, feel free to add it to btrfs-progs. I've chosen GPLv2 or later 
as license, as that's what btrfs-progs seems to use.

Please CC me on replies, I am not subscribed (and don't intend to).

-- 
Mit freundlichen Grüßen,

	Jörg Walter

[-- Attachment #2: btrfs-undelete --]
[-- Type: application/x-shellscript, Size: 2862 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-28 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-24 15:56 btrfs-undelete shell-script Jörg Walter
2015-10-28  6:06 ` JDAIII

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).