Cloning a container does not respect Linux Access Time

Feb 27, 2020
48
3
28
52
Hi there
I have a LXC container which uses last access time to implement sort of LRU image cache; images not accessed in X days are automatically deleted.
I have cloned the container, moved into another PMX node, shutdown the original one, and start the cloned container in the PMX, but the automated deletion is not happening.

After some checks, i have found out all the files inside the cloned container are dated (last access date) as the cloned date. I was expecting somehow all the dates to be preserved exactly as the original container.

Is this the right/expected behavior on cloning?
 
hi,

Is this the right/expected behavior on cloning?
yeah it's basically putting the rootfs of the container in a tar archive, so probably the files are getting accessed during that.

can't really think of an easy way to get around it, but you can try experimenting with the 'noatime' mount option (in mountpoint settings), and putting the images there before cloning. just an idea and i haven't tried this