bees icon indicating copy to clipboard operation
bees copied to clipboard

Re-built system, having issue with .beeshome

Open SpiderUnderUrBed opened this issue 1 year ago • 4 comments

I had to move all my stuff to a new partition to fix it, now beesd is not working, I am getting this error:

 [email protected] - Block-level BTRFS deduplication for root
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; preset: enabled)
Active: failed (Result: exit-code) since Sun 2024-09-15 12:11:04 NZST; 2s ago
  Duration: 27ms
Invocation: 428c565b49e54675995e7a1a388f2c0c
   Process: 40699 ExecStart=/nix/store/7i9v6583vmbj3q2b53rwdyigyl44invi-bees-0.10/bin/bees-service-wrapper run LABEL=root verbosity=2 idxSizeMB=2048 workDir=.beeshome
-- --no-timestamps --loadavg-target 5.0 (code=exited, status=1/FAILURE)
   Process: 40732 ExecStopPost=/nix/store/7i9v6583vmbj3q2b53rwdyigyl44invi-bees-0.10/bin/bees-service-wrapper cleanup LABEL=root verbosity=2 idxSizeMB=2048 [workDir=.be](http://workdir=.be/)
eshome (code=exited, status=0/SUCCESS)
  Main PID: 40699 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
  Mem peak: 5.2M
CPU: 39ms

Sep 15 12:11:04 daspidercave systemd[1]: Started Block-level BTRFS deduplication for root.
Sep 15 12:11:04 daspidercave beesd[40699]: /run/bees/mnt/0095faf2-2359-4515-a1e1-af7ef6f11a0f/.beeshome exists but is not a subvolume
Sep 15 12:11:04 daspidercave systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Sep 15 12:11:04 daspidercave systemd[1]: [email protected]: Failed with result 'exit-code'.
warning: error(s) occurred while switching to the new configuration

I tried a series of commands, making a .beeshome on /, making bind mounts between /run/, trying to make subvolumes, nothing works

I also wrote the issue here: https://www.reddit.com/r/btrfs/comments/1fgzu6w/beesd_has_a_issue/

SpiderUnderUrBed avatar Sep 15 '24 20:09 SpiderUnderUrBed

Change to the directory containing the .beeshome folder, then:

mv .beeshome .beeshome.old
btrfs sub create .beeshome
rsync -av .beeshome.old/. .beeshome/.
rm .beeshome/beeshash.dat # because the subvolumes differ

You didn't recreate the subvolume structure of your system while moving your data to a new partition.

bees will crawl all your data from scratch, expect some increased disk IO for a few hours or days. Also, expect bees to increase disk usage slightly during this time before finally cleaning up, so keep enough free space.

If everything works, you can remove .beeshome.old.

kakra avatar Sep 20 '24 08:09 kakra

I am getting this issue:

[spiderunderurbed@daspidercave:/run/bees/mnt/0095faf2-2359-4515-a1e1-af7ef6f11a0f]$ btrfs sub create .beeshome
ERROR: not a btrfs filesystem: .

[spiderunderurbed@daspidercave:/run/bees/mnt/0095faf2-2359-4515-a1e1-af7ef6f11a0f]$ 

Which is strange because image

SpiderUnderUrBed avatar Sep 21 '24 22:09 SpiderUnderUrBed

It seems like /run/bees/mnt/ uses tmpfs, any way to change this in plasma or beesd? I am getting a whole host of issues.

SpiderUnderUrBed avatar Sep 21 '24 23:09 SpiderUnderUrBed

/run/bees/mnt/... is only mounted while bees is running - and bees exits immediately because of the error. So try mounting subvolid=0 first:

mkdir /mnt/btrfs-pool
mount -o subvolid=0 UUID=0095faf2-2359-4515-a1e1-af7ef6f11a0f /mnt/btrfs-pool

Now try my above steps in that directory.

It seems like /run/bees/mnt/ uses tmpfs, any way to change this in plasma or beesd? I am getting a whole host of issues.

/run is meant to be tmpfs, it's used for private runtime data and will be discarded on reboot. Services like bees create a private mount inside which is not to be used by you. To modify your btrfs, mount it manually, or run a more verbose lsblk command to find it's mount point. .beeshome must be present at the root of subvolid=0 - your standard btrfs mount point may not show that.

kakra avatar Sep 22 '24 02:09 kakra

Sorry for the late response. Anyways.

mkdir /mnt/btrfs-pool
mount -o subvolid=0 UUID=0095faf2-2359-4515-a1e1-af7ef6f11a0f /mnt/btrfs-pool

This works while my system is up and running, but I was trying to make it execute before my system starts, with no avail, and this fix doesn't come without its own issues. So is there a underlying problem which can be addressed?

Here was my attempt at making a permanent fix:

   fileSystems."/mnt/btrfs-pool" = {
    device = "UUID=0095faf2-2359-4515-a1e1-af7ef6f11a0f";
    depends = ["/" "/mnt"];
    fsType = "btrfs";
    options = [ "subvolid=0" ];
  };

(note I use nixos)

Is there a issue with some recorded data I need to delete so it can recreate .beeshome?

SpiderUnderUrBed avatar Nov 10 '24 22:11 SpiderUnderUrBed

Simply btrfs sub create /mnt/btrfs-pool/.beeshome. If it exists already, rename it first.

kakra avatar Nov 10 '24 22:11 kakra

I made a few mistakes trying to clear out /mnt/btrfs-pool which lead to me requiring to re-install my system, regardless, the issue is fixed now.

SpiderUnderUrBed avatar Nov 11 '24 04:11 SpiderUnderUrBed