Also, I thought it worth mentioning that I found beadm more mature than bectl, but it's been a while since I checked out the latter.
beadm is the predecessor to bectl and deprecated. It's a shell script that uses zfs commands and started life as a clone of Solaris' command of the same name. bectl is implemented in C, uses libzfs, and is part of base since at least FreeBSD 12.
..... Both /usr and /var are not placed under the pool root, which IMHO, is not justified.To fix that, issue something akin to the following:Code: [Select]zfs rename -u zroot/usr zroot/ROOT/default/usrzfs rename -u zroot/var zroot/ROOT/default/varThen zfs list should show you the magic.
zfs rename -u zroot/usr zroot/ROOT/default/usrzfs rename -u zroot/var zroot/ROOT/default/var
zfs listNAME USED AVAIL REFER MOUNTPOINTzroot 4.16G 45.2G 88K /zrootzroot/ROOT 3.24G 45.2G 88K nonezroot/ROOT/21.7.3_3 8K 45.2G 1.79G /zroot/ROOT/21.7.5 3.24G 45.2G 1.48G /zroot/tmp 152K 45.2G 152K /tmpzroot/usr 352K 45.2G 88K /usrzroot/usr/home 88K 45.2G 88K /usr/homezroot/usr/ports 88K 45.2G 88K /usr/portszroot/usr/src 88K 45.2G 88K /usr/srczroot/var 932M 45.2G 88K /varzroot/var/audit 88K 45.2G 88K /var/auditzroot/var/crash 88K 45.2G 88K /var/crashzroot/var/log 931M 45.2G 931M /var/logzroot/var/mail 112K 45.2G 112K /var/mailzroot/var/tmp 96K 45.2G 96K /var/tmp
How did you install to end up with zroot/usr mounted? That should not be the case and will prevent a successful rollback. Neither the yfreeBSD nor the OPNsense installer will create a system like this.
Sorry - my bad. Of course "zfs list" will list the dataset and the mountpoint. You can check with "df" if it is really mounted. If not, all is well. Sorry for the confusion.....
df -ht zfsFilesystem Size Used Avail Capacity Mounted onzroot/ROOT/21.7.5 47G 1.5G 45G 3% /tmpfs 18G 4.7M 18G 0% /tmpzroot 45G 88K 45G 0% /zrootzroot/var/crash 45G 88K 45G 0% /var/crashzroot/usr/ports 45G 88K 45G 0% /usr/portszroot/usr/src 45G 88K 45G 0% /usr/srczroot/var/log 46G 934M 45G 2% /var/logzroot/usr/home 45G 88K 45G 0% /usr/homezroot/var/audit 45G 88K 45G 0% /var/auditzroot/var/tmp 45G 96K 45G 0% /var/tmpzroot/var/mail 45G 112K 45G 0% /var/mail
So, is there anything to to improve to ensure the BE rollback is fully working and performs a "complete" rollback of the sense in case of an update issue?
zroot/usr/home 247183612 88 247183524 0% /usr/homezroot/tmp 247183788 264 247183524 0% /tmpzroot/var/audit 247183612 88 247183524 0% /var/auditzroot/var/mail 247183636 112 247183524 0% /var/mailzroot/var/crash 247183612 88 247183524 0% /var/crashzroot/var/log 247451252 267728 247183524 0% /var/logzroot/var/tmp 247183612 88 247183524 0% /var/tmp
@benyamin - /var/db/* is part of the BE without any manipulation. /var is created with canmount=off, too..
zroot/tmp /tmp - volatile temp fileszroot/usr /usr - dummy mountzroot/usr/home /usr/home - do OPNsense upgrades touch this?zroot/usr/ports /usr/ports - in-place hbsd-update?zroot/usr/src /usr/src - in-place hbsd-update?zroot/var /var - dummy mountzroot/var/audit /var/audit - auditd log files - in use?zroot/var/crash /var/crash - separate partition?zroot/var/log /var/log - circular logging changes? separate partition?zroot/var/mail /var/mail - separate partition?zroot/var/tmp /var/tmp - non-volatile temp files
Does /usr/home ever get touched? In BE /home is a symlink to /usr/home, yes? Any plugins ever touch it?
Does OPNsense make use of hbsd-update?
Depending on the hardware and installed ports, I also update /usr/src and /usr/ports (via git) too. In some builds these are on separate partitions so as not to include in images, e.g. in NanoBSD images.
Does OPNsense make use of auditd? Will auditd log files always play well with previous versions of the daemon?
With /var/crash, /var/mail and /var/log, isn't the justification for different datasets here because these mounts would typically be on separate partitions or slices? Perhaps this is true for most of these mounts anyway.
Along similar lines, why separate them from the BE root pool anyway? I know there is a case for using defaults, but at the same time it is worth considering if the justification for those defaults is applicable in this use scenario.
Quote from: benyamin on November 21, 2021, 11:56:52 pmDoes /usr/home ever get touched? In BE /home is a symlink to /usr/home, yes? Any plugins ever touch it?That's where user accounts have their home directories. We are a team of four and of course we have individual accounts for UI and SSH. I want them persistent regardless of updates/rollbacks.
You use src and ports on OPNsense firewalls? OK ...What is your argument here? Do you think they should be part of the BE and potentially rolled back? I don't.
Quote from: benyamin on November 21, 2021, 11:56:52 pmWith /var/crash, /var/mail and /var/log, isn't the justification for different datasets here because these mounts would typically be on separate partitions or slices? Perhaps this is true for most of these mounts anyway.There are no partitions and slices in ZFS. These are separate because you (in the regular case) don't want your logfiles and emails to vanish when you revert an update via BE - simple as that.
Quote from: benyamin on November 21, 2021, 11:56:52 pmAlong similar lines, why separate them from the BE root pool anyway?They are not separate from the root pool. There is only one pool named `zroot`. Please keep the terminology consistent for the sake of people not familiar with ZFS. They are not part of the `zroot/ROOT/<some-be>` dataset.
Along similar lines, why separate them from the BE root pool anyway?
Quote from: benyamin on November 21, 2021, 11:56:52 pmI know there is a case for using defaults, but at the same time it is worth considering if the justification for those defaults is applicable in this use scenario.I would always argue to keep things exactly that way unless there is a compelling reason to change anything. Stick to upstream defaults wherever possible, so you don't need to maintain deliberate changes and you won't get surprised by upstream changes should they occur.
I know there is a case for using defaults, but at the same time it is worth considering if the justification for those defaults is applicable in this use scenario.
The FreeBSD setup is fine. I delete /usr/src and /usr/ports after installation - they are not used on OPNsense.
You wouldn't be populating home directories on a production firewall, surely... Any nice utilities for black hat use?
ry93@kagate1:~ % iduid=2001(ry93) gid=0(wheel) groups=0(wheel),1999(admins)ry93@kagate1:~ % ls -l .ssh/total 5-rw-r----- 1 ry93 nobody 836 Nov 12 18:14 authorized_keysry93@kagate1:~ %
Root login disabled, sudo enabled, individual account for each admin. Best practice as far as I know.
ls -ltrRha ~