linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* problem with btrfs snapshot delete
@ 2020-12-01 14:00 James Courtier-Dutton
  2020-12-01 14:17 ` Hugo Mills
  0 siblings, 1 reply; 3+ messages in thread
From: James Courtier-Dutton @ 2020-12-01 14:00 UTC (permalink / raw)
  To: linux-btrfs

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

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

* Re: problem with btrfs snapshot delete
  2020-12-01 14:00 problem with btrfs snapshot delete James Courtier-Dutton
@ 2020-12-01 14:17 ` Hugo Mills
  2020-12-01 17:43   ` Graham Cobb
  0 siblings, 1 reply; 3+ messages in thread
From: Hugo Mills @ 2020-12-01 14:17 UTC (permalink / raw)
  To: James Courtier-Dutton; +Cc: linux-btrfs

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

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

* Re: problem with btrfs snapshot delete
  2020-12-01 14:17 ` Hugo Mills
@ 2020-12-01 17:43   ` Graham Cobb
  0 siblings, 0 replies; 3+ messages in thread
From: Graham Cobb @ 2020-12-01 17:43 UTC (permalink / raw)
  To: Hugo Mills, James Courtier-Dutton, linux-btrfs

On 01/12/2020 14:17, Hugo Mills wrote:
> 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

It is also possible that the whole disk is NOT mounted at /foldername.
It might be that a particular subvolume is mounted at /folderdisk
(possibly using the "btrfs subvolume set-default" command).

If you can't find the path you are looking for at /foldername, try
mounting the root subvolume somewhere. You will need to name the root
using its subvolume id, which is always 5. For example:

mount <device> -o subvolid=5 /mnt/somewhere

Then you will find the subvolume you are looking for at:
/mnt/somewhere/@apt-snapshot-2018-08-23_21:11:42

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

end of thread, other threads:[~2020-12-01 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 14:00 problem with btrfs snapshot delete James Courtier-Dutton
2020-12-01 14:17 ` Hugo Mills
2020-12-01 17:43   ` Graham Cobb

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