Zygo / bees

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

Mount options #118

Open ghost opened 5 years ago

ghost commented 5 years ago

Is it possible to specify mount options for bees, or can bees take the same mount options as the volume already is mounted as (if already mounted)?

Zygo commented 5 years ago

The beesd script (or OpenRC or ...) sets the mount options. You can put any mount options you like, bees requires only subvol= or subvol=/ or subvolid=5, and rw.

noatime is a good idea if you are not using it already, and you might also want nosuid, nodev, and noexec. Other restrictions may also work, but I don't know them off the top of my head.

The bees mount should use --make-private if you don't want the bees mount point to appear in other namespaces. bees does not require that its mount point be visible to any other process, though bees will still work if it is.

btrfs has more restrictions on multiple mount points, e.g. you can't have a different compress= option on two different mount points on the same filesystem.

ghost commented 5 years ago

Oh hm. I don't have an init script for bees on my Gentoo so I simply run:

beesd f021a039-87d6-4498-a0f5-6bbba3dfb1f1 > /mnt/bees/f021a039-87d6-4498-a0f5-6bbba3dfb1f1.log 2>&1 &

bees itself then proceeds to mount the the filesystem under /run/bees/mnt

My config is:

UUID="f021a039-87d6-4498-a0f5-6bbba3dfb1f1"

## System Vars
# Change carefully
WORK_DIR="/run/bees"
MNT_DIR="$WORK_DIR/mnt/$UUID"
BEESHOME="/mnt/bees/$UUID/.beeshome"
BEESSTATUS="$WORK_DIR/$UUID.status"
DB_SIZE=$((2048*1024*1024)) # 2G in bytes
#OPTIONS="--thread-count 1"