Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Hugo Mills <hugo@carfax.org.uk>
To: James Courtier-Dutton <james.dutton@gmail.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: problem with btrfs snapshot delete
Date: Tue, 1 Dec 2020 14:17:12 +0000	[thread overview]
Message-ID: <20201201141712.GI1908@savella.carfax.org.uk> (raw)
In-Reply-To: <CAAMvbhFCX5B124V26HzKziJpzMjoYzvhvjTgxeMiauoydGhycg@mail.gmail.com>

On Tue, Dec 01, 2020 at 02:00:21PM +0000, James Courtier-Dutton wrote:
> I do:
> btrfs subvolume list /foldername
> 
> This is a mounted external disk in folder /foldername
> 
> ID 257 gen 3455989 top level 5 path @
> ID 258 gen 3455995 top level 5 path @home
> ID 15214 gen 2317920 top level 5 path @apt-snapshot-2018-08-20_20:37:56
> ID 15296 gen 2317920 top level 5 path @apt-snapshot-2018-08-22_11:18:45
> ID 15297 gen 2317920 top level 5 path @apt-snapshot-2018-08-22_11:32:41
> ID 15398 gen 2317920 top level 5 path @apt-snapshot-2018-08-23_21:11:42
> 
> I try
> btrfs subvolume delete @apt-snapshot-2018-08-23_21:11:42
> but no luck.
> I don't understand. If the "btrfs subvolume list" has an option for
> path, why doesn't the btrfs subvolume delete?
> It seems that the
> btrfs subvolume delete @apt-snapshot-2018-08-23_21:11:42
> is only looking for subvolumes on root and not a within a folder or
> external disk.
> 
> Can anybody help me with deleting an apt-snapshot that is on an
> external disk, and thus not mounted as /   ?

   btrfs sub delete takes a path to a subvolume within the visible
filename tree (i.e. from /)

   The filesystem must therefore be mounted somewhere, and the
subvolume to be deleted must be visible under that mount. In your
case, the filesystem is mounted at /foldername, so:

   btrfs sub del /foldername/@apt-snapshot-2018-08-23_21:11:42

   If you think of subvolumes as directories with a few caveats and
special powers, then "btrfs sub del" is equivalent to "rm -rf", and
you'd use the same parameters in the same way for the same reason.

   Hugo.

-- 
Hugo Mills             | ... one ping(1) to rule them all, and in the
hugo@... carfax.org.uk | darkness bind(2) them.
http://carfax.org.uk/  |
PGP: E2AB1DE4          |                                                Illiad

  reply	other threads:[~2020-12-01 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 14:00 problem with btrfs snapshot delete James Courtier-Dutton
2020-12-01 14:17 ` Hugo Mills [this message]
2020-12-01 17:43   ` Graham Cobb

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=20201201141712.GI1908@savella.carfax.org.uk \
    --to=hugo@carfax.org.uk \
    --cc=james.dutton@gmail.com \
    --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