Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, Is there any way, to find out how many time my system has been rebooted till now....
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    32

    to find how many times my pc has been rebooted

    Hi,

    Is there any way, to find out how many time my system has been rebooted till now.

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    I'm not sure about any specific commands.
    Hint: check your /var/log/messages . (and also any archived messages file) using grep to extract info. "Freeing initrd memory" or some other unique booting message and count it.
    Mostly likely that will give you the answer.

    HTH
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  3. #3
    Just Joined!
    Join Date
    Mar 2007
    Posts
    32
    Hi,

    During the mean time, I did a search and find out with the command tune2fs, with the option as -l

    #tune2fs -l /dev/hda4

    Note: /dev/hda4 may be any partition, but / partition is fine to go with .

    Result:

    Mount count: 4

    I am not sure, whether is could be the exact one, but this is also one way to find out.

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    Solution from ext3-user mail list;
    mount count value will reset back to 0 when it reaches maximum mount count,set for automatic
    execution of e2fsck .
    so use the last command,
    last reboot
    HTH
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  5. #5
    Linux Newbie
    Join Date
    Sep 2004
    Location
    UK
    Posts
    160
    This might help, probably won't:

    smartctl --all /dev/sda

    It gives Power_Cycle_Count and Start_Stop_Count for the harddisk, which IF the system only runs Linux and the disk was installed when you installed linux should give a reasonaly accurate idea on number of soft-reboots and hard (power cycle reboots)

    on mine I get (the systems only ever run linux and was a new build):

    4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 354
    12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 356

    Other than that can't think of anything else.
    In a world without walls and fences, who needs Windows and Gates?

  6. #6
    Just Joined!
    Join Date
    Nov 2008
    Location
    Virginia, USA
    Posts
    18
    Quote Originally Posted by blinky View Post
    This might help, probably won't:

    smartctl --all /dev/sda
    You're dead on. I was about to say the same thing! Just check the power on count. Of course if smart monitoring was disabled on the drive then I guess it might not work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...