Is it safe to gnome-session-quit && shutdown -h now?

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











up vote
0
down vote

favorite












I have a LUKS external partition that is automatically opened/mounted and closed/unmounted by pam_mount during login and logout. Right now I am having to log out in the terminal and then shutdown using the GUI at the login screen.



I want to write an alias for the command gnome-session-quit && shutdown -h now to make this quick and easy but I don't know if this would affect the LUKS partition in any way if I don't give it enough time to gracefully unmount and close. I don't want to boot into a session where my encrypted drive fails to work because this command crashed it while it was still doing I/O operations.







share|improve this question

























    up vote
    0
    down vote

    favorite












    I have a LUKS external partition that is automatically opened/mounted and closed/unmounted by pam_mount during login and logout. Right now I am having to log out in the terminal and then shutdown using the GUI at the login screen.



    I want to write an alias for the command gnome-session-quit && shutdown -h now to make this quick and easy but I don't know if this would affect the LUKS partition in any way if I don't give it enough time to gracefully unmount and close. I don't want to boot into a session where my encrypted drive fails to work because this command crashed it while it was still doing I/O operations.







    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a LUKS external partition that is automatically opened/mounted and closed/unmounted by pam_mount during login and logout. Right now I am having to log out in the terminal and then shutdown using the GUI at the login screen.



      I want to write an alias for the command gnome-session-quit && shutdown -h now to make this quick and easy but I don't know if this would affect the LUKS partition in any way if I don't give it enough time to gracefully unmount and close. I don't want to boot into a session where my encrypted drive fails to work because this command crashed it while it was still doing I/O operations.







      share|improve this question













      I have a LUKS external partition that is automatically opened/mounted and closed/unmounted by pam_mount during login and logout. Right now I am having to log out in the terminal and then shutdown using the GUI at the login screen.



      I want to write an alias for the command gnome-session-quit && shutdown -h now to make this quick and easy but I don't know if this would affect the LUKS partition in any way if I don't give it enough time to gracefully unmount and close. I don't want to boot into a session where my encrypted drive fails to work because this command crashed it while it was still doing I/O operations.









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jun 5 at 20:23
























      asked Jun 5 at 20:18









      MyWrathAcademia

      1409




      1409




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          Shutdown will wait for disks to be unmounted. See https://serverfault.com/questions/327758/linux-graceful-shutdown or https://www.tldp.org/LDP/sag/html/shutdown.html



          The command you've posted will shutdown without data loss from filesystem corruption.






          share|improve this answer





















          • So the command will work? Thats good to know, now I can make an alias for it. Your link does ay that shutdown is graceful, but it doesn't address whether pam_mount will still close the LUKS encrypted drive.
            – MyWrathAcademia
            Jun 7 at 13:37











          • @MyWrathAcademia if the partition is cleanly umount'ed, it shouldn't matter whether or not it gets a luksClose since that doesn't do any writing to the drive itself anyway.
            – Xen2050
            Jun 16 at 3:40










          • thanks @Xen2050. Do you think I should set a timer in between the log off and shutdown, in order to ensure the partition is cleanly unmounted, e.g. gnome-session-quit && shutdown -h 1? Or is a delay not necessary in your opinion.
            – MyWrathAcademia
            Jun 19 at 19:36










          • @MyWrathAcademia I'm not sure what gnome-session-quit umounts, but shutdown should be doing safe umounting anyway. Unless you're seeing errors (like dirty filesystems) I probably wouldn't bother with a delay, but if it's just a few seconds that might not be a big deal either
            – Xen2050
            Jun 29 at 22:31










          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f448070%2fis-it-safe-to-gnome-session-quit-shutdown-h-now%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          Shutdown will wait for disks to be unmounted. See https://serverfault.com/questions/327758/linux-graceful-shutdown or https://www.tldp.org/LDP/sag/html/shutdown.html



          The command you've posted will shutdown without data loss from filesystem corruption.






          share|improve this answer





















          • So the command will work? Thats good to know, now I can make an alias for it. Your link does ay that shutdown is graceful, but it doesn't address whether pam_mount will still close the LUKS encrypted drive.
            – MyWrathAcademia
            Jun 7 at 13:37











          • @MyWrathAcademia if the partition is cleanly umount'ed, it shouldn't matter whether or not it gets a luksClose since that doesn't do any writing to the drive itself anyway.
            – Xen2050
            Jun 16 at 3:40










          • thanks @Xen2050. Do you think I should set a timer in between the log off and shutdown, in order to ensure the partition is cleanly unmounted, e.g. gnome-session-quit && shutdown -h 1? Or is a delay not necessary in your opinion.
            – MyWrathAcademia
            Jun 19 at 19:36










          • @MyWrathAcademia I'm not sure what gnome-session-quit umounts, but shutdown should be doing safe umounting anyway. Unless you're seeing errors (like dirty filesystems) I probably wouldn't bother with a delay, but if it's just a few seconds that might not be a big deal either
            – Xen2050
            Jun 29 at 22:31














          up vote
          2
          down vote













          Shutdown will wait for disks to be unmounted. See https://serverfault.com/questions/327758/linux-graceful-shutdown or https://www.tldp.org/LDP/sag/html/shutdown.html



          The command you've posted will shutdown without data loss from filesystem corruption.






          share|improve this answer





















          • So the command will work? Thats good to know, now I can make an alias for it. Your link does ay that shutdown is graceful, but it doesn't address whether pam_mount will still close the LUKS encrypted drive.
            – MyWrathAcademia
            Jun 7 at 13:37











          • @MyWrathAcademia if the partition is cleanly umount'ed, it shouldn't matter whether or not it gets a luksClose since that doesn't do any writing to the drive itself anyway.
            – Xen2050
            Jun 16 at 3:40










          • thanks @Xen2050. Do you think I should set a timer in between the log off and shutdown, in order to ensure the partition is cleanly unmounted, e.g. gnome-session-quit && shutdown -h 1? Or is a delay not necessary in your opinion.
            – MyWrathAcademia
            Jun 19 at 19:36










          • @MyWrathAcademia I'm not sure what gnome-session-quit umounts, but shutdown should be doing safe umounting anyway. Unless you're seeing errors (like dirty filesystems) I probably wouldn't bother with a delay, but if it's just a few seconds that might not be a big deal either
            – Xen2050
            Jun 29 at 22:31












          up vote
          2
          down vote










          up vote
          2
          down vote









          Shutdown will wait for disks to be unmounted. See https://serverfault.com/questions/327758/linux-graceful-shutdown or https://www.tldp.org/LDP/sag/html/shutdown.html



          The command you've posted will shutdown without data loss from filesystem corruption.






          share|improve this answer













          Shutdown will wait for disks to be unmounted. See https://serverfault.com/questions/327758/linux-graceful-shutdown or https://www.tldp.org/LDP/sag/html/shutdown.html



          The command you've posted will shutdown without data loss from filesystem corruption.







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered Jun 5 at 22:31









          Nick ODell

          8922819




          8922819











          • So the command will work? Thats good to know, now I can make an alias for it. Your link does ay that shutdown is graceful, but it doesn't address whether pam_mount will still close the LUKS encrypted drive.
            – MyWrathAcademia
            Jun 7 at 13:37











          • @MyWrathAcademia if the partition is cleanly umount'ed, it shouldn't matter whether or not it gets a luksClose since that doesn't do any writing to the drive itself anyway.
            – Xen2050
            Jun 16 at 3:40










          • thanks @Xen2050. Do you think I should set a timer in between the log off and shutdown, in order to ensure the partition is cleanly unmounted, e.g. gnome-session-quit && shutdown -h 1? Or is a delay not necessary in your opinion.
            – MyWrathAcademia
            Jun 19 at 19:36










          • @MyWrathAcademia I'm not sure what gnome-session-quit umounts, but shutdown should be doing safe umounting anyway. Unless you're seeing errors (like dirty filesystems) I probably wouldn't bother with a delay, but if it's just a few seconds that might not be a big deal either
            – Xen2050
            Jun 29 at 22:31
















          • So the command will work? Thats good to know, now I can make an alias for it. Your link does ay that shutdown is graceful, but it doesn't address whether pam_mount will still close the LUKS encrypted drive.
            – MyWrathAcademia
            Jun 7 at 13:37











          • @MyWrathAcademia if the partition is cleanly umount'ed, it shouldn't matter whether or not it gets a luksClose since that doesn't do any writing to the drive itself anyway.
            – Xen2050
            Jun 16 at 3:40










          • thanks @Xen2050. Do you think I should set a timer in between the log off and shutdown, in order to ensure the partition is cleanly unmounted, e.g. gnome-session-quit && shutdown -h 1? Or is a delay not necessary in your opinion.
            – MyWrathAcademia
            Jun 19 at 19:36










          • @MyWrathAcademia I'm not sure what gnome-session-quit umounts, but shutdown should be doing safe umounting anyway. Unless you're seeing errors (like dirty filesystems) I probably wouldn't bother with a delay, but if it's just a few seconds that might not be a big deal either
            – Xen2050
            Jun 29 at 22:31















          So the command will work? Thats good to know, now I can make an alias for it. Your link does ay that shutdown is graceful, but it doesn't address whether pam_mount will still close the LUKS encrypted drive.
          – MyWrathAcademia
          Jun 7 at 13:37





          So the command will work? Thats good to know, now I can make an alias for it. Your link does ay that shutdown is graceful, but it doesn't address whether pam_mount will still close the LUKS encrypted drive.
          – MyWrathAcademia
          Jun 7 at 13:37













          @MyWrathAcademia if the partition is cleanly umount'ed, it shouldn't matter whether or not it gets a luksClose since that doesn't do any writing to the drive itself anyway.
          – Xen2050
          Jun 16 at 3:40




          @MyWrathAcademia if the partition is cleanly umount'ed, it shouldn't matter whether or not it gets a luksClose since that doesn't do any writing to the drive itself anyway.
          – Xen2050
          Jun 16 at 3:40












          thanks @Xen2050. Do you think I should set a timer in between the log off and shutdown, in order to ensure the partition is cleanly unmounted, e.g. gnome-session-quit && shutdown -h 1? Or is a delay not necessary in your opinion.
          – MyWrathAcademia
          Jun 19 at 19:36




          thanks @Xen2050. Do you think I should set a timer in between the log off and shutdown, in order to ensure the partition is cleanly unmounted, e.g. gnome-session-quit && shutdown -h 1? Or is a delay not necessary in your opinion.
          – MyWrathAcademia
          Jun 19 at 19:36












          @MyWrathAcademia I'm not sure what gnome-session-quit umounts, but shutdown should be doing safe umounting anyway. Unless you're seeing errors (like dirty filesystems) I probably wouldn't bother with a delay, but if it's just a few seconds that might not be a big deal either
          – Xen2050
          Jun 29 at 22:31




          @MyWrathAcademia I'm not sure what gnome-session-quit umounts, but shutdown should be doing safe umounting anyway. Unless you're seeing errors (like dirty filesystems) I probably wouldn't bother with a delay, but if it's just a few seconds that might not be a big deal either
          – Xen2050
          Jun 29 at 22:31












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448070%2fis-it-safe-to-gnome-session-quit-shutdown-h-now%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

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

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?