How do I disable the auto-mounting of internal drives in Ubuntu or Kubuntu 18.04












3















I'm aware that there are other questions regarding this issue. However, none of them apply specifically to Kubuntu 18.04, and the solutions they offer have not worked. Please look at what I have tried before marking this as a duplicate



I am running Kubuntu 18.04 w/ KDE Plasma 5.12.6 off of a USB drive. This is a full install, not a Live version. The drive serves as a portable system that I can use with most physical computers.



To prevent any damage to the host computer's data. I do not want to automount any internal disk drives on boot. Even better, I'd like to completely disable those drives, so that even a normal sudo mount /dev/sdx wouldn't work, but I'll settle for disabaling auto-mounting to start.



What I've tried




  • The most commonly cited answer is to change the org.gnome.desktop.media-handling automount setting to false. I've done this using both gsettings from the command line as well as the dconf gui editor. Both automount and automount-open are set to false

  • Removing my account (and all accounts) from the plugdev group.

  • Confirming that the "Enable automatic mounting of removable media" setting in the Kubuntu Removeable Devices settings module is unchcked.


After trying all of these and rebooting, Kubuntu still mounts all discovered partitions, both those on the flash drive and any found on internal drives.



Solutions that won't work




  • The other oft-mentioned solution is to disable the auto-mounting of specific devices by adding the device fstab along with a noauto option. This solution does not help in my scenario, as I do not know what devices will be present when the system starts up. I would need to somehow configure fstab to default with a noauto for all devices.










share|improve this question




















  • 1





    See unix.stackexchange.com/questions/170549/…

    – Panther
    Aug 6 '18 at 0:43











  • @Panther thanks, that worked. As the question/solution is for an older version of Linux, and specifically marked for openSUSE, do you want to write up your comment as an answer? Based on other questions, I think that this is a fairly common request, especially for Kubuntu.

    – BrianHVB
    Aug 7 '18 at 2:29











  • @BrianHVP go ahead , give credit as to the source

    – Panther
    Aug 7 '18 at 6:45
















3















I'm aware that there are other questions regarding this issue. However, none of them apply specifically to Kubuntu 18.04, and the solutions they offer have not worked. Please look at what I have tried before marking this as a duplicate



I am running Kubuntu 18.04 w/ KDE Plasma 5.12.6 off of a USB drive. This is a full install, not a Live version. The drive serves as a portable system that I can use with most physical computers.



To prevent any damage to the host computer's data. I do not want to automount any internal disk drives on boot. Even better, I'd like to completely disable those drives, so that even a normal sudo mount /dev/sdx wouldn't work, but I'll settle for disabaling auto-mounting to start.



What I've tried




  • The most commonly cited answer is to change the org.gnome.desktop.media-handling automount setting to false. I've done this using both gsettings from the command line as well as the dconf gui editor. Both automount and automount-open are set to false

  • Removing my account (and all accounts) from the plugdev group.

  • Confirming that the "Enable automatic mounting of removable media" setting in the Kubuntu Removeable Devices settings module is unchcked.


After trying all of these and rebooting, Kubuntu still mounts all discovered partitions, both those on the flash drive and any found on internal drives.



Solutions that won't work




  • The other oft-mentioned solution is to disable the auto-mounting of specific devices by adding the device fstab along with a noauto option. This solution does not help in my scenario, as I do not know what devices will be present when the system starts up. I would need to somehow configure fstab to default with a noauto for all devices.










share|improve this question




















  • 1





    See unix.stackexchange.com/questions/170549/…

    – Panther
    Aug 6 '18 at 0:43











  • @Panther thanks, that worked. As the question/solution is for an older version of Linux, and specifically marked for openSUSE, do you want to write up your comment as an answer? Based on other questions, I think that this is a fairly common request, especially for Kubuntu.

    – BrianHVB
    Aug 7 '18 at 2:29











  • @BrianHVP go ahead , give credit as to the source

    – Panther
    Aug 7 '18 at 6:45














3












3








3


1






I'm aware that there are other questions regarding this issue. However, none of them apply specifically to Kubuntu 18.04, and the solutions they offer have not worked. Please look at what I have tried before marking this as a duplicate



