Discussion:
Date of a FreeBSD installation
David Demelier
2011-01-13 20:28:29 UTC
Permalink
Hello folks,

I'm just guessing if there is a way to know a FreeBSD installation date.
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.

I think searching a file absolutely not touched ever in the system can
helps but which one?

***@Melon ~ $ ls -l /root/.cshrc
-rw-r--r-- 2 root wheel 798 19 Jul 04:17 /root/.cshrc

It seems that this file has the FreeBSD dist access time so can't refers
to neither.

Do you have any clue?

Cheers,
--
David Demelier
Matthias Apitz
2011-01-13 20:34:56 UTC
Permalink
Post by David Demelier
Hello folks,
I'm just guessing if there is a way to know a FreeBSD installation date.
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.
I think searching a file absolutely not touched ever in the system can
helps but which one?
-rw-r--r-- 2 root wheel 798 19 Jul 04:17 /root/.cshrc
It seems that this file has the FreeBSD dist access time so can't refers
to neither.
Do you have any clue?
I always use for this the oldest installed pkg:

$ ls -lt /var/db/pkg

HIH

matthias
--
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <***@unixarea.de> - w http://www.unixarea.de/
krad
2011-01-14 09:27:26 UTC
Permalink
Post by Matthias Apitz
Post by David Demelier
Hello folks,
I'm just guessing if there is a way to know a FreeBSD installation date.
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.
I think searching a file absolutely not touched ever in the system can
helps but which one?
-rw-r--r-- 2 root wheel 798 19 Jul 04:17 /root/.cshrc
It seems that this file has the FreeBSD dist access time so can't refers
to neither.
Do you have any clue?
$ ls -lt /var/db/pkg
HIH
matthias
--
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "
no good if packages have been updated
Chuck Swiger
2011-01-13 20:36:14 UTC
Permalink
I'm just guessing if there is a way to know a FreeBSD installation date. We can't look after the uname -a ident since an update of the FreeBSD kernel is possible.
I think searching a file absolutely not touched ever in the system can helps but which one?
Symlinks under /etc are a good choice:

# cd /etc ; ls -ltr | head
total 1242
lrwxrwxrwx 1 root wheel 23 May 26 2001 termcap@ -> /usr/share/misc/termcap
lrwxrwxrwx 1 root wheel 13 May 26 2001 rmt@ -> /usr/sbin/rmt

Regards,
--
-Chuck
Chip Camden
2011-01-13 20:45:25 UTC
Permalink
Post by Chuck Swiger
I'm just guessing if there is a way to know a FreeBSD installation date. We can't look after the uname -a ident since an update of the FreeBSD kernel is possible.
I think searching a file absolutely not touched ever in the system can helps but which one?
# cd /etc ; ls -ltr | head
total 1242
Regards,
--
-Chuck
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
On my system, /etc/termcap has the date well after my installation
(Jun 28 2010) and /etc/rmt dates to well before (Nov 21 2009). I first
installed FreeBSD on this system on Apr 1 2010.
--
Sterling (Chip) Camden | ***@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipsquips.com | http://chipstips.com
Chuck Swiger
2011-01-13 20:55:39 UTC
Permalink
Post by Chip Camden
On my system, /etc/termcap has the date well after my installation
(Jun 28 2010) and /etc/rmt dates to well before (Nov 21 2009). I first
installed FreeBSD on this system on Apr 1 2010.
Certainly the target of the link would change; my /etc/termcap points to:

-r--r--r-- 1 root wheel 206901 Dec 14 21:03 /usr/share/misc/termcap

This particular box I'm looking at had been updated from FreeBSD-4.x through 7-STABLE, so a 2001 timestamp for the original installs seems about right.

I wonder, are you folks using something other than UFS for / filesystem...perhaps ZFS or whatever handles the dates on symlinks differently?

Regards,
--
-Chuck
Chip Camden
2011-01-13 21:03:19 UTC
Permalink
Post by Chuck Swiger
Post by Chip Camden
On my system, /etc/termcap has the date well after my installation
(Jun 28 2010) and /etc/rmt dates to well before (Nov 21 2009). I first
installed FreeBSD on this system on Apr 1 2010.
-r--r--r-- 1 root wheel 206901 Dec 14 21:03 /usr/share/misc/termcap
This particular box I'm looking at had been updated from FreeBSD-4.x through 7-STABLE, so a 2001 timestamp for the original installs seems about right.
I wonder, are you folks using something other than UFS for / filesystem...perhaps ZFS or whatever handles the dates on symlinks differently?
Regards,
--
-Chuck
I'm all UFS. My first installation was 8.0-RELEASE. At that time, I
don't think termcap was even a symlink, but I could be mistaken.

