Is there a way to copy of the contents of a hard disk and preserve file creation and modification dates and times?
I don't think dd would work as it does a raw read/write.
Is there a way to copy of the contents of a hard disk and preserve file creation and modification dates and times?
I don't think dd would work as it does a raw read/write.
dd uses direct bit for bit copying, and the disk can be treated as one file so no modification is made to the contents. It will certainly work though if it's not a hard disk image, and you just want to preserve file metadata you can use tar. Tar is pretty much the standard archiving tool in all unix systems and will preserve all modification dates.
Thanks for the reply.
Supposing I were doing this for an NTFS Windows partition, could I tar the whole entire filesystem like this and restore it without a problem? I think tar does not preserve permissions though.