linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: Undelete deleted subvolume?
Date: Fri, 13 May 2016 07:58:23 +0000 (UTC)	[thread overview]
Message-ID: <pan$26950$4baf2649$1281af15$8e5cfec@cox.net> (raw)
In-Reply-To: CAA91j0XRtuyJd12CgDTBXEaOKdN0Ff1Bt2_wT=nGUJy9r=usyg@mail.gmail.com

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


      reply	other threads:[~2016-05-13  7:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-12 14:19 Undelete deleted subvolume? Andrei Borzenkov
2016-05-13  7:58 ` Duncan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='pan$26950$4baf2649$1281af15$8e5cfec@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).