LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-02-2013, 06:29 PM   #1
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
Last Boot Time


Why does the last boot time differ in each output below? For example: uptime and "who -b" do not sound in sync.

Code:
$ date
Mon Dec  2 19:25:29 EST 2013


$ uptime
 19:25:03 up 20 days,  4:41,  3 users,  load average: 0.10, 0.08, 0.02

$ who -b
         system boot  2013-11-12 14:43

$ last boot

wtmp begins Fri Sep  7 14:12:08 2012

$ last | grep boot
reboot   system boot  2.6.32-279.el6.x Tue Nov 12 14:43 - 19:25 (20+04:41)
reboot   system boot  2.6.32-279.el6.x Tue Nov 12 14:30 - 14:40  (00:10)
reboot   system boot  2.6.32-279.el6.x Tue Nov 12 14:15 - 14:27  (00:12)
reboot   system boot  2.6.32-279.el6.x Wed May 22 17:04 - 14:12 (173+22:07)
reboot   system boot  2.6.32-279.el6.x Mon Jan 28 14:44 - 17:00 (114+01:16)


Also... how do we figure out if the system has been warm (soft) rebooted or cold (hard) rebooted?

Last edited by devUnix; 12-02-2013 at 06:34 PM.
 
Old 12-02-2013, 06:56 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
These seem to match up perfectly:
Quote:
Originally Posted by devUnix View Post
Code:
$ date
Mon Dec  2 19:25:29 EST 2013


$ uptime
 19:25:03 up 20 days,  4:41,  3 users,  load average: 0.10, 0.08, 0.02

$ who -b
         system boot  2013-11-12 14:43
Subtracting 20 days and 4:41 as reported by uptime from the current date/time (Dec 2 19:25) gives you Nov 12 14:44, and the one minute difference between that and who -b is probably just due to the seconds getting truncated or rounded.

Quote:
Originally Posted by devUnix View Post
Code:
$ last boot

wtmp begins Fri Sep  7 14:12:08 2012

$ last | grep boot
reboot   system boot  2.6.32-279.el6.x Tue Nov 12 14:43 - 19:25 (20+04:41)
reboot   system boot  2.6.32-279.el6.x Tue Nov 12 14:30 - 14:40  (00:10)
reboot   system boot  2.6.32-279.el6.x Tue Nov 12 14:15 - 14:27  (00:12)
reboot   system boot  2.6.32-279.el6.x Wed May 22 17:04 - 14:12 (173+22:07)
reboot   system boot  2.6.32-279.el6.x Mon Jan 28 14:44 - 17:00 (114+01:16)
The top entry seems to match uptime/who -b.

The start of wtmp does not match the system boot time on any of my systems either. Should it? I have one starting back in June 2010 when the system in question was first installed. FWIW, last | grep boot returns nothing on one of my systems, even though that system has surely been rebooted a number of times.
Quote:
Originally Posted by devUnix View Post
Also... how do we figure out if the system has been warm (soft) rebooted or cold (hard) rebooted?
A hard reboot due to power failure, system lockup or a kernel panic will leave no trace of a shutdown event in the logs. If you see log entries indicating the system has booted without entries for a corresponding shutdown immediately preceding them, there's been a crash of some kind.

Last edited by Ser Olmy; 12-02-2013 at 06:59 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ntpdate not syncing time at boot time--centOS 5.5 Muhammad Hamid Ashraf Linux - Newbie 1 02-26-2013 05:54 AM
UDEV takes more time to execute at boot up time.Can anyboby help me to reduce dis tim pabansal Linux - General 3 09-30-2011 06:45 AM
Start X server and app at boot time (or services load) time. scmbg Linux - General 5 10-15-2009 10:34 PM
Time format in boot-time messages jonr Linux - Kernel 1 12-22-2006 12:31 PM
kernel compile time and boot time lordofring Programming 1 11-13-2005 02:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration