--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: Incorrect modification time on image files mounted with loopback-devices
- From: Matthias Faulstich <faulstich@fh-swf.de>
- Date: Tue, 8 Jan 2008 09:00:43 +0100
- Message-id: <200801080900.43436.faulstich@fh-swf.de>
Package: mount
Version: 2.13-8
Debian Version: testing
In cooperation with the kernels loopback device driver, losetup doesn't handle
then timestamps of image files correctly.
If an image file, which is mounted via a loopback device is changed, the
modification timestamp of the related image file stays constant:
Example:
Create an image file with a file system, mount it and make some content:
mkdir mnt
dd if=/dev/zero of=test.img count=1440 bs=1024
losetup --help
losetup --help /dev/loop0 test.img
losetup /dev/loop0 test.img
mkfs.vfat /dev/loop0
mount /dev/loop0 mnt
touch mnt/test1
umount mnt
losetup -d /dev/loop0
See timestamps:
stat test.img
File: »test.img«
Size: 1474560 Blocks: 2888 IO Block: 4096 reguläre Datei
Device: 302h/770d Inode: 5473079 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2008-01-08 07:44:05.000000000 +0100
Modify: 2008-01-08 07:42:58.000000000 +0100
Change: 2008-01-08 07:42:58.000000000 +0100
Mount it again and change the content:
losetup /dev/loop0 test.img
mount /dev/loop0 mnt
touch mnt/test2
umount mnt
losetup -d /dev/loop0
ls mnt
See timestamps:
stat test.img
File: »test.img«
Size: 1474560 Blocks: 2888 IO Block: 4096 reguläre Datei
Device: 302h/770d Inode: 5473079 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2008-01-08 07:45:17.000000000 +0100
Modify: 2008-01-08 07:42:58.000000000 +0100
Change: 2008-01-08 07:42:58.000000000 +0100
****
As you can see, the modification time of the image file stays constant!
****************************
The result of this behavior is, that every backup program, which compares the
modification times of files to decide which file has to be stored again and
which not will NOT backup the image file although it has been changed!
****************************
Suggestions:
a) The loopback device driver should update the modification time of the image
file on every write access.
b) If this is too difficult, the modification time should be updated each time
an image file is been mounted with rw access rights.
Kind Regards
Matthias Faulstich
--- End Message ---