Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Oct 2025 14:33:16 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        mike tancsa <mike@sentex.net>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: finding cause of reboot
Message-ID:  <CANCZdfoJzaGhpXKjPs4H6DiLd=_CLiWq%2Bs4z1mnParN5s1JhiQ@mail.gmail.com>
In-Reply-To: <00a760b4-fc94-4884-be98-167d77a08140@sentex.net>
References:  <aPD0ivyRrUUW-dkW@int21h> <CAOtMX2hWX63byYjKu7_EOjnDa3SvJ3PqOJLOL4cfVmxUFcP%2BYA@mail.gmail.com> <CANCZdfqN8BBr=EVE6QvHmvqofoTSqXHBBkio29ZQT-J2AJYHGg@mail.gmail.com> <569ccba4-3420-4741-925e-680fd1a1820d@sentex.net> <aPJr3YnOSdz5qC8Y@int21h> <00a760b4-fc94-4884-be98-167d77a08140@sentex.net>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Fri, Oct 17, 2025, 2:12 PM mike tancsa <mike@sentex.net> wrote:

> On 10/17/2025 12:16 PM, void wrote:
> > On Fri, Oct 17, 2025 at 09:56:29AM -0400, mike tancsa wrote:
> >> Not sure if it helps in this case or not, but If you capture smartctl
> >> info regularly, you can some times infer from the disk power cycle
> >> count and power on hours if the box rebooted due to a power issue or
> >> not.
> >
> > Good point.
> >
> > I'm unsure how I'd distinguish between soft power cycle
> > and reboot though. The latter i'd expect to increment power cycle
> > count the former might but it might not.
>
> In my case, I had it with a failing power supply or one that could not
> deal with load.  In my case showed power cycle counts increasing.  Where
> as, a shutdown -r now before
>
> 0{r-14mfitest}# smartctl -a /dev/ada0 | grep -i power
>                                          entering power-saving mode.
>    9 Power_On_Hours          0x0032   100   100   000    Old_age
>   Always       -       40206
>   12 Power_Cycle_Count       0x0032   100   100   000    Old_age
>   Always       -       91
> 0{r-14mfitest}#
>
> and after a reboot
>
> s0{r-14mfitest}# smartctl -a /dev/ada0 | grep -i power
>                                          entering power-saving mode.
>    9 Power_On_Hours          0x0032   100   100   000    Old_age
>   Always       -       40206
>   12 Power_Cycle_Count       0x0032   100   100   000    Old_age
>   Always       -       91
> 0{r-14mfitest}#
>
> At least on my SuperMicro board shows the same power cycle count.   Like
> you said, probably does not apply in your case, but sometimes handy to
> keep in the back pocket
>

You can also look at the unclean shutdown count in nvme drives...

nvmecontrol logpage -p2 nvme0

to catch power issues.

Warner

     ---Mike
>
>
>

[-- Attachment #2 --]
<div dir="auto"><div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Oct 17, 2025, 2:12 PM mike tancsa &lt;<a href="mailto:mike@sentex.net">mike@sentex.net</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/17/2025 12:16 PM, void wrote:<br>
&gt; On Fri, Oct 17, 2025 at 09:56:29AM -0400, mike tancsa wrote:<br>
&gt;&gt; Not sure if it helps in this case or not, but If you capture smartctl <br>
&gt;&gt; info regularly, you can some times infer from the disk power cycle <br>
&gt;&gt; count and power on hours if the box rebooted due to a power issue or <br>
&gt;&gt; not.<br>
&gt;<br>
&gt; Good point.<br>
&gt;<br>
&gt; I&#39;m unsure how I&#39;d distinguish between soft power cycle<br>
&gt; and reboot though. The latter i&#39;d expect to increment power cycle<br>
&gt; count the former might but it might not.<br>
<br>
In my case, I had it with a failing power supply or one that could not <br>
deal with load.  In my case showed power cycle counts increasing.  Where <br>
as, a shutdown -r now before<br>
<br>
0{r-14mfitest}# smartctl -a /dev/ada0 | grep -i power<br>
                                         entering power-saving mode.<br>
   9 Power_On_Hours          0x0032   100   100   000    Old_age <br>
  Always       -       40206<br>
  12 Power_Cycle_Count       0x0032   100   100   000    Old_age <br>
  Always       -       91<br>
0{r-14mfitest}#<br>
<br>
and after a reboot<br>
<br>
s0{r-14mfitest}# smartctl -a /dev/ada0 | grep -i power<br>
                                         entering power-saving mode.<br>
   9 Power_On_Hours          0x0032   100   100   000    Old_age <br>
  Always       -       40206<br>
  12 Power_Cycle_Count       0x0032   100   100   000    Old_age <br>
  Always       -       91<br>
0{r-14mfitest}#<br>
<br>
At least on my SuperMicro board shows the same power cycle count.   Like <br>
you said, probably does not apply in your case, but sometimes handy to <br>
keep in the back pocket<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">You can also look at the unclean shutdown count in nvme drives...</div><div dir="auto"><br></div><div dir="auto">nvmecontrol logpage -p2 nvme0</div><div dir="auto"><br></div><div dir="auto">to catch power issues.</div><div dir="auto"><br></div><div dir="auto">Warner</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
     ---Mike<br>
<br>
<br>
</blockquote></div></div></div>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoJzaGhpXKjPs4H6DiLd=_CLiWq%2Bs4z1mnParN5s1JhiQ>