Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Mar 2017 11:14:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 217560] FAT32 - Time stamp of file is one hour off
Message-ID:  <bug-217560-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217560

            Bug ID: 217560
           Summary: FAT32 - Time stamp of file is one hour off
           Product: Base System
           Version: 11.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: erik@nordstroem.no

I live in time zone GMT + 1.

While trying something for another issue (#217440), I created a file on a F=
AT32
formatted USB stick using my Sony PlayStation 4.

The PlayStation 4 is showing the correct local time and I have verified tha=
t it
has its time zone configured correctly as "UTC+01:00 Oslo".

My laptop is showing the correct local time and I have the TZ env variable =
set
correctly as "Europe/Oslo".

I took a screenshot in the game Alien: Isolation on the PS4 and transferred=
 it
to my USB stick.

I mounted the USB stick with

# mount_msdosfs -L en_US.UTF-8 /dev/da1s1 /mnt/

as per the discussion in issue #217440

but when I list the directory contents, the time stamp of the files is off =
by
one hour into the future compared to actual time when the file was created =
as
shown below. Note also that the file name itself contains the correct time =
when
the file was created. I transferred the file to my memory stick within minu=
tes
of having taken the screenshot.

I don't have a windows system to create files from at the moment so I can't
verify whether this is a problem with FreeBSD handling of FAT32 or if the
incorrect timestamp was caused by the PS4.

I have attached an image of a minimal FAT32 partition which contains the
directory structure and the screenshot which was written to the USB stick by
the PS4.

The USB stick was prepared with

# umount /dev/da1s1
$ gpart delete -i 1 /dev/da1
$ gpart destroy /dev/da1
# dd if=3D/dev/zero of=3D/dev/da1 bs=3D16m
$ gpart create -s mbr /dev/da1
$ gpart add -t fat32 -s 4g -i 1 /dev/da1
# newfs_msdos -F32 /dev/da1s1
# sync

$ gpart show da1
=3D>      63  30277569  da1  MBR  (14G)
        63      8161       - free -  (4.0M)
      8224   8388608    1  fat32  (4.0G)
   8396832  21880800       - free -  (10G)

Unplugged the USB stick, put it in the PS4, took a screenshot and transferr=
ed
it to the USB stick. Put it back in the computer and made a minimal image of
the FAT32 partition;

# umount /dev/da1s1
$ dd if=3D/dev/da1s1 of=3Dusbstick.img conv=3Dsparse bs=3D16m count=3D1
$ hd usbstick.img > tmp.img
$ xxd -r tmp.img > usbstick.img
$ rm tmp.img
$ ls -hal usbstick.img
-rw-r--r--  1 erikn  erikn   1.5M Mar  5 12:10 usbstick.img

To mount the image;

# mdconfig -a -t vnode -f usbstick.img -u 0
# mount_msdosfs -L en_US.UTF-8 /dev/md0 /mnt/

Here we have the file with the mismatching timestamp.

$ ls -al /mnt/PS4/SHARE/Screenshots/Alien_\ Isolation=E2=84=A2/
total 768
drwxrwxrwx  1 root  wheel   32768 Mar  5 13:07 ./
drwxrwxrwx  1 root  wheel   32768 Mar  5 13:07 ../
-rwxrwxrwx  1 root  wheel  305981 Mar  5 13:07 Alien_
Isolation=E2=84=A2_20170305120653.jpg*

Unmount image;

# umount /dev/md0
# mdconfig -d -u 0

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-217560-8>