mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-10 23:20:57 +00:00
enable btrfs light zstd:1 compression by default at mount
this comes free and is handled gracefully by btrfs according to pre-compression heuristics, making it an ideal filesystem choice for tomb volumes that have compressable contents. A `compress-force=zstd:1` custom option would deactivate the heuristic test and compress everything.
This commit is contained in:
parent
4783456814
commit
ff692999de
12
tomb
12
tomb
@ -2384,10 +2384,18 @@ mount_tomb() {
|
||||
_sudo mkdir -p "$tombmount"
|
||||
|
||||
# Default mount options are overridden with the -o switch
|
||||
local oldmountopts
|
||||
{ option_is_set -o } && {
|
||||
local oldmountopts=$MOUNTOPTS
|
||||
oldmountopts=$MOUNTOPTS
|
||||
# TODO: safety check MOUNTOPTS coming from user
|
||||
MOUNTOPTS="$(option_value -o)" }
|
||||
# TODO: safety check MOUNTOPTS
|
||||
|
||||
# default btrfs compression zstd:1 (oportunistic according to pre-compression heuristics)
|
||||
# see: https://btrfs.readthedocs.io/en/latest/Compression.html#pre-compression-heuristics
|
||||
[[ "$filesystem" = "btrfs" ]] && {
|
||||
MOUNTOPTS="$MOUNTOPTS,compress=zstd:1"
|
||||
}
|
||||
|
||||
# safe_mount_options &&
|
||||
_sudo mount -o $MOUNTOPTS /dev/mapper/${TOMBMAPPER} "${tombmount}"
|
||||
# Clean up if the mount failed
|
||||
|
Loading…
Reference in New Issue
Block a user