httm: Doesn't detect btrfs snapshots

Describe the bug httm doesn’t detect snapshots for me (just local access)

There is no “single” way to manage snapshots. So I think my layout is somehow special.

I’m using “flat” layout (where root subvol with subvolid=5 is not mounted). I’ve just a few ‘subvolumes’ in subvolid=5 with names like rootfs, home, etc.

To start using snapshots I’ve created additional snapshots subvolume and mounted it to /.snapshots.

% ls -1 /.snapshots 
containers.20240307T1351
containers.20240307T1400
home.20240307T1351
home.20240307T1400
rootfs.20240307T1351
rootfs.20240307T1400
work.20240307T1351
work.20240307T1400

Just migrated from snapper because of I don’t like it’s .snapshots layout inside volume

Snapshots are managed by btrbk.

 sudo btrfs subvolume list -a -s ~       
ID 262 gen 663 cgen 662 top level 261 otime 2024-03-07 13:51:03 path <FS_TREE>/snapshots/rootfs.20240307T1351
ID 263 gen 664 cgen 663 top level 261 otime 2024-03-07 13:51:03 path <FS_TREE>/snapshots/home.20240307T1351
ID 264 gen 664 cgen 664 top level 261 otime 2024-03-07 13:51:03 path <FS_TREE>/snapshots/work.20240307T1351
ID 265 gen 665 cgen 665 top level 261 otime 2024-03-07 13:51:03 path <FS_TREE>/snapshots/containers.20240307T1351
ID 266 gen 684 cgen 683 top level 261 otime 2024-03-07 14:00:09 path <FS_TREE>/snapshots/rootfs.20240307T1400
ID 267 gen 685 cgen 684 top level 261 otime 2024-03-07 14:00:09 path <FS_TREE>/snapshots/home.20240307T1400
ID 268 gen 685 cgen 685 top level 261 otime 2024-03-07 14:00:09 path <FS_TREE>/snapshots/work.20240307T1400
ID 269 gen 686 cgen 686 top level 261 otime 2024-03-07 14:00:09 path <FS_TREE>/snapshots/containers.20240307T1400

I think that FS_TREE may confuse httm. Plus it’s not enough to just strip it because ‘FS_TREE/snapshots/’ here means snapshots subvolume, not mount point.

I think follwed line from mount describes it:

/dev/mapper/elitepad4-rootfs on /.snapshots type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,subvolid=261,subvol=/snapshots)

I think it’s similar to https://github.com/kimono-koans/httm/issues/85

To Reproduce Steps to reproduce the behavior:

  1. httm --unique=all --debug ~/.zshrc

Expected behavior Ideally it should automatically guess where snapshots are. Maybe provide some CLI parameter or env variable if autodetect is too diffficult.

Additional context Add any other context about the problem here. Perhaps you should include system details like:

  • httm 0.36.5
  • OS: Debian Unstable
  • Relevant filesystem/s: all subvolumes are on single btrfs
  • httm --debug attached debug.log

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Comments: 31 (16 by maintainers)

Most upvoted comments

Ahh. Yes… You’re right… I completely forgot about this. So with sudo it works!.