# Date of a FreeBSD installation



## Vovas (Nov 29, 2022)

How to know when FreeBSD system was installed?
For example:

```
# stat -f '%SB %N' /
May 12 11:33:00 2022 /
#
```
But I remember that my system was installed in July, not earlier.


----------



## covacat (Nov 29, 2022)

if you use zfs try 
zfs get creation zroot


----------



## Vovas (Nov 29, 2022)

covacat said:


> if you use zfs try


If I haven't?


----------



## VladiBG (Nov 29, 2022)

/var/log/bsdinstall_log
DEBUG: Began Installation at Mon Feb 20 10:45:24 UTC 2017

Note: only if your computer/bios clock was correct.


----------



## smithi (Nov 30, 2022)

Vovas said:


> How to know when FreeBSD system was installed?
> For example:
> 
> ```
> ...



Your stat shows when / was created, the date the release was built.

// edit:
As VladiBG says,
//
/var/log/bsdinstall_log is likely the first new file written, or you can list /etc in time order to see the first date after the build date:

`% ls -lrt /etc | less`


----------



## Vovas (Jan 5, 2023)

Found another solution to know birthdate of the system today

```
vovas@tank:~ $ stat -x /home
File: "/home"
Size: 8            FileType: Symbolic Link
Mode: (0755/lrwxr-xr-x)         Uid: (    0/    root)  Gid: (    0/   wheel)
Device: 1707236475,1254490208   Inode: 18782    Links: 1
Access: Fri Jul 15 21:22:09 2022
Modify: Fri Jul 15 21:22:09 2022
Change: Fri Jul 15 21:22:09 2022
Birth: Fri Jul 15 21:22:09 2022
```



smithi said:


> or you can list /etc in time order to see the first date after the build date


It's not correct way

```
vovas@tank:~ $ ls -lrt /etc | less
total 520
drwxr-xr-x  2 root  wheel         2 May 12  2022 rc.conf.d
drwxr-xr-x  6 root  wheel         6 May 12  2022 periodic
drwxr-xr-x  2 root  wheel         2 May 12  2022 jail.conf.d
```
If you check when 13.1-RELEASE was upload to download access, you'll see same date. It's not date of installation on your server/pc. It's looks like date of birth 13.1-RELEASE


----------



## mer (Jan 5, 2023)

ls -lt /var/log, look at the last file listed.  Typically it will be bsdinstall_log, on my systems the date on bsdinstall_log matches the line "Began Installation at" inside it (at least for the month day year).

Basically VladiBG and smithi have said.
Since most of the files on the install media are typically in an archive format of some kind and just get unarchived to the install media, they typically have the timestamps of when they were created on the original system (basically tar/untar preserves the original timestamps of the files), so that's why they match the install media.

I think the proper method is look at the bsdinstall_log rather than trying to determine it from files/directories by using stat.  What if someone did not have /home as a symlink after install and added it 6 months later?  You won't realize that unless you have something to compare against.

That's a beauty of ZFS:  zpool history gives you details on a pool, starting with a timestamped "zpool create" command.


----------



## smithi (Jan 5, 2023)

smithi said:


> // edit:
> As VladiBG says,
> //
> /var/log/bsdinstall_log is likely the first new file written, or you can list /etc in time order to see the first date after the build date:
> ...





Vovas said:


> It's not correct way
> 
> ```
> vovas@tank:~ $ ls -lrt /etc | less
> ...



Yes, that's what I meant: you have to scroll down past those files to find the first date in /etc AFTER the OS build date.

Sorry if I wasn't clear.  Mer's post covered it better anyway.

cheers


----------

