From owner-freebsd-questions@FreeBSD.ORG Thu Jan 24 03:52:31 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E18CB16A417 for ; Thu, 24 Jan 2008 03:52:31 +0000 (UTC) (envelope-from bob89@bobj.org) Received: from eastrmmtao107.cox.net (eastrmmtao107.cox.net [68.230.240.59]) by mx1.freebsd.org (Postfix) with ESMTP id B1E0413C448 for ; Thu, 24 Jan 2008 03:52:31 +0000 (UTC) (envelope-from bob89@bobj.org) Received: from eastrmimpo02.cox.net ([68.1.16.120]) by eastrmmtao107.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20080124035231.KGZM8815.eastrmmtao107.cox.net@eastrmimpo02.cox.net> for ; Wed, 23 Jan 2008 22:52:31 -0500 Received: from mail.bobj.org ([70.185.102.217]) by eastrmimpo02.cox.net with bizsmtp id grrl1Y0014hS3Ka0000000; Wed, 23 Jan 2008 22:51:45 -0500 Received: from dhcp3.wb4jcm.org (dhcp3.wb4jcm.org [192.168.132.63]) (AUTH: PLAIN bobj, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mail.bobj.org with esmtp; Wed, 23 Jan 2008 22:52:29 -0500 From: Bob Johnson To: questions@freebsd.org Date: Wed, 23 Jan 2008 22:25:11 -0500 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200801232225.12308.bob89@bobj.org> Cc: Subject: mkisofs and timestamps in ISO-9660 filesystems X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2008 03:52:32 -0000 I posted this a few days ago and got only marginally helpful responses, so= =20 here it is again with more detail: 1) I'm using reasonably recent versions of things: # uname -a =46reeBSD acer.wb4jcm.org 7.0-RC1 FreeBSD 7.0-RC1 #0: Mon Dec 24 10:10:07 U= TC=20 2007 root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 # mkisofs -version mkisofs 2.01.01a37 (amd64-unknown-freebsd7.0) Copyright (C) 1993-1997 Eric= =20 Youngdale (C) 1997-2007 J=F6rg Schilling # pkg_info | grep cdrtools cdrtools-devel-2.01.01a37,1 CD/DVD and ISO-9660 image creation and extracti= on=20 tools 2) My system is set to US Eastern Standard Time: # date Wed Jan 23 21:45:27 EST 2008 # date -u Thu Jan 24 02:45:49 UTC 2008 # TZ=3DEST date Wed Jan 23 21:46:53 EST 2008 # TZ=3DGMT date Thu Jan 24 02:46:58 GMT 2008 # echo $TZ #=20 This is a dual boot system (with MS Vista), so the hardware clock is set to= =20 local time, not to GMT. I suspect this is significant. 3) I have a test file (just a bunch of zeroes). It's big because I wanted t= o=20 see how quickly this system could write out a GB of data, but I get the sam= e=20 results with small files). The time stamp displayed by "ls" is correct for= =20 local time, and shows correct GMT time if I ask for it: # ls -l total 1049104 =2Drw-r--r-- 1 root bobj 1073741824 Jan 23 21:28 test.file <--CORRECT # TZ=3DGMT ls -l total 1049104 =2Drw-r--r-- 1 root bobj 1073741824 Jan 24 02:28 test.file <--CORRECT # =20 4) I use mkisofs to create an ISO filesystem with this test file in it: # mkisofs -R -J -o test.iso test.file 0.95% done, estimate finish Wed Jan 23 21:55:59 2008 [...] 99.15% done, estimate finish Wed Jan 23 21:54:46 2008 Total translation table size: 0 Total rockridge attributes bytes: 274 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used 0 524469 extents written (1024 MB) 5) I use mdconfig to mount the ISO filesystem (I get the same results if I = use=20 burncd to burn a CD and then mount the CD): # mdconfig -a -t vnode -f test.iso -u 4 # mount_cd9660 /dev/md4 /mnt # =20 6) Now when I look at the dates on the ISO filesystem, they are wrong. They= =20 look like the correction for offset from GMT has been applied twice. Note=20 that the correct local timestamp for the file on the ISO filesystem is Jan= =20 23 21:28 and the correct GMT timestamp is Jan 24 02:28. # ls -l /mnt total 1048576 =2Drw-r--r-- 1 root bobj 1073741824 Jan 23 16:28 test.file <-- WRONG! # TZ=3DEST ls -l /mnt total 1048576 =2Drw-r--r-- 1 root bobj 1073741824 Jan 23 16:28 test.file <-- WRONG! # TZ=3DGMT ls -l /mnt total 1048576 =2Drw-r--r-- 1 root bobj 1073741824 Jan 23 21:28 test.file <-- WRONG! # # ls -lc /mnt total 1048576 =2Drw-r--r-- 1 root bobj 1073741824 Jan 23 16:28 test.file <-- WRONG! # ls -lt /mnt total 1048576 =2Drw-r--r-- 1 root bobj 1073741824 Jan 23 16:28 test.file <-- WRONG! # ls -lu /mnt total 1048576 =2Drw-r--r-- 1 root bobj 1073741824 Jan 23 16:37 test.file <-- WRONG! # =20 So what is going on here? Is this a bug, or a misconfiguration, or a=20 misunderstanding?=20 And as a side issue, why is the incorrect last access time 16:37, rather th= an=20 16:54, since I built the ISO filesystem at 21:54? I have not yet tried moving a CD to a Windows system to see what the file=20 timestamp shows there. I have tried this on two different FreeBSD systems=20 (7.0-RC1 amd64, and 6.2-RELEASE-p9 i386) with both cdrtools and=20 cdrtools-devel from ports, and get the same results. =2D Bob