aboutsummaryrefslogtreecommitdiff
path: root/scripts/os/freebsd/20-zfs
blob: aa37c0a801cca0b143696fee730e677e95ddd1c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

# Every host should have a "state" dataset, which is a ZFS dataset which
# persists across OS rebuilds.
[ -n "${state_dataset:-}" ] || die 'state_dataset not defined!'
create_dataset "$state_dataset"

# If this is baremetal host or a VM, trim the zpools periodically.
if [ "$BOXCONF_VIRTUALIZATION_TYPE" != jail ]; then
  install_file -m 0644 /etc/cron.d/zfs-trim
fi