stat /var/run/dmesg.boot and somehow decipher the fourth parameter (birth time). sysctl kern.boottime, thanks to ChatGPT, although I'm not sure what the value provided is. ie is it epoch time, or how long the sytem has been running?-d parameter to get a description of a sysctl(8)? -d Print the description of the variable instead of its
value.
# sysctl -d kern.boottime
kern.boottime: Estimated system boottime
# sysctl kern.boottime
kern.boottime: { sec = 1765358752, usec = 167805 } Wed Dec 10 10:25:52 2025
The install time can be viewed on ZFS inspecting zpool-history(8)Does a FreeBSD system retain any timestamps which would show when the system was installed
# zpool history | grep 'zpool create"
2022-01-18.16:44:19 zpool create -o altroot=/mnt -O compress=lz4 -O atime=off -m none -f zroot nvd0p3.eli
% stat bsdinstall_log
13020405558614810491 2 -rw-r--r-- 1 root wheel 0 88672 "Jan 18 16:46:08 2022" "Jan 18 16:46:08 2022" "Jan 18 16:46:08 2022" "Jan 18 16:46:08 2022" 89088 25 0x800 bsdinstall_log
To see when the system was installed, you can justDoes a FreeBSD system retain any timestamps which would show when the system was installed, updated or booted?
ls -l /boot/kernel/kernel.only if you never updated your system/kernel...To see when the system was installed, you can justls -l /boot/kernel/kernel.
zfs send|recv'd all datasets over.I determine the age of a system by the oldest file in /etc
ls -ltr /etc
% ls -ltr /etc | head
total 1033
drwxr-xr-x 2 root wheel 2 Oct 23 2020 rc.conf.d/
drwxr-xr-x 6 root wheel 6 Oct 23 2020 periodic/
-rw-rw-r-- 1 root operator 0 Oct 23 2020 dumpdates
-rw-r--r-- 1 root wheel 106 Oct 23 2020 mail.rc
lrwxr-xr-x 1 root wheel 14 Oct 23 2020 unbound@ -> ../var/unbound
lrwxr-xr-x 1 root wheel 23 Oct 23 2020 termcap@ -> /usr/share/misc/termcap
lrwxr-xr-x 1 root wheel 15 Oct 23 2020 rmt@ -> ../usr/sbin/rmt
lrwxr-xr-x 1 root wheel 21 Oct 23 2020 os-release@ -> ../var/run/os-release
lrwxr-xr-x 1 root wheel 12 Oct 23 2020 aliases@ -> mail/aliases
-r--r--r-- 1 root wheel 2309 Jun 15 2021 localtime
drwxr-xr-x 2 root wheel 2 Jun 15 2021 authpf/
-rw-r--r-- 1 root wheel 37 Jun 15 2021 hostid
-rw-r--r-- 1 root wheel 46 Jun 15 2021 host.conf
-rw------- 1 root wheel 0 Jun 15 2021 opiekeys
% zfs get -H creation zroot/ROOT
zroot/ROOT creation Tue Jun 15 2:07 2021 -
% ls -ltr /boot | head
total 12519
drwxr-xr-x 1 root wheel 16384 Jan 1 1980 efi/
drwxr-xr-x 2 root wheel 3 Jun 15 2021 zfs/
drwxr-xr-x 2 root wheel 2 Jun 15 2021 loader.conf.d/
drwxr-xr-x 2 root wheel 2 Jun 15 2021 uboot/
-r--r--r-- 1 root wheel 512 Sep 20 2022 boot1
-r--r--r-- 1 root wheel 512 Sep 20 2022 mbr
-r--r--r-- 1 root wheel 1185 Apr 11 2023 cdboot
-r--r--r-- 1 root wheel 13653 Apr 11 2023 loader.help.bios
-r--r--r-- 1 root wheel 13653 Apr 11 2023 loader.help.efi
I think we should first define the meaning of the "age of the system". In my case, I do not know how old my desktop system actually is. Have cloned it several times from previous ZFS pools and upgraded many times from source. So - how old this system actually is? My storage pool is much younger than the oldest file in /etc, but kernel is latest 14.3.I determine the age of a system by the oldest file in /etc
ls -ltr /etc
Does a FreeBSD system retain any timestamps which would show when the system was installed […]?
Does a FreeBSD system retain any timestamps which would show when the system was […] updated […]?
The install time can be viewed on ZFS inspecting zpool-history(8)
creation property, no grep(1)ping necessary (shouldn’t head(1) be sufficient anyway?). bectl list # On a running system.
Does a FreeBSD system retain any timestamps which would show when the system was […] booted?
These two methods in my case give different results than cracauer@ method, which agrees with whatThe install time can be viewed on ZFS inspecting zpool-history(8)
Rich (BB code):# zpool history | grep 'zpool create" 2022-01-18.16:44:19 zpool create -o altroot=/mnt -O compress=lz4 -O atime=off -m none -f zroot nvd0p3.eli
Or from /var/log/bsdinstall_log (ZFS and UFS) when installed menu-guided (not manually).
Highlighted is the files "st_birthtime" ( stat(1) )Rich (BB code):% stat bsdinstall_log 13020405558614810491 2 -rw-r--r-- 1 root wheel 0 88672 "Jan 18 16:46:08 2022" "Jan 18 16:46:08 2022" "Jan 18 16:46:08 2022" "Jan 18 16:46:08 2022" 89088 25 0x800 bsdinstall_log
fastfetch gives.[14:24][fmc000@dabrafenib ~]$ doas zpool history | grep 'zpool create'
2024-06-24.14:57:32 zpool create -o altroot=/mnt -O compress=lz4 -O atime=off -m none -f zroot nda0p4.eli
[14:24][fmc000@dabrafenib ~]$
[14:24][fmc000@dabrafenib ~]$ stat /var/log/bsdinstall_log
4604768845265284562 128 -rw-r--r-- 1 root wheel 0 140899 "Jun 24 15:06:47 2024" "Jun 24 15:06:47 2024" "Jun 24 15:06:47 2024" "Jun 24 15:06:47 2024" 131072 57 0x800 /var/log/bsdinstall_log
[14:25][fmc000@dabrafenib ~]$
[14:37][root@dabrafenib ~]$ zfs get creation zroot
NAME PROPERTY VALUE SOURCE
zroot creation Mon Jun 24 14:57 2024 -
[14:37][root@dabrafenib ~]$
==========================================================================
[14:25][fmc000@dabrafenib ~]$ ls -ltd /etc/*|tail -3
drwxr-xr-x 2 root wheel 2 May 31 2024 /etc/profile.d
drwxr-xr-x 2 root wheel 2 May 31 2024 /etc/rc.conf.d
drwxr-xr-x 2 root wheel 2 May 31 2024 /etc/sysctl.kld.d
[14:25][fmc000@dabrafenib ~]$
[14:25][fmc000@dabrafenib ~]$ fastfetch|grep -i installed
Installed Date: 2024-05-31 11:39:59
[14:26][fmc000@dabrafenib ~]$
fastfetch seems to get its information from the zpool: {
"type": "disk",
"folders": "/",
"format": "{create-time}",
"key": "Installed Date",
},