linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: Wolfgang Mader <Wolfgang_Mader@brain-frog.de>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Recursive delete file from all subvolumes (snapshots)
Date: Fri, 15 Jan 2016 14:05:39 +0500	[thread overview]
Message-ID: <20160115140539.3afa66f0@natsu> (raw)
In-Reply-To: <15624885.ucZm0n36hp@discus>

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

On Fri, 15 Jan 2016 09:33:14 +0100
Wolfgang Mader <Wolfgang_Mader@brain-frog.de> wrote:

> I have a btrfs raid 10 from which I take hourly snapshots using snapper. Now, 
> I wonder, if there is a way to delete a file together with all its occurrences 
> in all snapshots.
> 
> My use case is, that the file I want to delete is large, and I want to free its 
> space on disk. Thus, I have to get rid of its "live" version but also of all 
> references to it in snapshots.

E.g. if your file is at /path/to/file.dat, and your snapshot structure is 
/snapshots/YYYY-MM-DD@time/, you would simply do:

rm /snapshots/*/path/to/file.dat

In fact this is what I often do with my timed snapshots when deleting some
files and wanting to recover free space immediately, not waiting for all their
snapshots to expire and get deleted by the usual time-based deletion rules.

If your snapshots are read-only it becomes more complex, but still doable.

-- 
With respect,
Roman

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2016-01-15  9:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15  8:33 Recursive delete file from all subvolumes (snapshots) Wolfgang Mader
2016-01-15  9:05 ` Roman Mamedov [this message]
2016-01-15  9:11   ` Wolfgang Mader
2016-01-15 11:48   ` Duncan
2016-01-15 13:33     ` Wolfgang Mader
2016-01-15 15:25       ` Duncan

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=20160115140539.3afa66f0@natsu \
    --to=rm@romanrm.net \
    --cc=Wolfgang_Mader@brain-frog.de \
    --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).