0

Both ntfs and btrfs support file creation times. When I copy a file however, only the modification time is preserved.

Is there a way to preserve creation times too?

For context I wish to migrate my entire partition from ntfs to btrfs, and it would be nice to preserve the creation times.

PS.

When I move a file from btrfs to btrfs itself all the dates are the same, which is what I would like to do for ntfs to btrfs as well. The dates here include the access, modify, create dates on btrfs.

  • Did you tried cp -p? See superuser.com/a/114198. – Anton Leontiev May 28 at 12:01
  • @AntonLeontiev Yes I did, the creation times is set to the current time when I use that. Only the access & modify times are copied correctly. – simonzack May 28 at 12:05
  • since creation time timestamps aren't standard, you'll probably have to code up a custom tool that reads the creation time on the source filesystem, copies the file, and then sets the creation time on the destination filesystem. ctime, which you see with stat, is not "creation time", it is "change time", and it refers to file metadata. if you chown or chmod a file, for example, that will update the ctime timestamp. – Tim Kennedy May 28 at 13:25
  • @TimKennedy Yes that would be my last resort. I know ctime is change time, but on btrfs has support of actual creation time, stored as otime. It would be great if there were some tools to ease the job instead of coding something from scratch. – simonzack May 28 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.