linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Undelete deleted subvolume?
@ 2016-05-12 14:19 Andrei Borzenkov
  2016-05-13  7:58 ` Duncan
  0 siblings, 1 reply; 2+ messages in thread
From: Andrei Borzenkov @ 2016-05-12 14:19 UTC (permalink / raw)
  To: Btrfs BTRFS

I accidentally deleted wrong snapshot using SUSE snapper. Is it
possible to undelete subvolume? I know that it is possible to extract
files from old tree (although SLES12 does not seem to offer
btrfs-find-root), but is it possible to "reconnect" subvolume back?

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

* Re: Undelete deleted subvolume?
  2016-05-12 14:19 Undelete deleted subvolume? Andrei Borzenkov
@ 2016-05-13  7:58 ` Duncan
  0 siblings, 0 replies; 2+ messages in thread
From: Duncan @ 2016-05-13  7:58 UTC (permalink / raw)
  To: linux-btrfs

Andrei Borzenkov posted on Thu, 12 May 2016 17:19:11 +0300 as excerpted:

> I accidentally deleted wrong snapshot using SUSE snapper. Is it possible
> to undelete subvolume? I know that it is possible to extract files from
> old tree (although SLES12 does not seem to offer btrfs-find-root), but
> is it possible to "reconnect" subvolume back?

I don't know of a way to do it directly, altho the devs may be able to 
suggest something exotic, but...

You should at least be able to /emulate/ it, by using btrfs restore (with 
the filesystem unmounted) to write the files elsewhere (the part you 
suggested), then mounting the filesystem, creating a new subvolume, and 
copying the restored files back into it.

That does lose the reflinks of a snapshot if that's what you deleted, so 
will take more space, but if you then run one of the btrfs dedupers on 
it, you should be able to re-reflink it, sharing extents via reflink and 
reducing the exclusive space used, once again.  (Tho I have no personal 
experience with the dedupers so can't give you specific help in that 
regard.)

But if you were using it as the reference parent for send/receive, or 
something, I think it's gone from that regard, as the emulation above 
would of course have a different subvolume ID.

-- 
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


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

end of thread, other threads:[~2016-05-13  7:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-12 14:19 Undelete deleted subvolume? Andrei Borzenkov
2016-05-13  7:58 ` Duncan

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).