• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Can-o-Worms: Pi Shutdown vs Power Off

Scheduled Pinned Locked Moved
Duet Hardware and wiring
15
58
2.7k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    Danal
    last edited by 21 Apr 2020, 20:51

    I'm updating a SQLLITE3 database. Fairly simple structure... but... to your point, the DB engine is writing all over a file that the file systems just sees as a bunch of blocks. And those relationships can break.

    Just checked. DB Healthy.

    Delta / Kossel printer fanatic

    1 Reply Last reply Reply Quote 0
    • ?
      A Former User @Phaedrux
      last edited by 21 Apr 2020, 21:00

      @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

      Totally agree, and that's where the risk must be weighed. How much time will be wasted in the case of a failure? How can that time be mitigated with backups, etc?

      I'm not gonna name names, but I think most of us can think of a good handful that would struggle for weeks with such a scenario; which beggs the question why advocate something that is probably safe instead of implementing something that is safe? And accepting that the recommendation while we wait for a safe solution should be to safely shut down the system - anyone can ignore it at their own risk.

      1 Reply Last reply Reply Quote 0
      • undefined
        Phaedrux Moderator
        last edited by 21 Apr 2020, 21:06

        @bearer said in Can-o-Worms: Pi Shutdown vs Power Off:

        And accepting that the recommendation while we wait for a safe solution should be to safely shut down the system - anyone can ignore it at their own risk.

        Yes I totally get your point. A clean shutdown is the safest bet and best practice. But it's also good to know that if power is lost unexpectedly that it's not guaranteed catastrophe.

        Z-Bot CoreXY Build | Thingiverse Profile

        1 Reply Last reply Reply Quote 0
        • undefined
          gloomyandy
          last edited by 21 Apr 2020, 21:09

          @bearer If you are going to use a read only pi filesystem for the sbc, where are you going to upload gcode files to? Do you intend to use a 2nd disk (network share?) of some sort?

          ? undefined 2 Replies Last reply 21 Apr 2020, 21:11 Reply Quote 0
          • undefined
            gtj0 @Danal
            last edited by 21 Apr 2020, 21:10

            @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

            @gtj0 said in Can-o-Worms: Pi Shutdown vs Power Off:

            @Danal Out of curiosity, how much time elapses between the 12v cutout and the 5v dropping below the Pi's Vin minimum?

            I will see if there is a reasonable way to measure that. For example, if my dual channel scope will go slowly enough to trigger on the 12V and also draw a trace for the 5V.

            If you have any thoughts on how to measure...?

            Connect 12V to channel 1 and 5v to channel 2. Set the scope it to trigger on channel 1 falling edge.

            undefined 1 Reply Last reply 21 Apr 2020, 21:33 Reply Quote 0
            • ?
              A Former User @gloomyandy
              last edited by 21 Apr 2020, 21:11

              @gloomyandy said in Can-o-Worms: Pi Shutdown vs Power Off:

              @bearer If you are going to use a read only pi filesystem for the sbc, where are you going to upload gcode files to? Do you intend to use a 2nd disk (network share?) of some sort?

              you get an overlay which is read/write worst case you loose your uploaded files and the os and config remain intact.

              1 Reply Last reply Reply Quote 0
              • undefined
                gtj0 @gloomyandy
                last edited by 21 Apr 2020, 21:11

                @gloomyandy said in Can-o-Worms: Pi Shutdown vs Power Off:

                @bearer If you are going to use a read only pi filesystem for the sbc, where are you going to upload gcode files to? Do you intend to use a 2nd disk (network share?) of some sort?

                You could create a partition just for gcode files that's writable and leave the rootfs read only.

                1 Reply Last reply Reply Quote 0
                • undefined
                  DanS79
                  last edited by 21 Apr 2020, 21:22

                  The only time I've really seen corruption happen is when you loose power in the middle of a high I/O event. Unless your using a PI to build a NAS that you plan on hammering on, you will probably never see a corruption event.

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    Danal @gtj0
                    last edited by 21 Apr 2020, 21:33

                    @gtj0 said in Can-o-Worms: Pi Shutdown vs Power Off:

                    Connect 12V to channel 1 and 5v to channel 2. Set the scope it to trigger on channel 1 falling edge.

                    Roughly what I was thinking. What voltage do we consider, as the 5V decays, to be the limit?

                    Delta / Kossel printer fanatic

                    undefined 1 Reply Last reply 21 Apr 2020, 21:58 Reply Quote 0
                    • undefined
                      Danal @Phaedrux
                      last edited by 21 Apr 2020, 21:38

                      @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                      Worst case scenario for a Pi would be maybe replacing the SD card AND the pi itself.

                      Huh? What mechanism increases or decreases the odds of damage to a Pi (not the SD, the Pi) if it is powered off before or after a Raspbian shutdown command?

                      Delta / Kossel printer fanatic

                      undefined 1 Reply Last reply 21 Apr 2020, 21:40 Reply Quote 0
                      • undefined
                        Phaedrux Moderator @Danal
                        last edited by 21 Apr 2020, 21:40

                        @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                        Huh? What mechanism increases or decreases the odds of damage to a Pi (not the SD, the Pi) if it is powered off before or after a Raspbian shutdown command?

                        Exactly. But I just chose that as an absolute worst case total loss situation on one side of the balance.

                        Z-Bot CoreXY Build | Thingiverse Profile

                        undefined 1 Reply Last reply 21 Apr 2020, 21:42 Reply Quote 0
                        • undefined
                          Danal @Phaedrux
                          last edited by 21 Apr 2020, 21:40

                          @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                          Totally agree, and that's where the risk must be weighed. How much time will be wasted in the case of a failure? How can that time be mitigated with backups, etc?

                          Obviously varies by user and Pi. If for some reason I thought a given Pi would take more than an hour or so to rebuild its SD, I'd do something. I'd be much more likely to schedule a backup than to worry about shutdown. SDs fail. Whether shutdown or not.

                          Delta / Kossel printer fanatic

                          undefined 1 Reply Last reply 21 Apr 2020, 21:42 Reply Quote 0
                          • undefined
                            Phaedrux Moderator @Danal
                            last edited by 21 Apr 2020, 21:42

                            @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                            SDs fail. Whether shutdown or not.

                            And power loss can happen even with a UPS. (accidentally unplugging it, battery dying, etc)

                            Z-Bot CoreXY Build | Thingiverse Profile

                            1 Reply Last reply Reply Quote 1
                            • undefined
                              Danal @Phaedrux
                              last edited by 21 Apr 2020, 21:42

                              @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                              @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                              Huh? What mechanism increases or decreases the odds of damage to a Pi (not the SD, the Pi) if it is powered off before or after a Raspbian shutdown command?

                              Exactly. But I just chose that as an absolute worst case total loss situation on one side of the balance.

                              Huh again?

                              It seems we just agreed there is absolutely zero change in the odds of losing or not losing the hardware with shutdown or no shutdown. Therefore, hardware loss events do not enter into this discussion.

                              Yes? No?

                              Delta / Kossel printer fanatic

                              undefined 2 Replies Last reply 21 Apr 2020, 21:47 Reply Quote 0
                              • undefined
                                Phaedrux Moderator @Danal
                                last edited by 21 Apr 2020, 21:47

                                @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                                @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                                @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                                Huh? What mechanism increases or decreases the odds of damage to a Pi (not the SD, the Pi) if it is powered off before or after a Raspbian shutdown command?

                                Exactly. But I just chose that as an absolute worst case total loss situation on one side of the balance.

                                Huh again?

                                It seems we just agreed there is absolutely zero change in the odds of losing or not losing the hardware with shutdown or no shutdown. Therefore, hardware loss events do not enter into this discussion.

                                Yes? No?

                                All I was saying that even if the worst case was a total write off of your SD card and Pi it's ~50$ for the sake of argument. If something cost you 50$ and an hour of your time, how much effort would you be willing to put into mitigating it. It's just a thought experiment.

                                Z-Bot CoreXY Build | Thingiverse Profile

                                1 Reply Last reply Reply Quote 0
                                • undefined
                                  ChrisP
                                  last edited by 21 Apr 2020, 21:51

                                  I guess in the context of using a Pi or similar as the SBC on a Duet3, it's pretty rare that anything is going to be written to the filesystem that's of any significance. Aside from doing a software update or uploading a gcode file, typical usage is pretty much just going to be read operations which aren't going to care about getting interrupted anyway.
                                  The test is still really interesting to know how unlikely a failure is. I imagine that the more likely failure more will be due to SD dying due to swap spaces and temporary files being written... but that's a whole separate topic.

                                  While I'd always prefer to do a 'proper' shutdown, I've never felt the need on a Pi, and your test seems to have confirmed that. Though if there was an easy option to do so on the DWC, I'd likely use it.

                                  1 Reply Last reply Reply Quote 0
                                  • undefined
                                    Phaedrux Moderator @Danal
                                    last edited by 21 Apr 2020, 21:51

                                    @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                                    Therefore, hardware loss events do not enter into this discussion.

                                    Is this the can o worms phase of the discussion? I think I'll bow out now. 😉

                                    Z-Bot CoreXY Build | Thingiverse Profile

                                    undefined 1 Reply Last reply 21 Apr 2020, 21:52 Reply Quote 0
                                    • undefined
                                      Danal @Phaedrux
                                      last edited by Danal 21 Apr 2020, 21:52

                                      @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                                      total write off of your SD card and Pi

                                      I get the time 'cost' and completely agree with you. I don't get the "and Pi" part.

                                      Delta / Kossel printer fanatic

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        gtj0 @Danal
                                        last edited by 21 Apr 2020, 21:58

                                        @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                                        @gtj0 said in Can-o-Worms: Pi Shutdown vs Power Off:

                                        Connect 12V to channel 1 and 5v to channel 2. Set the scope it to trigger on channel 1 falling edge.

                                        Roughly what I was thinking. What voltage do we consider, as the 5V decays, to be the limit?

                                        I've seen 4.8 and 4.75 as the lower limit. Does your scope allow a screen capture? See if you can just capture the slope.

                                        undefined 1 Reply Last reply 21 Apr 2020, 22:17 Reply Quote 0
                                        • undefined
                                          chas2706
                                          last edited by 21 Apr 2020, 22:05

                                          The only time I get issues with corrupt sd cards on raspberry pi is when I attempt to upgrade RRF using sudo apt-get update, sudo apt-get upgrade.
                                          (They not actually corrupt, it just doesnt end in success)

                                          Turning power off without shutting down pi causes less problems maybe.

                                          1 Reply Last reply Reply Quote 0
                                          35 out of 58
                                          • First post
                                            35/58
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA