Linux installed on USB disk, can data be lost during shutdown?












3














I was observing the use of the sync command and I have read that this command makes sure that anything in memory is written to disk.



As I was thinking of installing Ubuntu on a removable disk (USB) I would like to know if it is necessary to execute this command.



It worries me that when turning off the computer, if data are still being written, they end up losing because of the system shutdown.



Is it necessary to run sync before shutting down or restart the system?



Does anyone explain more about this?










share|improve this question



























    3














    I was observing the use of the sync command and I have read that this command makes sure that anything in memory is written to disk.



    As I was thinking of installing Ubuntu on a removable disk (USB) I would like to know if it is necessary to execute this command.



    It worries me that when turning off the computer, if data are still being written, they end up losing because of the system shutdown.



    Is it necessary to run sync before shutting down or restart the system?



    Does anyone explain more about this?










    share|improve this question

























      3












      3








      3


      1





      I was observing the use of the sync command and I have read that this command makes sure that anything in memory is written to disk.



      As I was thinking of installing Ubuntu on a removable disk (USB) I would like to know if it is necessary to execute this command.



      It worries me that when turning off the computer, if data are still being written, they end up losing because of the system shutdown.



      Is it necessary to run sync before shutting down or restart the system?



      Does anyone explain more about this?










      share|improve this question













      I was observing the use of the sync command and I have read that this command makes sure that anything in memory is written to disk.



      As I was thinking of installing Ubuntu on a removable disk (USB) I would like to know if it is necessary to execute this command.



      It worries me that when turning off the computer, if data are still being written, they end up losing because of the system shutdown.



      Is it necessary to run sync before shutting down or restart the system?



      Does anyone explain more about this?







      usb shutdown sync






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      MarianoM

      5710




      5710






















          1 Answer
          1






          active

          oldest

          votes


















          4














          Data can be lost during unexpected shutdowns or system crashes - when the operating system cannot actually flush the data from memory to disk. During normal shutdown or restart the operating system is still in control, so it will write data to disk.



          In other words, normal shutdowns/reboots are OK. There is also something know as halt state - where machine is still running, but OS has went through shutdown process and relinquished control of the hardware. In such case, powering off the machine is also OK. What's not OK is abnormal power offs and shutdowns.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2faskubuntu.com%2fquestions%2f1107651%2flinux-installed-on-usb-disk-can-data-be-lost-during-shutdown%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4














            Data can be lost during unexpected shutdowns or system crashes - when the operating system cannot actually flush the data from memory to disk. During normal shutdown or restart the operating system is still in control, so it will write data to disk.



            In other words, normal shutdowns/reboots are OK. There is also something know as halt state - where machine is still running, but OS has went through shutdown process and relinquished control of the hardware. In such case, powering off the machine is also OK. What's not OK is abnormal power offs and shutdowns.






            share|improve this answer


























              4














              Data can be lost during unexpected shutdowns or system crashes - when the operating system cannot actually flush the data from memory to disk. During normal shutdown or restart the operating system is still in control, so it will write data to disk.



              In other words, normal shutdowns/reboots are OK. There is also something know as halt state - where machine is still running, but OS has went through shutdown process and relinquished control of the hardware. In such case, powering off the machine is also OK. What's not OK is abnormal power offs and shutdowns.






              share|improve this answer
























                4












                4








                4






                Data can be lost during unexpected shutdowns or system crashes - when the operating system cannot actually flush the data from memory to disk. During normal shutdown or restart the operating system is still in control, so it will write data to disk.



                In other words, normal shutdowns/reboots are OK. There is also something know as halt state - where machine is still running, but OS has went through shutdown process and relinquished control of the hardware. In such case, powering off the machine is also OK. What's not OK is abnormal power offs and shutdowns.






                share|improve this answer












                Data can be lost during unexpected shutdowns or system crashes - when the operating system cannot actually flush the data from memory to disk. During normal shutdown or restart the operating system is still in control, so it will write data to disk.



                In other words, normal shutdowns/reboots are OK. There is also something know as halt state - where machine is still running, but OS has went through shutdown process and relinquished control of the hardware. In such case, powering off the machine is also OK. What's not OK is abnormal power offs and shutdowns.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 hours ago









                Sergiy Kolodyazhnyy

                70k9144307




                70k9144307






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2faskubuntu.com%2fquestions%2f1107651%2flinux-installed-on-usb-disk-can-data-be-lost-during-shutdown%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 rewrite equation of hyperbola in standard form

                    No ethernet ip address in my vocore2