I am running Kubuntu 18.04 w/ KDE Plasma 5.12.6 off of a USB drive. This is a full install, not a Live version. The drive serves as a portable system that I can use with most physical computers.



To prevent any damage to the host computer's data. I do not want to automount any internal disk drives on boot. Even better, I'd like to completely disable those drives, so that even a normal sudo mount /dev/sdx wouldn't work, but I'll settle for disabaling auto-mounting to start.



What I've tried




  • The most commonly cited answer is to change the org.gnome.desktop.media-handling automount setting to false. I've done this using both gsettings from the command line as well as the dconf gui editor. Both automount and automount-open are set to false

  • Removing my account (and all accounts) from the plugdev group.

  • Confirming that the "Enable automatic mounting of removable media" setting in the Kubuntu Removeable Devices settings module is unchcked.


After trying all of these and rebooting, Kubuntu still mounts all discovered partitions, both those on the flash drive and any found on internal drives.



Solutions that won't work




  • The other oft-mentioned solution is to disable the auto-mounting of specific devices by adding the device fstab along with a noauto option. This solution does not help in my scenario, as I do not know what devices will be present when the system starts up. I would need to somehow configure fstab to default with a noauto for all devices.










share|improve this question
















I'm aware that there are other questions regarding this issue. However, none of them apply specifically to Kubuntu 18.04, and the solutions they offer have not worked. Please look at what I have tried before marking this as a duplicate



I am running Kubuntu 18.04 w/ KDE Plasma 5.12.6 off of a USB drive. This is a full install, not a Live version. The drive serves as a portable system that I can use with most physical computers.



To prevent any damage to the host computer's data. I do not want to automount any internal disk drives on boot. Even better, I'd like to completely disable those drives, so that even a normal sudo mount /dev/sdx wouldn't work, but I'll settle for disabaling auto-mounting to start.



What I've tried




  • The most commonly cited answer is to change the org.gnome.desktop.media-handling automount setting to false. I've done this using both gsettings from the command line as well as the dconf gui editor. Both automount and automount-open are set to false

  • Removing my account (and all accounts) from the plugdev group.

  • Confirming that the "Enable automatic mounting of removable media" setting in the Kubuntu Removeable Devices settings module is unchcked.


After trying all of these and rebooting, Kubuntu still mounts all discovered partitions, both those on the flash drive and any found on internal drives.



Solutions that won't work




  • The other oft-mentioned solution is to disable the auto-mounting of specific devices by adding the device fstab along with a noauto option. This solution does not help in my scenario, as I do not know what devices will be present when the system starts up. I would need to somehow configure fstab to default with a noauto for all devices.







mount kubuntu automount






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 15 mins ago







BrianHVB

















asked Aug 6 '18 at 0:24









BrianHVBBrianHVB

1213




1213








  • 1





    See unix.stackexchange.com/questions/170549/…

    – Panther
    Aug 6 '18 at 0:43











  • @Panther thanks, that worked. As the question/solution is for an older version of Linux, and specifically marked for openSUSE, do you want to write up your comment as an answer? Based on other questions, I think that this is a fairly common request, especially for Kubuntu.

    – BrianHVB
    Aug 7 '18 at 2:29











  • @BrianHVP go ahead , give credit as to the source

    – Panther
    Aug 7 '18 at 6:45














  • 1





    See unix.stackexchange.com/questions/170549/…

    – Panther
    Aug 6 '18 at 0:43











  • @Panther thanks, that worked. As the question/solution is for an older version of Linux, and specifically marked for openSUSE, do you want to write up your comment as an answer? Based on other questions, I think that this is a fairly common request, especially for Kubuntu.

    – BrianHVB
    Aug 7 '18 at 2:29











  • @BrianHVP go ahead , give credit as to the source

    – Panther
    Aug 7 '18 at 6:45








1




1





See unix.stackexchange.com/questions/170549/…

– Panther
Aug 6 '18 at 0:43





See unix.stackexchange.com/questions/170549/…

– Panther
Aug 6 '18 at 0:43













@Panther thanks, that worked. As the question/solution is for an older version of Linux, and specifically marked for openSUSE, do you want to write up your comment as an answer? Based on other questions, I think that this is a fairly common request, especially for Kubuntu.

