[SOLVED] System sets wrong values for time at boot and to hwclock during shutdown.
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
System sets wrong values for time at boot and to hwclock during shutdown.
Booting from a correct time value set in the BIOS the system gets the correct time via "rtc_cmos" as shown by "dmesg". "date" and the KDE clock show only minutes later a jump of usually (but not always) about six hours. Shutting down the machine writes "saving system time to hardware clock" (or a message of this gist). The BIOS then can have values of plus or minus(!) several hours around the true time. If I don't correct it, the next jump into the future will be larger.
I renamed "/etc/adjtime".
The specs of my homebuilt machine: Gigabyte GA-890GPA-UD3H (with integrated Radeon HD 4290), Phenom II X6, Seagate ST31000520AS (1 TB), Sapphire ATI Radeon HD5450.
At first I believed this to be boot-related only. Then I thought it is hardware. Now I know it is software: I booted openSuSE 11.2 without any problems on the same machine in a dual boot where openSuSE 11.3 stumbles: must be software in 11.3.
Any suggestions of what I should do? What governs the system timer? Can it be configured? I can do a "hwclock --hctosys" from a script / cron but that is just fighting symptoms. Same with a re-install (Windows anybody? ) since at first this didn't happen. But I'd like to understand this.
Can it be related to the dynamic frequency adjustments ("Turbo Core") of the Phenom CPUs? If so, what to do?
It's odd that you didn't see the problem with Suse 11.2, but you do see it with 11.3. So, I guess there is some timing issue with 11.3, but I'm not seeing it on my system. I use Intel CPUs, so it may be a problem with your combination.
You could set up ntpd to adjust the time frequently. A simple matter to do, but it isn't telling you anything about WHY the problem exists. You might try searching, or submitting, a bug report. http://en.opensuse.org/Bugs
Most OSes use UTC (the one and only universal and coordinate) on hardware, and it convert to local time when needed, windows uses local time (meaning that windows still suffers jet-lag and from that you get ugly interactions, you have some options here:
*make windows use UTC http://weblogs.asp.net/dfindley/arch...Pro_2900_.aspx
*make linux use localtime (this depends on how your distribution launches hwclock to set the system time from the hardware clock)
on suse you should be able to set that up with yast (I'm just guessing)
Quote:
Can it be related to the dynamic frequency adjustments ("Turbo Core") of the Phenom CPUs? If so, what to do?
Not a matter of hours, more like a few minutes a week, but if it happens it's probably a hardware malfunction. When I had that i did set up a NTPD. It can learn about this systematic error after a while.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by udaman
Wonderful, you've discovered time travel....
Hah, now you crack jokes after fiddling with the knobs in your menuconfig prior to bake an arcane version of a kernel which can even reach into the future. I suspect it changes time settings all over the multiverse, I just can't prove it .
Quote:
Originally Posted by udaman
...but I'm not seeing it on my system. I use Intel CPUs, so it may be a problem with your combination.
And this is the answer for the question I would have asked next. Now I think it is your uncanny temporal abilities which stained the poor kernel during its creation .
Quote:
Originally Posted by udaman
...You could set up ntpd to adjust the time frequently. A simple matter to do, but it isn't telling you anything about WHY the problem exists. You might try searching, or submitting, a bug report. http://en.opensuse.org/Bugs...
Exactly. I want to know the workings of this thing. Okay, it might still be out of my reach (this time. I don't forget something like this and will keep my eyes open).
If I understood correctly you produced a custom kernel with your own modifications of the configuration. SuSE will most probably decline to accept this as their bug (if bug it is). No, the easiest way out is to install their kernel-desktop from the Novell repository (keeping yours as well) -- which I can do anytime I need to, thanks to your gracious gift of copies of your kernel and initrd .
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by fbianconi
look in here:..
Thanks for these hints, fbianconi, but I don't have any Windows on my box , I dual boot with linux (and FreeBSD). The hardware clock is set to UTC.
Quote:
Originally Posted by fbianconi
...{Turbo-Core}...Not a matter of hours, more like a few minutes a week, but if it happens it's probably a hardware malfunction. When I had that i did set up a NTPD. It can learn about this systematic error after a while.
How so "a few minutes a week" when the frequency jumps from 2.8 GHz to 3.2 GHz? I'd have guessed at a ~10 % difference it would be more.
I could of course use ntpd. Problem is, the error is not systematic, that's why I wrote the time jumps: It really gains and loses in steps, not as a smooth function. And since this error does not occur with SuSE 11.2_32 on the same machine it must be caused by 11.3_64 since the hardware didn't change.
If I understood correctly you produced a custom kernel with your own modifications of the configuration. SuSE will most probably decline to accept this as their bug (if bug it is). No, the easiest way out is to install their kernel-desktop from the Novell repository (keeping yours as well) -- which I can do anytime I need to, thanks to your gracious gift of copies of your kernel and initrd .
Got ya!! No, the kernel I mailed you is the stock kernel from Suse. The initrd I sent was built for my system, based on the kernel. You could easily build your own initrd and replace the one I sent. In fact, you should do so, and see if THAT solves your time traveling issue.
You're over thinking this. It's not as complex as you suggest.
Code:
cd /boot
mkinitrd -c -k 2.6.33.4 -m ext4 -o initrd-huge-2.6.33.4.gz
Those are the exact commands I used when I made mine.
You should rename your current initrd, or save it to another location, the command above will overwrite it. Change the ext4 in my command to meet your file system. If you choose another name for the new initrd, than don't forget to change it in menu.lst and re-run grub.
This should be all you need to do for initrd. Let me know.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by udaman
...I'll check back later this evening...
Good morning udaman . You'll see from the time stamps I'll post below <edit> no, you won't, "ls -la" left out the timestamp </edit>, that you probably came back when I was fast asleep -- you know, all these time lags .
First things first: SUCCESS
Now, I didn't really believe in this and I actually didn't dare to substitute my newly created initrd for some time, since my wife needed the computer and I was not sure I wanted to do repairs late in the evening with her hovering angrily in the background. All unnecessary. Worked like a charm .
For anyone trying this, udaman's "-c" was unknown to my system and it also needed "-i" instead of "-o". After that all was well. I didn't even need the sources.
As you can see the new initrd is about 4 MB larger than what you sent me. Can you recall what modules you left out? I'd dearly love to know, since there are even more funny effects besides "temporal jumping", e.g. the very unobtrusive background picture behind the messages during boot and shutdown are back...
All in all an instructive episode even if I still don't grasp the details of the systems workings.
I do deeply appreciate your help and support, udaman. Thank you and all the best at all times .
Well, it's just before 9am here in New England, and I'm still shaking the sleep from my eyes. Yes, retirement is wonderful, in that I can stay up late and get up late.
Glad for you JZL! It's a real feeling of accomplishment when we try something new and scarey, and it is a success.
After reading your report, and seeing the differences in the command, I realized I wasn't making the initrd for my Suse system, but for my Slackware system. I do apologize for any confusion I cause you, but I see you handled things just fine.
Now let's see if that clears up your timing issue.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by udaman
Well, it's just before 9am here in New England, and I'm still shaking the sleep from my eyes. Yes, retirement is wonderful, in that I can stay up late and get up late.
That's what I dream of on a daily basis.
Quote:
Originally Posted by udaman
...Now let's see if that clears up your timing issue.
It did. At least a brief test yesterday night (my night ) showed no more confusion in the time values. I'd rate the probability of a relapse quite low. Be sure that I'll be back if it is not so .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.