I'm looking at the date on the symlink itself, not its target.
--
Sterling (Chip) Camden | ***@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipsquips.com | http://chipstips.com
Devin Teske
2011-01-13 21:46:22 UTC
Permalink
Post by Chip Camden
Post by Chuck Swiger
Post by Chip Camden
On my system, /etc/termcap has the date well after my installation
(Jun 28 2010) and /etc/rmt dates to well before (Nov 21 2009). I first
installed FreeBSD on this system on Apr 1 2010.
-r--r--r-- 1 root wheel 206901 Dec 14 21:03 /usr/share/misc/termcap
This particular box I'm looking at had been updated from FreeBSD-4.x through 7-STABLE, so a 2001 timestamp for the original installs seems about right.
I wonder, are you folks using something other than UFS for / filesystem...perhaps ZFS or whatever handles the dates on symlinks differently?
Regards,
--
-Chuck
I'm all UFS. My first installation was 8.0-RELEASE. At that time, I
don't think termcap was even a symlink, but I could be mistaken.
I'm looking at the date on the symlink itself, not its target.
This is nearly always accurate on any FreeBSD system (when wanting to
query the date the machine was built):

ls -l /etc/defaults/rc.conf

But again... not always. Though for all situations where the answer is
_NOT_ the correct answer... there's usually a damned-good explanation
why (the machine was rsync'd etc.), in which case I still consider the
date returned to be accurate (for any time /etc/defaults/rc.conf -- or
perhaps even better... /etc/rc -- is touched, I'd consider the system to
be "rebuilt" since those files should be somewhat "golden" on a system
-- read: never touched except during system upgrade or rsync etc.).
--
Cheers,
Devin Teske

-> CONTACT INFORMATION <-
Business Solutions Consultant II
FIS - fisglobal.com
510-735-5650 Mobile
510-621-2038 Office
510-621-2020 Office Fax
909-477-4578 Home/Fax
***@fisglobal.com

-> LEGAL DISCLAIMER <-
This message contains confidential and proprietary information
of the sender, and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person is strictly prohibited. If you have received this
message in error, please notify the e-mail sender immediately,
and delete the original message without making a copy.

-> END TRANSMISSION <-
Chuck Swiger
2011-01-13 21:50:27 UTC
Permalink
Post by Devin Teske
This is nearly always accurate on any FreeBSD system (when wanting to
ls -l /etc/defaults/rc.conf
I gather that you don't ever run mergemaster, which would update this file?
My machine installed in 2001 has a Dec 2010 date for that file:

-r--r--r-- 1 root wheel 36037 Dec 1 14:13 /etc/defaults/rc.conf

Regards,
--
-Chuck
Devin Teske
2011-01-13 21:57:38 UTC
Permalink
Post by Chuck Swiger
Post by Devin Teske
This is nearly always accurate on any FreeBSD system (when wanting to
ls -l /etc/defaults/rc.conf
I gather that you don't ever run mergemaster, which would update this file?
I view the running of mergemaster as part of a system upgrade which at
that point... I'm saying that the system is undergoing a "rebuild" in
which case, `ls -ltr /etc/defaults/rc.conf' is accurate (but, yes... I
agree with you that this is dependent upon the definition of "accurate"
-- entirely subjective to the definition of "when did I build this
machine?"; not everybody considers "built" to be "inception").

That being said... because mergemaster _can_ touch every file on the
system, you really can't get an "accurate" answer from _any_ file's
timestamp.

You're going to have to resort to things that aren't touched during a
system upgrade if you want to find out the `true' answer as to when the
box was first ... what? partitioned? newfs'd? clue me in here.

What _is_ the definition of "built" ??? When the hardware pieces were
coalesced into a single chassis? If that's the case, I'd be looking at
model numbers of internal parts.
Post by Chuck Swiger
-r--r--r-- 1 root wheel 36037 Dec 1 14:13 /etc/defaults/rc.conf
Regards,
--
Cheers,
Devin Teske

-> CONTACT INFORMATION <-
Business Solutions Consultant II
FIS - fisglobal.com
510-735-5650 Mobile
510-621-2038 Office
510-621-2020 Office Fax
909-477-4578 Home/Fax
***@fisglobal.com

-> LEGAL DISCLAIMER <-
This message contains confidential and proprietary information
of the sender, and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person is strictly prohibited. If you have received this
message in error, please notify the e-mail sender immediately,
and delete the original message without making a copy.

-> END TRANSMISSION <-
Chad Perrin
2011-01-27 20:39:28 UTC
Permalink
Post by Devin Teske
You're going to have to resort to things that aren't touched during a
system upgrade if you want to find out the `true' answer as to when the
box was first ... what? partitioned? newfs'd? clue me in here.
What _is_ the definition of "built" ??? When the hardware pieces were
coalesced into a single chassis? If that's the case, I'd be looking at
model numbers of internal parts.
I suspect that at this point you are just being pedantic, and that you
know what the question actually means; you just want to dismiss the
question as immaterial.
--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
Devin Teske
2011-01-27 21:09:52 UTC
Permalink
Post by Chad Perrin
Post by Devin Teske
You're going to have to resort to things that aren't touched during a
system upgrade if you want to find out the `true' answer as to when the
box was first ... what? partitioned? newfs'd? clue me in here.
What _is_ the definition of "built" ??? When the hardware pieces were
coalesced into a single chassis? If that's the case, I'd be looking at
model numbers of internal parts.
I suspect that at this point you are just being pedantic,
Correct. I get paid to be pedantic. It's a staple of my tenure-track
position.
Post by Chad Perrin
and that you
know what the question actually means
Correct. Going back to the OP's e-mail, he indeed clarified that he was
only interested in the install-date of FreeBSD.
Post by Chad Perrin
; you just want to dismiss the
question as immaterial.
Incorrect and perceptually [unrightly] indignent.

The above statements (which you've taken out of context) were not to the
OP but a reply-thread between Chuck Swiger and myself.
--
Devin
Chad Perrin
2011-01-27 21:36:29 UTC
Permalink
Post by Devin Teske
Post by Chad Perrin
Post by Devin Teske
You're going to have to resort to things that aren't touched during a
system upgrade if you want to find out the `true' answer as to when the
box was first ... what? partitioned? newfs'd? clue me in here.
What _is_ the definition of "built" ??? When the hardware pieces were
coalesced into a single chassis? If that's the case, I'd be looking at
model numbers of internal parts.
I suspect that at this point you are just being pedantic,
Correct. I get paid to be pedantic. It's a staple of my tenure-track
position.
Do you get paid to read carefully? I did not simply say you're being
pedantic. I said you're *just* being pedantic, which is considerably
less useful or respectable.
Post by Devin Teske
Post by Chad Perrin
and that you
know what the question actually means
Correct. Going back to the OP's e-mail, he indeed clarified that he was
only interested in the install-date of FreeBSD.
Post by Chad Perrin
; you just want to dismiss the
Incorrect and perceptually [unrightly] indignent.
s/indignent/indignant/

(just being pedantic; pardon me)

If that is not your intent, please enlighten me, because it *still* seems
to be your intended meaning, and this only looks like backpedaling in the
absence of any clarification of intended meaning.
Post by Devin Teske
The above statements (which you've taken out of context) were not to the
OP but a reply-thread between Chuck Swiger and myself.
. . . and yet, they're on the public list, so (it seems) there must be
some desire for them to be consumed by the general readership. If that
desire is not rooted in an interest in publicly humiliating someone, the
next most likely reason seems to be to make comments in the general
context of the discussion thread hearkening back to the OP. A third most
likely does not immediately spring to mind.
--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
Chad Perrin
2011-01-28 06:37:29 UTC
Permalink
I tried responding to an off-list message. Delivery failed for some
reason.

I just don't want the sender of the message to which I tried to reply to
think I'm ignoring him, so I elected to send this to the list.

Thanks for your patience.
--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
Polytropon
2011-01-13 22:30:16 UTC
Permalink
Post by Chuck Swiger
Post by Devin Teske
This is nearly always accurate on any FreeBSD system (when wanting to
ls -l /etc/defaults/rc.conf
I gather that you don't ever run mergemaster, which would update this file?
-r--r--r-- 1 root wheel 36037 Dec 1 14:13 /etc/defaults/rc.conf
Exactly that was my thought. Maybe a file that is NOT subject
to one of the system upgrade procedures would be better? Maybe
something in /boot?

% ls -l /etc/defaults/rc.conf
-r--r--r-- 1 root wheel 34300 Aug 24 2008 /etc/defaults/rc.conf
% ls -l /boot/defaults/loader.conf
-r--r--r-- 1 root wheel 19426 Aug 24 2008 /boot/defaults/loader.conf

No, forget about that, also nonsense, looks to new...
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
Carl Johnson
2011-01-13 23:01:34 UTC
Permalink
Post by Polytropon
Post by Chuck Swiger
Post by Devin Teske
This is nearly always accurate on any FreeBSD system (when wanting to
ls -l /etc/defaults/rc.conf
I gather that you don't ever run mergemaster, which would update this file?
-r--r--r-- 1 root wheel 36037 Dec 1 14:13 /etc/defaults/rc.conf
Exactly that was my thought. Maybe a file that is NOT subject
to one of the system upgrade procedures would be better? Maybe
something in /boot?
% ls -l /etc/defaults/rc.conf
-r--r--r-- 1 root wheel 34300 Aug 24 2008 /etc/defaults/rc.conf
% ls -l /boot/defaults/loader.conf
-r--r--r-- 1 root wheel 19426 Aug 24 2008 /boot/defaults/loader.conf
No, forget about that, also nonsense, looks to new...
How about /var/empty:

% ls -ldo /var/empty/
dr-xr-xr-x 2 root wheel schg 512 Jul 18 19:16 /var/empty/

It can be changed, but doesn't look likely.
--
Carl Johnson ***@peak.org
Chip Camden
2011-01-13 23:08:46 UTC
Permalink
Post by Carl Johnson
Post by Polytropon
Post by Chuck Swiger
Post by Devin Teske
This is nearly always accurate on any FreeBSD system (when wanting to
ls -l /etc/defaults/rc.conf
I gather that you don't ever run mergemaster, which would update this file?
-r--r--r-- 1 root wheel 36037 Dec 1 14:13 /etc/defaults/rc.conf
Exactly that was my thought. Maybe a file that is NOT subject
to one of the system upgrade procedures would be better? Maybe
something in /boot?
% ls -l /etc/defaults/rc.conf
-r--r--r-- 1 root wheel 34300 Aug 24 2008 /etc/defaults/rc.conf
% ls -l /boot/defaults/loader.conf
-r--r--r-- 1 root wheel 19426 Aug 24 2008 /boot/defaults/loader.conf
No, forget about that, also nonsense, looks to new...
% ls -ldo /var/empty/
dr-xr-xr-x 2 root wheel schg 512 Jul 18 19:16 /var/empty/
It can be changed, but doesn't look likely.
--
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
On my system, it gives a date several months in advance of my install
date (Nov 21 2009).
--
Sterling (Chip) Camden | ***@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipsquips.com | http://chipstips.com
Carl Johnson
2011-01-14 04:59:10 UTC
Permalink
Post by Chip Camden
Post by Carl Johnson
Post by Polytropon
Post by Chuck Swiger
Post by Devin Teske
This is nearly always accurate on any FreeBSD system (when wanting to
ls -l /etc/defaults/rc.conf
I gather that you don't ever run mergemaster, which would update this file?
-r--r--r-- 1 root wheel 36037 Dec 1 14:13 /etc/defaults/rc.conf
Exactly that was my thought. Maybe a file that is NOT subject
to one of the system upgrade procedures would be better? Maybe
something in /boot?
% ls -l /etc/defaults/rc.conf
-r--r--r-- 1 root wheel 34300 Aug 24 2008 /etc/defaults/rc.conf
% ls -l /boot/defaults/loader.conf
-r--r--r-- 1 root wheel 19426 Aug 24 2008 /boot/defaults/loader.conf
No, forget about that, also nonsense, looks to new...
% ls -ldo /var/empty/
dr-xr-xr-x 2 root wheel schg 512 Jul 18 19:16 /var/empty/
It can be changed, but doesn't look likely.
On my system, it gives a date several months in advance of my install
date (Nov 21 2009).
Oops, you're right. I just checked and it is a few days before I
actually installed mine, so that is probably when the ISO was built.
--
Carl Johnson ***@peak.org
Chris Brennan
2011-01-14 15:37:08 UTC
Permalink
Post by Carl Johnson
% ls -ldo /var/empty/
dr-xr-xr-x 2 root wheel schg 512 Jul 18 19:16 /var/empty/
It can be changed, but doesn't look likely.
Ivan's e-mail I think might be a little more accurate

***@ziggy.xaerolimit.net [~]# grep delta /etc/rc.conf && lsl /etc/hostid
#-- sysinstall generated deltas -- # Sun Mar 8 19:10:02 2009
# -- sysinstall generated deltas -- # Tue Oct 26 02:15:25 2010
2 -rw-r--r-- 1 root wheel 37B Mar 9 2009 /etc/hostid
***@ziggy.xaerolimit.net [~]#

whereas, your's gives me a date prior to that.

***@ziggy.xaerolimit.net [~]#
ls -ldo /var/empty/
dr-xr-xr-x 2 root wheel schg 512 Jan 1 2009 /var/empty/
***@ziggy.xaerolimit.net [~]#
David DEMELIER
2011-01-13 20:47:32 UTC
Permalink
Post by Chuck Swiger
I'm just guessing if there is a way to know a FreeBSD installation date. We can't look after the uname -a ident since an update of the FreeBSD kernel is possible.
I think searching a file absolutely not touched ever in the system can helps but which one?
# cd /etc ; ls -ltr | head
total 1242
Regards,
--
-Chuck
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
***@Melon ~ $ cd /etc ; ls -ltr | head
total 612
drwxr-xr-x 2 root wheel 512 19 Jul 04:16 zfs
drwxr-xr-x 2 root wheel 512 19 Jul 04:16 skel

Same that my original post. I have not installed FreeBSD on July but
as Chip says the /home symlink is a pretty good choice :-)

Thanks
--
Demelier David
Chip Camden
2011-01-13 20:38:21 UTC
Permalink
Post by David Demelier
Hello folks,
I'm just guessing if there is a way to know a FreeBSD installation date.
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.
I think searching a file absolutely not touched ever in the system can
helps but which one?
-rw-r--r-- 2 root wheel 798 19 Jul 04:17 /root/.cshrc
It seems that this file has the FreeBSD dist access time so can't refers
to neither.
Do you have any clue?
Cheers,
--
David Demelier
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
The date on the /home symlink reflects my install date. I don't think
anything would touch that.
--
Sterling (Chip) Camden | ***@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipsquips.com | http://chipstips.com
David DEMELIER
2011-01-14 08:38:02 UTC
Permalink
Post by David Demelier
Hello folks,
I'm just guessing if there is a way to know a FreeBSD installation date.
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.
I think searching a file absolutely not touched ever in the system can
helps but which one?
-rw-r--r--  2 root  wheel  798 19 Jul 04:17 /root/.cshrc
It seems that this file has the FreeBSD dist access time so can't refers
to neither.
Do you have any clue?
Cheers,
--
David Demelier
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
The date on the /home symlink reflects my install date.  I don't think
anything would touch that.
--
http://camdensoftware.com | http://chipsquips.com       | http://chipstips.com
And to be sure that anything can touch it you can add the the `uchf'
flag to the symlink :

***@Melon ~ $ ls -l /home
lrwxr-xr-x 1 root wheel 8 11 Jan 2011 /home -> usr/home
***@Melon ~ $ sudo chflags uchg /home
***@Melon ~ $ sudo touch /home
touch: /home: Operation not permitted

But be careful, apply `uchg' flag on /home and not /home/.
--
Demelier David
n j
2011-01-14 08:43:57 UTC
Permalink
Post by David Demelier
I'm just guessing if there is a way to know a FreeBSD installation date.
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.
How about looking at /proc or /mnt?

On a couple of my boxes that I checked, those files came up being the
oldest and probably match the installation date.
--
Nino
Chip Camden
2011-01-14 15:37:45 UTC
Permalink
Post by n j
Post by David Demelier
I'm just guessing if there is a way to know a FreeBSD installation date.
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.
How about looking at /proc or /mnt?
On a couple of my boxes that I checked, those files came up being the
oldest and probably match the installation date.
--
Nino
For me, /proc is older, /mnt is newer, than the install date.
--
Sterling (Chip) Camden | ***@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipsquips.com | http://chipstips.com
krad
2011-01-14 16:07:16 UTC
Permalink
Post by Chip Camden
Post by n j
Post by David Demelier
I'm just guessing if there is a way to know a FreeBSD installation
date.
Post by n j
Post by David Demelier
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.
How about looking at /proc or /mnt?
On a couple of my boxes that I checked, those files came up being the
oldest and probably match the installation date.
--
Nino
For me, /proc is older, /mnt is newer, than the install date.
--
http://camdensoftware.com | http://chipsquips.com |
http://chipstips.com
its nice to know the installation date, but im not sure what it gains you
technically.
Chip Camden
2011-01-14 15:36:55 UTC
Permalink
Post by David DEMELIER
The date on the /home symlink reflects my install date.  I don't think
anything would touch that.
--
http://camdensoftware.com | http://chipsquips.com       | http://chipstips.com
And to be sure that anything can touch it you can add the the `uchf'
lrwxr-xr-x 1 root wheel 8 11 Jan 2011 /home -> usr/home
touch: /home: Operation not permitted
But be careful, apply `uchg' flag on /home and not /home/.
--
Demelier David
Touché.
--
Sterling (Chip) Camden | ***@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipsquips.com | http://chipstips.com
Ivan Voras
2011-01-13 23:00:45 UTC
Permalink
Post by David Demelier
Hello folks,
I'm just guessing if there is a way to know a FreeBSD installation date.
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.
If you haven't removed it, a line in /etc/rc.conf should be written by
sysinstall at system install time:

# -- sysinstall generated deltas -- # Sun Sep 14 16:13:22 2008

On a newer system (7+?), the timestamp of /etc/hostid would be from the
first boot.
Chip Camden
2011-01-13 23:07:44 UTC
Permalink
Post by Ivan Voras
Post by David Demelier
Hello folks,
I'm just guessing if there is a way to know a FreeBSD installation date.
We can't look after the uname -a ident since an update of the FreeBSD
kernel is possible.
If you haven't removed it, a line in /etc/rc.conf should be written by
# -- sysinstall generated deltas -- # Sun Sep 14 16:13:22 2008
On a newer system (7+?), the timestamp of /etc/hostid would be from the
first boot.
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
/etc/hostid has the right date for me.
--
Sterling (Chip) Camden | ***@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipsquips.com | http://chipstips.com
RW
2011-01-13 23:23:21 UTC
Permalink
On Thu, 13 Jan 2011 21:28:29 +0100
Post by David Demelier
Hello folks,
I'm just guessing if there is a way to know a FreeBSD installation
date. We can't look after the uname -a ident since an update of the
FreeBSD kernel is possible.
I think searching a file absolutely not touched ever in the system
can helps but which one?
-rw-r--r-- 2 root wheel 798 19 Jul 04:17 /root/.cshrc
It seems that this file has the FreeBSD dist access time so can't
refers to neither.
Do you have any clue?
Cheers,
I'd suggest looking at the Btimes of top level directories

stat -f "%SB %N" /*
Carl Chave
2011-01-14 05:04:15 UTC
Permalink
Post by RW
I'd suggest looking at the Btimes of top level directories
stat -f "%SB %N" /*
Or how about just / as this ~15 minutes earlier than most of the
remaining top level directories


sodserve# stat -f "%SB %N" /*
Jan 9 04:54:21 2011 /COPYRIGHT
Jan 9 04:54:21 2011 /bin
Jan 9 04:54:21 2011 /boot
Dec 31 18:59:59 1969 /dev
Jan 9 04:54:21 2011 /etc
Jan 9 04:54:21 2011 /lib
Jan 9 04:54:21 2011 /libexec
Jan 9 04:54:21 2011 /media
Jan 9 04:54:21 2011 /mnt
Jan 9 04:54:21 2011 /proc
Jan 9 04:54:21 2011 /rescue
Jan 9 04:54:21 2011 /root
Jan 9 04:54:21 2011 /sbin
Jan 9 04:54:21 2011 /sys
Jan 9 04:48:39 2011 /tmp
Jan 9 04:48:45 2011 /usr
Jan 9 04:49:39 2011 /var

sodserve# stat -f "%SB %N" /
Jan 9 04:39:59 2011 /
Chip Camden
2011-01-14 15:32:13 UTC
Permalink
Post by Carl Chave
Post by RW
I'd suggest looking at the Btimes of top level directories
stat -f "%SB %N" /*
Or how about just / as this ~15 minutes earlier than most of the
remaining top level directories
sodserve# stat -f "%SB %N" /*
Jan 9 04:54:21 2011 /COPYRIGHT
Jan 9 04:54:21 2011 /bin
Jan 9 04:54:21 2011 /boot
Dec 31 18:59:59 1969 /dev
Jan 9 04:54:21 2011 /etc
Jan 9 04:54:21 2011 /lib
Jan 9 04:54:21 2011 /libexec
Jan 9 04:54:21 2011 /media
Jan 9 04:54:21 2011 /mnt
Jan 9 04:54:21 2011 /proc
Jan 9 04:54:21 2011 /rescue
Jan 9 04:54:21 2011 /root
Jan 9 04:54:21 2011 /sbin
Jan 9 04:54:21 2011 /sys
Jan 9 04:48:39 2011 /tmp
Jan 9 04:48:45 2011 /usr
Jan 9 04:49:39 2011 /var
sodserve# stat -f "%SB %N" /
Jan 9 04:39:59 2011 /
For me, that gets the Nov 21 2009 date, which is earlier than my
install date.

So far, /etc/hostid and the /home symlink seem to be the winners.
--
Sterling (Chip) Camden | ***@camdensoftware.com | 2048D/3A978E4F
http://camdensoftware.com | http://chipsquips.com | http://chipstips.com
RW
2011-01-14 17:23:37 UTC
Permalink
On Fri, 14 Jan 2011 07:32:13 -0800
Post by Chip Camden
Post by Carl Chave
sodserve# stat -f "%SB %N" /*
Jan 9 04:54:21 2011 /COPYRIGHT
Jan 9 04:54:21 2011 /bin
Jan 9 04:54:21 2011 /boot
Dec 31 18:59:59 1969 /dev
Jan 9 04:54:21 2011 /etc
Jan 9 04:54:21 2011 /lib
Jan 9 04:54:21 2011 /libexec
sodserve# stat -f "%SB %N" /
Jan 9 04:39:59 2011 /
For me, that gets the Nov 21 2009 date, which is earlier than my
install date.
So far, /etc/hostid and the /home symlink seem to be the winners.
I think you'd have to look at a few dates. hostid hasn't been around
all that long, so it could have the date of the first boot after the
change was picked-up. There are legitimate reasons for modifying or
creating a /home symlink.
Carl Johnson
2011-01-14 18:46:04 UTC
Permalink
Post by Chip Camden
Post by Carl Chave
Post by RW
I'd suggest looking at the Btimes of top level directories
stat -f "%SB %N" /*
Or how about just / as this ~15 minutes earlier than most of the
remaining top level directories
sodserve# stat -f "%SB %N" /*
Jan 9 04:54:21 2011 /COPYRIGHT
Jan 9 04:54:21 2011 /bin
Jan 9 04:54:21 2011 /boot
Dec 31 18:59:59 1969 /dev
Jan 9 04:54:21 2011 /etc
Jan 9 04:54:21 2011 /lib
Jan 9 04:54:21 2011 /libexec
Jan 9 04:54:21 2011 /media
Jan 9 04:54:21 2011 /mnt
Jan 9 04:54:21 2011 /proc
Jan 9 04:54:21 2011 /rescue
Jan 9 04:54:21 2011 /root
Jan 9 04:54:21 2011 /sbin
Jan 9 04:54:21 2011 /sys
Jan 9 04:48:39 2011 /tmp
Jan 9 04:48:45 2011 /usr
Jan 9 04:49:39 2011 /var
sodserve# stat -f "%SB %N" /
Jan 9 04:39:59 2011 /
For me, that gets the Nov 21 2009 date, which is earlier than my
install date.
So far, /etc/hostid and the /home symlink seem to be the winners.
On my system /etc/hostid is several days later than my actual install
date, so that isn't always reliable. You might want to create a file
with the timestamp you want. The most likely time appears to me to be
the 'Created' time in /etc/rc.conf, as someone suggested earlier. The
following code will extract that and create a file with that timestamp.
I have checked it on my system, but use at your own risk.

file=/etc/install_date
date=$(grep '^# Created: ' /etc/rc.conf | cut -c 12-80)
tdate=$(date -j -f "%a %b %d %H:%M:%S %Y" "$date" "+%Y%m%d%H%M.%S")
echo $date > $file
touch -t $tdate $file
chmod -w $file
chflags schange $file
--
Carl Johnson ***@peak.org
David Demelier
2011-01-26 16:58:43 UTC
Permalink
Post by Carl Johnson
Post by Chip Camden
Post by Carl Chave
Post by RW
I'd suggest looking at the Btimes of top level directories
stat -f "%SB %N" /*
Or how about just / as this ~15 minutes earlier than most of the
remaining top level directories
sodserve# stat -f "%SB %N" /*
Jan 9 04:54:21 2011 /COPYRIGHT
Jan 9 04:54:21 2011 /bin
Jan 9 04:54:21 2011 /boot
Dec 31 18:59:59 1969 /dev
Jan 9 04:54:21 2011 /etc
Jan 9 04:54:21 2011 /lib
Jan 9 04:54:21 2011 /libexec
Jan 9 04:54:21 2011 /media
Jan 9 04:54:21 2011 /mnt
Jan 9 04:54:21 2011 /proc
Jan 9 04:54:21 2011 /rescue
Jan 9 04:54:21 2011 /root
Jan 9 04:54:21 2011 /sbin
Jan 9 04:54:21 2011 /sys
Jan 9 04:48:39 2011 /tmp
Jan 9 04:48:45 2011 /usr
Jan 9 04:49:39 2011 /var
sodserve# stat -f "%SB %N" /
Jan 9 04:39:59 2011 /
For me, that gets the Nov 21 2009 date, which is earlier than my
install date.
So far, /etc/hostid and the /home symlink seem to be the winners.
On my system /etc/hostid is several days later than my actual install
date, so that isn't always reliable. You might want to create a file
with the timestamp you want. The most likely time appears to me to be
the 'Created' time in /etc/rc.conf, as someone suggested earlier. The
following code will extract that and create a file with that timestamp.
I have checked it on my system, but use at your own risk.
file=/etc/install_date
date=$(grep '^# Created: ' /etc/rc.conf | cut -c 12-80)
tdate=$(date -j -f "%a %b %d %H:%M:%S %Y" "$date" "+%Y%m%d%H%M.%S")
echo $date> $file
touch -t $tdate $file
chmod -w $file
chflags schange $file
I finally agreed for /home symlink. I've made a mistake. To be sure the
link and not the directory /usr/home is touched the best to do is :

# chflags -h uchg /home

-h means "not following links"
--
David Demelier
Alexandr Sushko
2011-01-27 08:56:45 UTC
Permalink
Post by David Demelier
Hello folks,
I'm just guessing if there is a way to know a FreeBSD installation
date. We can't look after the uname -a ident since an update of the
FreeBSD kernel is possible.
I think searching a file absolutely not touched ever in the system can
helps but which one?
-rw-r--r-- 2 root wheel 798 19 Jul 04:17 /root/.cshrc
It seems that this file has the FreeBSD dist access time so can't
refers to neither.
Do you have any clue?
Cheers,
Try to use not ls -l, but ls -lc. It will show you file creation time.

ls -lcd /bin/, for example

drwxr-xr-x 2 root wheel 1024 Dec 10 00:31 /bin/
--
Best regards,
Alexandr Sushko
Chris Brennan
2011-01-27 16:20:59 UTC
Permalink
On Thu, Jan 27, 2011 at 3:56 AM, Alexandr Sushko
Post by Alexandr Sushko
Try to use not ls -l, but ls -lc. It will show you file creation time.
ls -lcd /bin/, for example
drwxr-xr-x 2 root wheel 1024 Dec 10 00:31 /bin/
I ran this and the earliest date I found was Oct 12, 2008 which seems to be
around when I migrated from 7.2 to 7.3 and this box has been alive since
6.0-RELEASE, it's a good 5-6 yrs old....
Loading...