From owner-freebsd-current@FreeBSD.ORG Wed Feb 19 19:20:58 2014 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0020EDB2; Wed, 19 Feb 2014 19:20:57 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C10A01939; Wed, 19 Feb 2014 19:20:57 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WGChU-000Fqr-Gj; Wed, 19 Feb 2014 19:20:56 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s1JJKrX8030231; Wed, 19 Feb 2014 12:20:53 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+L9rBGvHcOIp1L8dk5Wdf9 Subject: Re: Device File Creation Time From: Ian Lepore To: John Baldwin In-Reply-To: <201402191344.21738.jhb@freebsd.org> References: <201402191344.21738.jhb@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" Date: Wed, 19 Feb 2014 12:20:53 -0700 Message-ID: <1392837653.1145.41.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s1JJKrX8030231 Cc: Bruno =?ISO-8859-1?Q?Lauz=E9?= , freebsd-current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 19:20:58 -0000 On Wed, 2014-02-19 at 13:44 -0500, John Baldwin wrote: > On Tuesday, February 18, 2014 3:02:16 pm Bruno Lauz=E9 wrote: > > root@pcbsd:/dev # stat /dev/ada0 > > 1895890688 97 crw-rw-rw- 1 root operator 97 0 "Feb 18 10:52:11 2014" = "Feb 17=20 > 09:36:43 2014" "Feb 17 09:36:43 2014" "Dec 31 17:59:59 1969" 4096 0 0=20 > /dev/ada0 > >=20 > > root@pcbsd:/dev # stat /dev/ada0p2 > > 1895890688 103 crw-rw-rw- 1 root operator 103 0 "Feb 18 10:52:05 2014= " "Feb=20 > 17 09:36:43 2014" "Feb 17 09:36:43 2014" "Dec 31 17:59:59 1969" 4096 0 = 0=20 > /dev/ada0p2 > >=20 > > root@pcbsd:/dev # stat /dev/ada0p3 > > 1895890688 105 crw-rw-rw- 1 root operator 105 0 "Feb 18 10:52:21 2014= " "Feb=20 > 17 09:36:43 2014" "Feb 17 09:36:43 2014" "Dec 31 17:59:59 1969" 4096 0 = 0=20 > /dev/ada0p3 > >=20 > > As we can see all files in devfs reports Dec 31 1969 as creation time. > >=20 > > Can we look to manage this value to know when a certain device was=20 > installed? > >=20 > > It would be really great to know when a disk was replaced. > >=20 > > Would there be any other mechanism to accomplish this? >=20 > I think if you hot attach a device post-boot it will have the time it w= as=20 > attached as the birth time. I think it is only devices created during = boot=20 > that use time 0. >=20 That's actually a time of -1 converted to some local timezone. I'm not sure that's germane, just thought I'd mention it. revolution > date -jur -1 Wed Dec 31 23:59:59 UTC 1969 -- Ian