Date: Wed, 23 Jan 2008 22:25:11 -0500 From: Bob Johnson <bob89@bobj.org> To: questions@freebsd.org Subject: mkisofs and timestamps in ISO-9660 filesystems Message-ID: <200801232225.12308.bob89@bobj.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801232225.12308.bob89>