– BrianHVB
Aug 7 '18 at 2:29





@Panther thanks, that worked. As the question/solution is for an older version of Linux, and specifically marked for openSUSE, do you want to write up your comment as an answer? Based on other questions, I think that this is a fairly common request, especially for Kubuntu.

– BrianHVB
Aug 7 '18 at 2:29













@BrianHVP go ahead , give credit as to the source

– Panther
Aug 7 '18 at 6:45





@BrianHVP go ahead , give credit as to the source

– Panther
Aug 7 '18 at 6:45










1 Answer
1






active

oldest

votes


















0














The Auto-mounting of disks in Debian-based Linux distros (and perhaps others) comes from a service called udisks2.



Disabling this service will prevent any disk from automatically being mounted, while still allowing manual mounting.



Disable the service - No automatic or manual starts



systemctl mask udisks2


Unmask the service - Will need to either manually run it or restart the computer



systemctl unmask udisks2
systemctl unmask udisk2.service


Stop the service temporarily - This will not persist across restarts



systemctl stop udisks2.service


Get the status



systemctl status udisk2


Credit to @maxschlepzig for answering a similar question about OpenSUSE.






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%2f1062719%2fhow-do-i-disable-the-auto-mounting-of-internal-drives-in-ubuntu-or-kubuntu-18-04%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









    0














    The Auto-mounting of disks in Debian-based Linux distros (and perhaps others) comes from a service called udisks2.



    Disabling this service will prevent any disk from automatically being mounted, while still allowing manual mounting.



    Disable the service - No automatic or manual starts



    systemctl mask udisks2


    Unmask the service - Will need to either manually run it or restart the computer



    systemctl unmask udisks2
    systemctl unmask udisk2.service


    Stop the service temporarily - This will not persist across restarts



    systemctl stop udisks2.service


    Get the status



    systemctl status udisk2


    Credit to @maxschlepzig for answering a similar question about OpenSUSE.






    share|improve this answer




























      0














      The Auto-mounting of disks in Debian-based Linux distros (and perhaps others) comes from a service called udisks2.



      Disabling this service will prevent any disk from automatically being mounted, while still allowing manual mounting.



      Disable the service - No automatic or manual starts



      systemctl mask udisks2


      Unmask the service - Will need to either manually run it or restart the computer



      systemctl unmask udisks2
      systemctl unmask udisk2.service


      Stop the service temporarily - This will not persist across restarts



      systemctl stop udisks2.service


      Get the status



      systemctl status udisk2


      Credit to @maxschlepzig for answering a similar question about OpenSUSE.






      share|improve this answer


























        0












        0








        0







        The Auto-mounting of disks in Debian-based Linux distros (and perhaps others) comes from a service called udisks2.



        Disabling this service will prevent any disk from automatically being mounted, while still allowing manual mounting.



        Disable the service - No automatic or manual starts



        systemctl mask udisks2


        Unmask the service - Will need to either manually run it or restart the computer



        systemctl unmask udisks2
        systemctl unmask udisk2.service


        Stop the service temporarily - This will not persist across restarts



        systemctl stop udisks2.service


        Get the status



        systemctl status udisk2


        Credit to @maxschlepzig for answering a similar question about OpenSUSE.






        share|improve this answer













        The Auto-mounting of disks in Debian-based Linux distros (and perhaps others) comes from a service called udisks2.



        Disabling this service will prevent any disk from automatically being mounted, while still allowing manual mounting.



        Disable the service - No automatic or manual starts



        systemctl mask udisks2


        Unmask the service - Will need to either manually run it or restart the computer



        systemctl unmask udisks2
        systemctl unmask udisk2.service


        Stop the service temporarily - This will not persist across restarts



        systemctl stop udisks2.service


        Get the status



        systemctl status udisk2


        Credit to @maxschlepzig for answering a similar question about OpenSUSE.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 16 mins ago









        BrianHVBBrianHVB

        1213




        1213






























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1062719%2fhow-do-i-disable-the-auto-mounting-of-internal-drives-in-ubuntu-or-kubuntu-18-04%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

            GameSpot

            connect to host localhost port 22: Connection refused

            Getting a Wifi WPA2 wifi connection