Why does the cp command not preserve timestamps when copying to VFAT?

Found the answer here: "Preserving time: operation not permitted" on fat32 on debian - LinuxQuestions.org

Quick summary: if the VFAT partition was created by a specific user, then only that user and root can modify the metadata.

Workaround: use sudo or login as root to copy the files: sudo cp --preserve=timestamps somefile /thevfat/somedir

I used --preserve=timestamps to prevent error messages about permissions (which are not preserved at all on vfat) from appearing.


Written by Andrew Ittner in misc on Sun 13 August 2006. Tags: programming, technology