0

I am doing research on Ext4 and I believe I understand the fundamentals of Ext4.

Ext4 stores timestamps. In my assignment, I have proposed to analyse the timestamp of Ext4 MANUALLY instead of typing the command (e.g. date -d @2220775699).

Is there a way to do so?

In addition, why does the timestamp different from the timestamp in the journaling?

Can anyone explain this to me?

4
  • 1
    Isn't it just a normal Unix timestamp? Aug 7, 2013 at 18:23
  • I believe so? I'm analysing it in Ubuntu.
    – stupidgal
    Aug 7, 2013 at 18:53
  • What do you mean by "manually"? To me, that means "by hand" which seems to be exactly what you are trying to avoid.
    – paddy
    Aug 8, 2013 at 3:31
  • @AlexeiAverchenko: The date command is a standard Unix timestamp, but the Ext4 timestamp isn't. Ext4 supports fractional seconds.
    – MSalters
    Aug 8, 2013 at 8:42

2 Answers 2

0

If you want to translate timestamps to human-friendly description of date and time, then obviously there is a way to do it.

The functions localtime and gmtime are made specifically for this purpose; in glibc, they are implemented in terms of a function __tz_convert, which is implemented in a file tzset.c. You'll probably need to review other functions it uses, though, I haven't studied all of it - GNU source is never easy to read.

UPD: __tz_convert uses __offtime internally.

0

Yes, this is possible:

debugfs -R `stat /file/to/check\` /dev/hdX

I'm not sure which two timestamps you're comparing, so I can't explain the difference. (I.e. if you ask a question about a difference, at least tell us between which two things!)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .