Is there a risk of data corruption if suspended laptop runs out of battery?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








11















I often tend to just put my laptop on suspend using xfce4-power-manager, and although usually the battery is sufficiently charged up until the next time (when I plug in the charger), sometimes I forget and after a week or so the battery empties out and the laptop shuts itself down (forcefully).



In these cases, is there any risk of data corruption? I would assume that no, since the hard-drive has already synced and was turned off upon suspend.



Additionally, should one prefer suspend, hibernate or some hybrid variant?










share|improve this question






























    11















    I often tend to just put my laptop on suspend using xfce4-power-manager, and although usually the battery is sufficiently charged up until the next time (when I plug in the charger), sometimes I forget and after a week or so the battery empties out and the laptop shuts itself down (forcefully).



    In these cases, is there any risk of data corruption? I would assume that no, since the hard-drive has already synced and was turned off upon suspend.



    Additionally, should one prefer suspend, hibernate or some hybrid variant?










    share|improve this question


























      11












      11








      11


      1






      I often tend to just put my laptop on suspend using xfce4-power-manager, and although usually the battery is sufficiently charged up until the next time (when I plug in the charger), sometimes I forget and after a week or so the battery empties out and the laptop shuts itself down (forcefully).



      In these cases, is there any risk of data corruption? I would assume that no, since the hard-drive has already synced and was turned off upon suspend.



      Additionally, should one prefer suspend, hibernate or some hybrid variant?










      share|improve this question
















      I often tend to just put my laptop on suspend using xfce4-power-manager, and although usually the battery is sufficiently charged up until the next time (when I plug in the charger), sometimes I forget and after a week or so the battery empties out and the laptop shuts itself down (forcefully).



      In these cases, is there any risk of data corruption? I would assume that no, since the hard-drive has already synced and was turned off upon suspend.



      Additionally, should one prefer suspend, hibernate or some hybrid variant?







      hard-disk suspend corruption battery






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 18 at 3:21









      Rui F Ribeiro

      42.1k1484142




      42.1k1484142










      asked Feb 15 '14 at 23:18









      landronilandroni

      3,38582339




      3,38582339




















          3 Answers
          3






          active

          oldest

          votes


















          8














          Suspending implies that the data you were working with is in the memory. This state will be lost if you run out of power. If you were writing a forum post, for example, it will be lost, but nothing more serious would happen. Think that it's less serious than unplugging and removing the battery, since the computer can sync before and even delay the suspension (when running an update or upgrade).



          For obtaining both the benefits of suspend (fast re-start) and hibernate (safely saved to disk, without power consumption) try pm-suspend-hybrid instead. If you run out of power you can re-start from the image saved to disk, if you don't run out of power you can quickly re-start from a suspended to memory state.






          share|improve this answer


















          • 1





            "but nothing more serious would happen." Just to be clear, this means that no corruption of hard-drive sectors can occur? In other words, you would lose anything that you didn't already save to disk (as expected), but anything that resides on the disk is safe and sound. Correct?

            – landroni
            Feb 16 '14 at 13:44






          • 1





            @landroni: right.

            – Quora Feans
            Feb 16 '14 at 17:05


















          2














          There are two things to think about here, as hinted at by other answers.



          The first is File System Corruption. This relates to the meta-data structures that makes the file system usable, and is understood and controlled by the Kernel.



          The second is the content of the files. When the content of a file is corrupted, the kernel will not know (or care). Complex systems like databases implement their own meta-data facilities to take care of this problem, but for most file types on a typical desktop system there is no such thing.



          If you are editing a file, a "change" to the file might consist of writes to several locations. When all of these writes have been completed, the file is in a consistent state, but when only some of these writes are completed the file contents may be corrupted (inconsistent)



          The operating system will (should) "group" related writes into a transaction. So, for example when a file grows, the data must be written to the blocks belonging to that file, and the file system structures be updated to allocate those new blocks to the file, and possible changes to the directory entry (eg last modification time) be updated, all as a single group. Once all of this is Sync'ed (flushed) to disk, the file system will be consistent again, but the file contents may not be until all the relevant writes have been submitted by the application and flushed to disk by the operating system.



          If the application is in the middle of a complicated change and gets blocked before all the transactions have been issued, for example you press SAVE and immediately close your laptop lid, the entire group of changes may not all make it to the kernel's write queues.



          Generally whatever is in the write queues will be flushed to disk. The file systems should, generally, be consistent. Due to File system journals though this might mean that some of those changes are temporarily in a log, albeit safely on disk.



          File contents however is another story.






          share|improve this answer






























            1














            Data corruption? Most likely no. Data loss? possibly.



            The data that would be at risk when the system loses power during a suspend would be the only things at risk. This data is the "snapshot" of the system's memory that's been temporarily written to disk when you put the system into "suspend" mode. No harm should ever come to your HDD or the data that's present on the HDD.



            The data on your system should be safe so long as you've selected that the system "poweroff" if the battery gets into a "critically low" state, as seen in this dialog, under your system's power settings.



                ss #1



            versus this:



                ss #2






            share|improve this answer




















            • 2





              Hmm, how is this possible? Perhaps you use hibernate? Because when you use suspend, if the laptop runs out of juice, it shuts down and then you basically do a cold boot. (At least here after suspend and a loss of power it never resumes from where it left.)

              – landroni
              Feb 16 '14 at 9:53












            • @landroni - see updates.

              – slm
              Feb 16 '14 at 13:07











            • @landroni - does this explain it better?

              – slm
              Feb 16 '14 at 13:52











            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f115356%2fis-there-a-risk-of-data-corruption-if-suspended-laptop-runs-out-of-battery%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            8














            Suspending implies that the data you were working with is in the memory. This state will be lost if you run out of power. If you were writing a forum post, for example, it will be lost, but nothing more serious would happen. Think that it's less serious than unplugging and removing the battery, since the computer can sync before and even delay the suspension (when running an update or upgrade).



            For obtaining both the benefits of suspend (fast re-start) and hibernate (safely saved to disk, without power consumption) try pm-suspend-hybrid instead. If you run out of power you can re-start from the image saved to disk, if you don't run out of power you can quickly re-start from a suspended to memory state.






            share|improve this answer


















            • 1





              "but nothing more serious would happen." Just to be clear, this means that no corruption of hard-drive sectors can occur? In other words, you would lose anything that you didn't already save to disk (as expected), but anything that resides on the disk is safe and sound. Correct?

              – landroni
              Feb 16 '14 at 13:44






            • 1





              @landroni: right.

              – Quora Feans
              Feb 16 '14 at 17:05















            8














            Suspending implies that the data you were working with is in the memory. This state will be lost if you run out of power. If you were writing a forum post, for example, it will be lost, but nothing more serious would happen. Think that it's less serious than unplugging and removing the battery, since the computer can sync before and even delay the suspension (when running an update or upgrade).



            For obtaining both the benefits of suspend (fast re-start) and hibernate (safely saved to disk, without power consumption) try pm-suspend-hybrid instead. If you run out of power you can re-start from the image saved to disk, if you don't run out of power you can quickly re-start from a suspended to memory state.






            share|improve this answer


















            • 1





              "but nothing more serious would happen." Just to be clear, this means that no corruption of hard-drive sectors can occur? In other words, you would lose anything that you didn't already save to disk (as expected), but anything that resides on the disk is safe and sound. Correct?

              – landroni
              Feb 16 '14 at 13:44






            • 1





              @landroni: right.

              – Quora Feans
              Feb 16 '14 at 17:05













            8












            8








            8







            Suspending implies that the data you were working with is in the memory. This state will be lost if you run out of power. If you were writing a forum post, for example, it will be lost, but nothing more serious would happen. Think that it's less serious than unplugging and removing the battery, since the computer can sync before and even delay the suspension (when running an update or upgrade).



            For obtaining both the benefits of suspend (fast re-start) and hibernate (safely saved to disk, without power consumption) try pm-suspend-hybrid instead. If you run out of power you can re-start from the image saved to disk, if you don't run out of power you can quickly re-start from a suspended to memory state.






            share|improve this answer













            Suspending implies that the data you were working with is in the memory. This state will be lost if you run out of power. If you were writing a forum post, for example, it will be lost, but nothing more serious would happen. Think that it's less serious than unplugging and removing the battery, since the computer can sync before and even delay the suspension (when running an update or upgrade).



            For obtaining both the benefits of suspend (fast re-start) and hibernate (safely saved to disk, without power consumption) try pm-suspend-hybrid instead. If you run out of power you can re-start from the image saved to disk, if you don't run out of power you can quickly re-start from a suspended to memory state.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 16 '14 at 13:29









            Quora FeansQuora Feans

            1,53841936




            1,53841936







            • 1





              "but nothing more serious would happen." Just to be clear, this means that no corruption of hard-drive sectors can occur? In other words, you would lose anything that you didn't already save to disk (as expected), but anything that resides on the disk is safe and sound. Correct?

              – landroni
              Feb 16 '14 at 13:44






            • 1





              @landroni: right.

              – Quora Feans
              Feb 16 '14 at 17:05












            • 1





              "but nothing more serious would happen." Just to be clear, this means that no corruption of hard-drive sectors can occur? In other words, you would lose anything that you didn't already save to disk (as expected), but anything that resides on the disk is safe and sound. Correct?

              – landroni
              Feb 16 '14 at 13:44






            • 1





              @landroni: right.

              – Quora Feans
              Feb 16 '14 at 17:05







            1




            1





            "but nothing more serious would happen." Just to be clear, this means that no corruption of hard-drive sectors can occur? In other words, you would lose anything that you didn't already save to disk (as expected), but anything that resides on the disk is safe and sound. Correct?

            – landroni
            Feb 16 '14 at 13:44





            "but nothing more serious would happen." Just to be clear, this means that no corruption of hard-drive sectors can occur? In other words, you would lose anything that you didn't already save to disk (as expected), but anything that resides on the disk is safe and sound. Correct?

            – landroni
            Feb 16 '14 at 13:44




            1




            1





            @landroni: right.

            – Quora Feans
            Feb 16 '14 at 17:05





            @landroni: right.

            – Quora Feans
            Feb 16 '14 at 17:05













            2














            There are two things to think about here, as hinted at by other answers.



            The first is File System Corruption. This relates to the meta-data structures that makes the file system usable, and is understood and controlled by the Kernel.



            The second is the content of the files. When the content of a file is corrupted, the kernel will not know (or care). Complex systems like databases implement their own meta-data facilities to take care of this problem, but for most file types on a typical desktop system there is no such thing.



            If you are editing a file, a "change" to the file might consist of writes to several locations. When all of these writes have been completed, the file is in a consistent state, but when only some of these writes are completed the file contents may be corrupted (inconsistent)



            The operating system will (should) "group" related writes into a transaction. So, for example when a file grows, the data must be written to the blocks belonging to that file, and the file system structures be updated to allocate those new blocks to the file, and possible changes to the directory entry (eg last modification time) be updated, all as a single group. Once all of this is Sync'ed (flushed) to disk, the file system will be consistent again, but the file contents may not be until all the relevant writes have been submitted by the application and flushed to disk by the operating system.



            If the application is in the middle of a complicated change and gets blocked before all the transactions have been issued, for example you press SAVE and immediately close your laptop lid, the entire group of changes may not all make it to the kernel's write queues.



            Generally whatever is in the write queues will be flushed to disk. The file systems should, generally, be consistent. Due to File system journals though this might mean that some of those changes are temporarily in a log, albeit safely on disk.



            File contents however is another story.






            share|improve this answer



























              2














              There are two things to think about here, as hinted at by other answers.



              The first is File System Corruption. This relates to the meta-data structures that makes the file system usable, and is understood and controlled by the Kernel.



              The second is the content of the files. When the content of a file is corrupted, the kernel will not know (or care). Complex systems like databases implement their own meta-data facilities to take care of this problem, but for most file types on a typical desktop system there is no such thing.



              If you are editing a file, a "change" to the file might consist of writes to several locations. When all of these writes have been completed, the file is in a consistent state, but when only some of these writes are completed the file contents may be corrupted (inconsistent)



              The operating system will (should) "group" related writes into a transaction. So, for example when a file grows, the data must be written to the blocks belonging to that file, and the file system structures be updated to allocate those new blocks to the file, and possible changes to the directory entry (eg last modification time) be updated, all as a single group. Once all of this is Sync'ed (flushed) to disk, the file system will be consistent again, but the file contents may not be until all the relevant writes have been submitted by the application and flushed to disk by the operating system.



              If the application is in the middle of a complicated change and gets blocked before all the transactions have been issued, for example you press SAVE and immediately close your laptop lid, the entire group of changes may not all make it to the kernel's write queues.



              Generally whatever is in the write queues will be flushed to disk. The file systems should, generally, be consistent. Due to File system journals though this might mean that some of those changes are temporarily in a log, albeit safely on disk.



              File contents however is another story.






              share|improve this answer

























                2












                2








                2







                There are two things to think about here, as hinted at by other answers.



                The first is File System Corruption. This relates to the meta-data structures that makes the file system usable, and is understood and controlled by the Kernel.



                The second is the content of the files. When the content of a file is corrupted, the kernel will not know (or care). Complex systems like databases implement their own meta-data facilities to take care of this problem, but for most file types on a typical desktop system there is no such thing.



                If you are editing a file, a "change" to the file might consist of writes to several locations. When all of these writes have been completed, the file is in a consistent state, but when only some of these writes are completed the file contents may be corrupted (inconsistent)



                The operating system will (should) "group" related writes into a transaction. So, for example when a file grows, the data must be written to the blocks belonging to that file, and the file system structures be updated to allocate those new blocks to the file, and possible changes to the directory entry (eg last modification time) be updated, all as a single group. Once all of this is Sync'ed (flushed) to disk, the file system will be consistent again, but the file contents may not be until all the relevant writes have been submitted by the application and flushed to disk by the operating system.



                If the application is in the middle of a complicated change and gets blocked before all the transactions have been issued, for example you press SAVE and immediately close your laptop lid, the entire group of changes may not all make it to the kernel's write queues.



                Generally whatever is in the write queues will be flushed to disk. The file systems should, generally, be consistent. Due to File system journals though this might mean that some of those changes are temporarily in a log, albeit safely on disk.



                File contents however is another story.






                share|improve this answer













                There are two things to think about here, as hinted at by other answers.



                The first is File System Corruption. This relates to the meta-data structures that makes the file system usable, and is understood and controlled by the Kernel.



                The second is the content of the files. When the content of a file is corrupted, the kernel will not know (or care). Complex systems like databases implement their own meta-data facilities to take care of this problem, but for most file types on a typical desktop system there is no such thing.



                If you are editing a file, a "change" to the file might consist of writes to several locations. When all of these writes have been completed, the file is in a consistent state, but when only some of these writes are completed the file contents may be corrupted (inconsistent)



                The operating system will (should) "group" related writes into a transaction. So, for example when a file grows, the data must be written to the blocks belonging to that file, and the file system structures be updated to allocate those new blocks to the file, and possible changes to the directory entry (eg last modification time) be updated, all as a single group. Once all of this is Sync'ed (flushed) to disk, the file system will be consistent again, but the file contents may not be until all the relevant writes have been submitted by the application and flushed to disk by the operating system.



                If the application is in the middle of a complicated change and gets blocked before all the transactions have been issued, for example you press SAVE and immediately close your laptop lid, the entire group of changes may not all make it to the kernel's write queues.



                Generally whatever is in the write queues will be flushed to disk. The file systems should, generally, be consistent. Due to File system journals though this might mean that some of those changes are temporarily in a log, albeit safely on disk.



                File contents however is another story.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 20 '14 at 11:19









                JohanJohan

                2,81721829




                2,81721829





















                    1














                    Data corruption? Most likely no. Data loss? possibly.



                    The data that would be at risk when the system loses power during a suspend would be the only things at risk. This data is the "snapshot" of the system's memory that's been temporarily written to disk when you put the system into "suspend" mode. No harm should ever come to your HDD or the data that's present on the HDD.



                    The data on your system should be safe so long as you've selected that the system "poweroff" if the battery gets into a "critically low" state, as seen in this dialog, under your system's power settings.



                        ss #1



                    versus this:



                        ss #2






                    share|improve this answer




















                    • 2





                      Hmm, how is this possible? Perhaps you use hibernate? Because when you use suspend, if the laptop runs out of juice, it shuts down and then you basically do a cold boot. (At least here after suspend and a loss of power it never resumes from where it left.)

                      – landroni
                      Feb 16 '14 at 9:53












                    • @landroni - see updates.

                      – slm
                      Feb 16 '14 at 13:07











                    • @landroni - does this explain it better?

                      – slm
                      Feb 16 '14 at 13:52















                    1














                    Data corruption? Most likely no. Data loss? possibly.



                    The data that would be at risk when the system loses power during a suspend would be the only things at risk. This data is the "snapshot" of the system's memory that's been temporarily written to disk when you put the system into "suspend" mode. No harm should ever come to your HDD or the data that's present on the HDD.



                    The data on your system should be safe so long as you've selected that the system "poweroff" if the battery gets into a "critically low" state, as seen in this dialog, under your system's power settings.



                        ss #1



                    versus this:



                        ss #2






                    share|improve this answer




















                    • 2





                      Hmm, how is this possible? Perhaps you use hibernate? Because when you use suspend, if the laptop runs out of juice, it shuts down and then you basically do a cold boot. (At least here after suspend and a loss of power it never resumes from where it left.)

                      – landroni
                      Feb 16 '14 at 9:53












                    • @landroni - see updates.

                      – slm
                      Feb 16 '14 at 13:07











                    • @landroni - does this explain it better?

                      – slm
                      Feb 16 '14 at 13:52













                    1












                    1








                    1







                    Data corruption? Most likely no. Data loss? possibly.



                    The data that would be at risk when the system loses power during a suspend would be the only things at risk. This data is the "snapshot" of the system's memory that's been temporarily written to disk when you put the system into "suspend" mode. No harm should ever come to your HDD or the data that's present on the HDD.



                    The data on your system should be safe so long as you've selected that the system "poweroff" if the battery gets into a "critically low" state, as seen in this dialog, under your system's power settings.



                        ss #1



                    versus this:



                        ss #2






                    share|improve this answer















                    Data corruption? Most likely no. Data loss? possibly.



                    The data that would be at risk when the system loses power during a suspend would be the only things at risk. This data is the "snapshot" of the system's memory that's been temporarily written to disk when you put the system into "suspend" mode. No harm should ever come to your HDD or the data that's present on the HDD.



                    The data on your system should be safe so long as you've selected that the system "poweroff" if the battery gets into a "critically low" state, as seen in this dialog, under your system's power settings.



                        ss #1



                    versus this:



                        ss #2







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Feb 16 '14 at 13:52

























                    answered Feb 16 '14 at 1:33









                    slmslm

                    256k71544690




                    256k71544690







                    • 2





                      Hmm, how is this possible? Perhaps you use hibernate? Because when you use suspend, if the laptop runs out of juice, it shuts down and then you basically do a cold boot. (At least here after suspend and a loss of power it never resumes from where it left.)

                      – landroni
                      Feb 16 '14 at 9:53












                    • @landroni - see updates.

                      – slm
                      Feb 16 '14 at 13:07











                    • @landroni - does this explain it better?

                      – slm
                      Feb 16 '14 at 13:52












                    • 2





                      Hmm, how is this possible? Perhaps you use hibernate? Because when you use suspend, if the laptop runs out of juice, it shuts down and then you basically do a cold boot. (At least here after suspend and a loss of power it never resumes from where it left.)

                      – landroni
                      Feb 16 '14 at 9:53












                    • @landroni - see updates.

                      – slm
                      Feb 16 '14 at 13:07











                    • @landroni - does this explain it better?

                      – slm
                      Feb 16 '14 at 13:52







                    2




                    2





                    Hmm, how is this possible? Perhaps you use hibernate? Because when you use suspend, if the laptop runs out of juice, it shuts down and then you basically do a cold boot. (At least here after suspend and a loss of power it never resumes from where it left.)

                    – landroni
                    Feb 16 '14 at 9:53






                    Hmm, how is this possible? Perhaps you use hibernate? Because when you use suspend, if the laptop runs out of juice, it shuts down and then you basically do a cold boot. (At least here after suspend and a loss of power it never resumes from where it left.)

                    – landroni
                    Feb 16 '14 at 9:53














                    @landroni - see updates.

                    – slm
                    Feb 16 '14 at 13:07





                    @landroni - see updates.

                    – slm
                    Feb 16 '14 at 13:07













                    @landroni - does this explain it better?

                    – slm
                    Feb 16 '14 at 13:52





                    @landroni - does this explain it better?

                    – slm
                    Feb 16 '14 at 13:52

















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f115356%2fis-there-a-risk-of-data-corruption-if-suspended-laptop-runs-out-of-battery%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay