Missing creation dates on files

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
ZoW7iV8
Level 1
Level 1
Posts: 12
Joined: Fri Jun 12, 2020 9:52 pm

Missing creation dates on files

Post by ZoW7iV8 »

Sometime between February 19 and today, "something" has wiped the creation file stamps on all my document files. Modified dates are still there. And directories still have creation dates. When I open a markdown file in a text editor, for example, it will show the correct modification date, and the creation date as: 1969-12-31 19:00. I've searched enough to understand that this is Unix Epoch time. I am unsure what my next step should be.
User avatar
Kadaitcha Man
Level 13
Level 13
Posts: 4871
Joined: Mon Aug 27, 2012 10:17 pm

Re: Missing creation dates on files

Post by Kadaitcha Man »

ZoW7iV8 wrote:
Tue Feb 23, 2021 1:58 am
I am unsure what my next step should be.
Make a backup, immediately.
All kadaitcha men are liars

(It's pronounced kad-eye-cha, not kada-itcha)
ZoW7iV8
Level 1
Level 1
Posts: 12
Joined: Fri Jun 12, 2020 9:52 pm

Re: Missing creation dates on files

Post by ZoW7iV8 »

I have backups of all my data. I notice they too do not have file creation dates. I also have a Timeshift from 10 days ago. Each new file I create now also does not have a creation date. Should I restore from Timeshift, or is my hard drive failing? Can I troubleshoot? How? Would greatly appreciate some guidance what my next step should be.
t42
Level 5
Level 5
Posts: 713
Joined: Mon Jan 20, 2014 6:48 pm

Re: Missing creation dates on files

Post by t42 »

The file creation time in Ext4 is not directly accessible.
It's called 'Birth time' by stat command.
If you use stat command on ext4 the Birth field is - :

Code: Select all

stat 1.deb

  File: 1.deb
  Size: 264188    	Blocks: 520        IO Block: 4096   regular file
Device: 34h/52d	Inode: 2           Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/       v)   Gid: ( 1000/       v)
Access: 2021-02-23 13:03:50.546404805 +0200
Modify: 2021-02-23 13:03:50.566405061 +0200
Change: 2021-02-23 14:39:23.989398374 +0200
Birth: -
If you really need it you can get the creation time via debugfs:

Code: Select all

debugfs -R 'stat <inode_number>' DEVICE
for eg

Code: Select all

stat -c %i 1.deb
1440491
sudo debugfs -R 'stat <1440491>' /dev/sda3
output:

Code: Select all

Inode: 1440491   Type: regular    Mode:  0664   Flags: 0x80000
Generation: 1845404516    Version: 0x00000000:00000001
User:  1000   Group:  1000   Project:     0   Size: 264188
File ACL: 0
Links: 1   Blockcount: 520
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x6034fb75:e918548c -- Tue Feb 23 14:56:21 2021
 atime: 0x6034e116:00000000 -- Tue Feb 23 13:03:50 2021
 mtime: 0x6034e116:00000000 -- Tue Feb 23 13:03:50 2021
crtime: 0x6034fb75:e918548c -- Tue Feb 23 14:56:21 2021
Size of extra inode fields: 32
Inode checksum: 0x921784b6
EXTENTS:
(0-64):5997855-5997919
Last edited by t42 on Tue Feb 23, 2021 8:59 am, edited 1 time in total.
-=t42=-
Hoser Rob
Level 17
Level 17
Posts: 7225
Joined: Sat Dec 15, 2012 8:57 am

Re: Missing creation dates on files

Post by Hoser Rob »

You may be surprised to find out that Linux doesn't store file creation times. I certainly was. It's supported in the ext4 file system but not in the kernel APIs. So it doesn't get stored.
t42
Level 5
Level 5
Posts: 713
Joined: Mon Jan 20, 2014 6:48 pm

Re: Missing creation dates on files

Post by t42 »

Hoser Rob wrote:
Tue Feb 23, 2021 8:56 am
It's supported in the ext4 file system but not in the kernel APIs.
That's true only till the dot. So I expanded my answer above a minute later after your comment.
-=t42=-
ZoW7iV8
Level 1
Level 1
Posts: 12
Joined: Fri Jun 12, 2020 9:52 pm

Re: Missing creation dates on files

Post by ZoW7iV8 »

Hoser Rob wrote:
Tue Feb 23, 2021 8:56 am
You may be surprised to find out that Linux doesn't store file creation times. I certainly was. It's supported in the ext4 file system but not in the kernel APIs. So it doesn't get stored.
Wow. Really. Then how is the column "Date Created" in Nemo displayed?
ZoW7iV8
Level 1
Level 1
Posts: 12
Joined: Fri Jun 12, 2020 9:52 pm

Re: Missing creation dates on files

Post by ZoW7iV8 »

t42 wrote:
Tue Feb 23, 2021 8:51 am
The file creation time in Ext4 is not directly accessible.
It's called 'Birth time' by stat command.
If you use stat command on ext4 the Birth field is - :
... stat command stuff..
- deleted - please see better response below.
Last edited by ZoW7iV8 on Tue Feb 23, 2021 4:15 pm, edited 1 time in total.
t42
Level 5
Level 5
Posts: 713
Joined: Mon Jan 20, 2014 6:48 pm

Re: Missing creation dates on files

Post by t42 »

ZoW7iV8 wrote:
Tue Feb 23, 2021 9:30 am
Wow. Really. Then how is the column "Date Created" in Nemo displayed?
Nemo shows in the field Date Created the ctime - the last time when the attributes of a file were changed. Maybe it would be relevant for you to concentrate on the Date Modified filed of Nemo - just guessing. If I remember correctly there was a post this month similar to yours where the problem was comprehensively discussed, including terminology. You can try to search for that post.
-=t42=-
Post Reply

Return to “Newbie Questions”