kurtdcobain
Posts: 24
Joined: Thu Jan 03, 2013 2:42 pm

[SOLVED] superblock last write time is in the future.

Fri Jun 13, 2014 4:00 pm

hello, every time I boot raspberry with raspbian I get this message "superblock last write time is in the future" with 1TB HDD ext4 and automatically starts fsck, so I updated to jessie hoping to solve the problem but nothing. I get same error!
I also connected the hdd to an ubuntu machine and it is recognized correctly. :x
Last edited by kurtdcobain on Tue Jun 17, 2014 8:09 pm, edited 1 time in total.

User avatar
joan
Posts: 14175
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: superblock last write time is in the future.

Fri Jun 13, 2014 4:05 pm

Have a look at the tune2fs command (man tune2fs). There may be something there to reset the times.

kurtdcobain
Posts: 24
Joined: Thu Jan 03, 2013 2:42 pm

Re: superblock last write time is in the future.

Fri Jun 13, 2014 6:45 pm

how? :D
the only thing I thought is to set pass = 0 in fstab

FM81
Posts: 518
Joined: Wed Apr 17, 2013 4:33 pm

Re: superblock last write time is in the future.

Sat Jun 14, 2014 12:43 am

Two things can come together here:
1. May be your linux-system use different system-times, for example UBUNTU is set to a local time-zone and RasPi uses UTC.
2. RasPi has no real-time-clock (*A), means if you mount you harddisk to early in startup-process (for example in '/etc/fstab'), and you have no network at this point (only chance for RasPi is to get time via NTP), you can also get this behaviour.
2.1. If your NTP works safe, you can try to disable "fake-hwclock", then the system will start with "point zero of unix-time 01.01.1970 0:00", which should be earlier than any access of your harddisk. :)

MfG, FM_81

(*A) I know, there exists add-on-boards, but I believe, that was not the question here!
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

User avatar
rpdom
Posts: 14976
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: superblock last write time is in the future.

Sat Jun 14, 2014 5:52 am

FM81 wrote: 1. May be your linux-system use different system-times, for example UBUNTU is set to a local time-zone and RasPi uses UTC.
It's unlikely to be this, as all Linux systems use UTC for their system clock, no matter what the hwclock and localtime are set to. Disk internals like the superblock are all set in UTC - unless they are FAT or possibly NTFS (I don't know much about the internals of NTFS) - but in this case it is ext4 and should be UTC.

It sounds a bit like the case of the disk being detected and mounted before ntpd has had a chance to update the Pi's system time. So the Pi will restart its clock from the value store in the fake-hwclock data file, and since the disk has been accessed on the Ubuntu system since then, it will appear to the Pi to be from the future.

Is the Pi connected to the internet and does it show the correct time?

FM81
Posts: 518
Joined: Wed Apr 17, 2013 4:33 pm

Re: superblock last write time is in the future.

Sat Jun 14, 2014 6:38 am

rpdom wrote:[It's unlikely to be this, as all Linux systems use UTC for their system clock, no matter what the hwclock and localtime are set to. ...
Sorry, thats not correct! My system shows all these values in "Localtime", not in UTC?
(May be UTC is recommended, but that was not the question.)

MfG, FM_81
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

User avatar
rpdom
Posts: 14976
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: superblock last write time is in the future.

Sat Jun 14, 2014 7:03 am

FM81 wrote:
rpdom wrote:[It's unlikely to be this, as all Linux systems use UTC for their system clock, no matter what the hwclock and localtime are set to. ...
Sorry, thats not correct! My system shows all these values in "Localtime", not in UTC?
(May be UTC is recommended, but that was not the question.)
It is correct, and of course your system shows them in local time. That's the point. They will show in local time for the timezone you have selected. Try

Code: Select all

TZ=UTC ls -l
and you will see times in UTC not localtime. If you examine the filesystem internals with hexdump or something, you will find all the dates/times are in UTC.

FM81
Posts: 518
Joined: Wed Apr 17, 2013 4:33 pm

Re: superblock last write time is in the future.

Sat Jun 14, 2014 7:43 am

May be we are going a little bit off topic ...
But do you mean the value, stored for example at offset 44 (0x2c) in the superblock?

MfG, FM_81
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

kurtdcobain
Posts: 24
Joined: Thu Jan 03, 2013 2:42 pm

Re: superblock last write time is in the future.

Sat Jun 14, 2014 10:23 am

hello folks! :D thank you all.

my raspberry is connected to the internet via a wifi dongle, hdd is always connected to raspberry,
I used ubuntu just to see if hdd was damaged.
Now I saw when it boots this line "Starting fake hwclock: system time loading jun 13 21:42:20 UTC 2014" instead now is jun 14 !!!!! :O
how can I fix this?
Have I a Raspberry-Delorean? Great Scott!!

EDIT: now at every boot hwclock is two hours before (UTC) the real clock (I'm on CEST).


kurtdcobain
Posts: 24
Joined: Thu Jan 03, 2013 2:42 pm

Re: [SOLVED] superblock last write time is in the future.

Tue Jun 17, 2014 8:13 pm

finally I have solved the problem thanks to another thread on this board!!!
http://www.raspberrypi.org/forums/viewt ... 4&p=492423

Code: Select all

"$ sudo nano /sbin/fake-hwclock"
See line 29 "date -u '+%Y-%m-%d %H:%M:%S' > $FILE"
I remove "-u" interpreted as Universal or UTC
My new line 29 "date '+%Y-%m-%d %H:%M:%S' > $FILE"
Then I eXited nano "Ctrl X" and "y" to save, and enter for same filename.

Tested by running "$ sudo fake-hwclock" 
and then "$ cat /etc/fake-hwclock.data"

:mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:

User avatar
paulwratt
Posts: 83
Joined: Fri Jun 12, 2015 12:15 am

Re: [SOLVED] superblock last write time is in the future.

Thu Jan 26, 2017 1:46 pm

FYI:

for anyone finding this topic, the following facts are true:

if u put ur Pi boot sd-card into a machine:
1) if it is recognised then
2) the super block gets updated with the current time of that machine
3) "/etc/fake-hwclock.data" does not get updated
4) the super block time gets touched on umount of drive partitions
5) fake-hwclock save force /media/{sd-card}/{ext4-partition}/etc/fake-hwclock.data
(a script that runs the above command before unmount ur Pi boot sd-card will often fix the issue)

if u put a "sub" (non-boot) drive into another machine:
1) if it is recognised then
2) the super block gets updated with the current time of that machine
3) on the Pi you can fix it by mounting it after boot, after the date has been updated on the Pi, then rebooting (for ur normal mount process)

I use the above processes to to work on bootable Pi sd-cards on the Pi itself with an sd-card reader or usb-micro-sd-card reader

"fake-hwclock" & "/etc/fake-hwclock.data" are only guarenteed on debian based OS's, so check ur OS and sd-card OS before hand, dont run it blindly

by allowing the above "fake-hwclock" command line to be written to the Pi boot sd-card right before it is unmounted, you will not get any "fsck" or roll-back issues (if the date is to far away from current), however u may still get a notice (if its more than a couple of seconds out). The Pi (Raspbian/Debian) loads the time from "/etc/fake-hwclock.data"

Paul

Return to “Troubleshooting”