Zygo / bees

Best-Effort Extent-Same, a btrfs dedupe agent
GNU General Public License v3.0
692 stars 56 forks source link

Cannot start beesd service on Archlinux #258

Open gonciarz opened 1 year ago

gonciarz commented 1 year ago

cat /etc/bees/bread.conf

UUID=a88fbf6f-df4b-42bd-936c-13acf504681c
#MNT_DIR="$WORK_DIR/mnt/$UUID"
WORK_DIR=/run/bees/
MNT_DIR="/.btrfs"
BEESHOME="$MNT_DIR/.beeshome"
BEESSTATUS="$WORK_DIR/$UUID.status"
DB_SIZE=$((256*1024*1024)) # 256MB

cat /etc/fstab | grep btrfs

UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /           btrfs       compress-force=no,subvol=/@archlinux        0 1
UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /var/cache      btrfs       compress-force=no,subvol=/@cache        0 1
UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /var/lib/docker     btrfs       compress-force=zstd:1,subvol=/@docker       0 1
UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /var/lib/libvirt    btrfs       compress-force=zstd:1,subvol=/@libvirt      0 1
UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /var/log        btrfs       compress-force=no,subvol=/@log          0 1
UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /home           btrfs       compress-force=no,subvol=/@home         0 2
UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /sync           btrfs       compress-force=zstd:1,subvol=/@sync     0 2
UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /sync/workspace     btrfs       compress-force=no,subvol=/@workspace        0 2
UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /.beeshome      btrfs       compress-force=no,subvol=/@beeshome     0 1
UUID=a88fbf6f-df4b-42bd-936c-13acf504681c   /.btrfs         btrfs       compress-force=no,subvol=/          0 1

mount | grep bread

/dev/mapper/bread on / type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=276,subvol=/@archlinux)
/dev/mapper/bread on /.btrfs type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/bread on /sync type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=279,subvol=/@sync)
/dev/mapper/bread on /home type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home)
/dev/mapper/bread on /var/cache type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=267,subvol=/@cache)
/dev/mapper/bread on /var/lib/docker type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@docker)
/dev/mapper/bread on /var/lib/libvirt type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=264,subvol=/@libvirt)
/dev/mapper/bread on /var/log type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=266,subvol=/@log)
/dev/mapper/bread on /sync/workspace type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=280,subvol=/@workspace)
/dev/mapper/bread on /var/lib/docker/btrfs type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@docker)
/dev/mapper/bread on /.beeshome type btrfs (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=292,subvol=/@beeshome)
# systemctl start beesd@bread.service
# systemctl status beesd@bread.service
× beesd@bread.service - Bees (bread)
     Loaded: loaded (/usr/lib/systemd/system/beesd@.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Thu 2023-06-29 12:00:47 CEST; 3s ago
   Duration: 30ms
       Docs: https://github.com/Zygo/bees
    Process: 39259 ExecStart=/usr/sbin/beesd --no-timestamps bread (code=exited, status=1/FAILURE)
   Main PID: 39259 (code=exited, status=1/FAILURE)
        CPU: 32ms

Jun 29 12:00:47 red beesd[39259]:     -P, --strip-paths     Strip $CWD from beginning of all paths in the log
Jun 29 12:00:47 red beesd[39259]:     -v, --verbose         Set maximum log level (0..8, default 8)
Jun 29 12:00:47 red beesd[39259]: Optional environment variables:
Jun 29 12:00:47 red beesd[39259]:     BEESHOME    Path to hash table and configuration files
Jun 29 12:00:47 red beesd[39259]:                 (default is .beeshome/ in the root of the filesystem).
Jun 29 12:00:47 red beesd[39259]:     BEESSTATUS  File to write status to (tmpfs recommended, e.g. /run).
Jun 29 12:00:47 red beesd[39259]:                 No status is written if this variable is unset.
Jun 29 12:00:47 red beesd[39259]: 2023-06-29 12:00:47 39259.39259<5> bees: Exiting with status 1 (failure)
Jun 29 12:00:47 red systemd[1]: beesd@bread.service: Main process exited, code=exited, status=1/FAILURE
Jun 29 12:00:47 red systemd[1]: beesd@bread.service: Failed with result 'exit-code'.

journalctl

Jun 29 12:00:47 red systemd[1]: Started Bees (bread).
Jun 29 12:00:47 red beesd[39259]: Usage: beesd [options] <btrfs_uuid>
Jun 29 12:00:47 red beesd[39259]: - - -
Jun 29 12:00:47 red beesd[39259]: bees version 0.9.3
Jun 29 12:00:47 red beesd[39259]: 2023-06-29 12:00:47 39259.39259<7> bees: Masking signals
Jun 29 12:00:47 red beesd[39259]: 2023-06-29 12:00:47 39259.39259<7> bees: context constructed
Jun 29 12:00:47 red beesd[39259]: 2023-06-29 12:00:47 39259.39259<7> bees: Parsing option 'h'
Jun 29 12:00:47 red beesd[39259]: Usage: /usr/lib/bees/bees [options] fs-root-path
Jun 29 12:00:47 red beesd[39259]: Performs best-effort extent-same deduplication on btrfs.
Jun 29 12:00:47 red beesd[39259]: fs-root-path MUST be the root of a btrfs filesystem tree (subvol id 5).
Jun 29 12:00:47 red beesd[39259]: Other directories will be rejected.
Jun 29 12:00:47 red beesd[39259]: Options:
Jun 29 12:00:47 red beesd[39259]:     -h, --help            Show this help
Jun 29 12:00:47 red beesd[39259]: Load management options:
Jun 29 12:00:47 red beesd[39259]:     -c, --thread-count    Worker thread count (default CPU count * factor)
Jun 29 12:00:47 red beesd[39259]:     -C, --thread-factor   Worker thread factor (default 1)
Jun 29 12:00:47 red beesd[39259]:     -G, --thread-min      Minimum worker thread count (default 0)
Jun 29 12:00:47 red beesd[39259]:     -g, --loadavg-target  Target load average for worker threads (default none)
Jun 29 12:00:47 red beesd[39259]: Filesystem tree traversal options:
Jun 29 12:00:47 red beesd[39259]:     -m, --scan-mode       Scanning mode (0..2, default 0)
Jun 29 12:00:47 red beesd[39259]: Workarounds:
Jun 29 12:00:47 red beesd[39259]:     -a, --workaround-btrfs-send    Workaround for btrfs send
Jun 29 12:00:47 red beesd[39259]:                                    (ignore RO snapshots)
Jun 29 12:00:47 red beesd[39259]: Logging options:
Jun 29 12:00:47 red beesd[39259]:     -t, --timestamps      Show timestamps in log output (default)
Jun 29 12:00:47 red beesd[39259]:     -T, --no-timestamps   Omit timestamps in log output
Jun 29 12:00:47 red beesd[39259]:     -p, --absolute-paths  Show absolute paths (default)
Jun 29 12:00:47 red beesd[39259]:     -P, --strip-paths     Strip $CWD from beginning of all paths in the log
Jun 29 12:00:47 red beesd[39259]:     -v, --verbose         Set maximum log level (0..8, default 8)
Jun 29 12:00:47 red beesd[39259]: Optional environment variables:
Jun 29 12:00:47 red beesd[39259]:     BEESHOME    Path to hash table and configuration files
Jun 29 12:00:47 red beesd[39259]:                 (default is .beeshome/ in the root of the filesystem).
Jun 29 12:00:47 red beesd[39259]:     BEESSTATUS  File to write status to (tmpfs recommended, e.g. /run).
Jun 29 12:00:47 red beesd[39259]:                 No status is written if this variable is unset.
Jun 29 12:00:47 red beesd[39259]: 2023-06-29 12:00:47 39259.39259<5> bees: Exiting with status 1 (failure)
Jun 29 12:00:47 red systemd[1]: beesd@bread.service: Main process exited, code=exited, status=1/FAILURE
Jun 29 12:00:47 red systemd[1]: beesd@bread.service: Failed with result 'exit-code'.

uname -r

6.4.0-rc6-1-mainline

Did I miss anything? I would be appreciate for a help (perhaps a doc should be extended).

kakra commented 1 year ago

I think you need to use beesd@a88fbf6f-df4b-42bd-936c-13acf504681c.service instead...

gonciarz commented 1 year ago

It works now, thank you. Please consider a doc improvements. It is not obvious.

Qwerty-Space commented 1 year ago

I'm having a similar issue, except the proposed solution isn't working.

cat /etc/fstab | grep btrfs

/dev/mapper/root        /               btrfs         defaults        0       1
/dev/mapper/data        /mnt/data       btrfs         defaults       0       2

btrfs filesystem show

Label: none  uuid: a95a7c81-b878-4200-b608-0a4af0eb060f
        Total devices 1 FS bytes used 138.67GiB
        devid    1 size 231.88GiB used 176.02GiB path /dev/mapper/root

Label: 'Data'  uuid: 4e95f1bb-7c15-4179-a283-35717bd2faa5
        Total devices 1 FS bytes used 2.68TiB
        devid    1 size 2.73TiB used 2.71TiB path /dev/mapper/data

head /etc/bees/data.conf

## Config for Bees: /etc/bees/beesd.conf.sample
## https://github.com/Zygo/bees
## It's a default values, change it, if needed

# How to use?
# Copy this file to a new file name and adjust the UUID below

# Which FS will be used
UUID=4e95f1bb-7c15-4179-a283-35717bd2faa

systemctl status beesd@4e95f1bb-7c15-4179-a283-35717bd2faa5.service

× beesd@4e95f1bb-7c15-4179-a283-35717bd2faa5.service - Bees (4e95f1bb-7c15-4179-a283-35717bd2faa5)
     Loaded: loaded (/usr/lib/systemd/system/beesd@.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Mon 2023-07-31 21:45:34 BST; 5s ago
   Duration: 34ms
       Docs: https://github.com/Zygo/bees
    Process: 370247 ExecStart=/usr/sbin/beesd --no-timestamps 4e95f1bb-7c15-4179-a283-35717bd2faa5 (code=exited, status=1/FAILURE)
   Main PID: 370247 (code=exited, status=1/FAILURE)
        CPU: 37ms

Jul 31 21:45:34 samurai systemd[1]: Started Bees (4e95f1bb-7c15-4179-a283-35717bd2faa5).
Jul 31 21:45:34 samurai beesd[370247]: ERROR: No config for 4e95f1bb-7c15-4179-a283-35717bd2faa5
Jul 31 21:45:34 samurai systemd[1]: beesd@4e95f1bb-7c15-4179-a283-35717bd2faa5.service: Main process exited, code=exited, status=1/FAILURE
Jul 31 21:45:34 samurai systemd[1]: beesd@4e95f1bb-7c15-4179-a283-35717bd2faa5.service: Failed with result 'exit-code'.
radobot commented 1 year ago

@Qwerty-Space It seems you have a typo in your config file. You have UUID=4e95f1bb-7c15-4179-a283-35717bd2faa but the UUID in the service is 4e95f1bb-7c15-4179-a283-35717bd2faa5.

Qwerty-Space commented 1 year ago

@Qwerty-Space It seems you have a typo in your config file. You have UUID=4e95f1bb-7c15-4179-a283-35717bd2faa but the UUID in the service is 4e95f1bb-7c15-4179-a283-35717bd2faa5.

Haha thanks

Sometimes you just need that second pair of eyes, I guess