How to stop auto mounting of devices in Ubuntu?












2














I have an Ubuntu 16.04 LTS desktop system that I use to rescue disk drives (using dd or ddrescue). Whenever I plug in a disk drive it is automatically mounted and shown in the file manager.



I don't want this because I am afraid of the disk to be rescued is modified by the mounting process. It is me who decides if and when that disk is mounted, and not some OS function.



Surprisingly I could not find a setting to deactivate the auto-mount function. Some solutions suggest to enter the affected partitions in /etc/fstab and disable mounting there, however as each disk drives to be rescued may have different partitions this is not going to work in my case.



Please advise how to fully disable the auto mount feature of Ubuntu.










share|improve this question













migrated from serverfault.com Dec 30 '16 at 8:40


This question came from our site for system and network administrators.











  • 1




    Good question, but I don't think it belongs on Server Fault. Would be a better fit for Ask Ubuntu or Unix & Linux. I have voted to migrate the question.
    – kasperd
    Dec 11 '16 at 19:24










  • I'd suggest you gogle for linux forensic distribution there are better choices for your task. For ubuntu a search for dsiable automount gets you some hits.
    – LotPings
    Dec 11 '16 at 22:44
















2














I have an Ubuntu 16.04 LTS desktop system that I use to rescue disk drives (using dd or ddrescue). Whenever I plug in a disk drive it is automatically mounted and shown in the file manager.



I don't want this because I am afraid of the disk to be rescued is modified by the mounting process. It is me who decides if and when that disk is mounted, and not some OS function.



Surprisingly I could not find a setting to deactivate the auto-mount function. Some solutions suggest to enter the affected partitions in /etc/fstab and disable mounting there, however as each disk drives to be rescued may have different partitions this is not going to work in my case.



Please advise how to fully disable the auto mount feature of Ubuntu.










share|improve this question













migrated from serverfault.com Dec 30 '16 at 8:40


This question came from our site for system and network administrators.











  • 1




    Good question, but I don't think it belongs on Server Fault. Would be a better fit for Ask Ubuntu or Unix & Linux. I have voted to migrate the question.
    – kasperd
    Dec 11 '16 at 19:24










  • I'd suggest you gogle for linux forensic distribution there are better choices for your task. For ubuntu a search for dsiable automount gets you some hits.
    – LotPings
    Dec 11 '16 at 22:44














2












2








2


1





I have an Ubuntu 16.04 LTS desktop system that I use to rescue disk drives (using dd or ddrescue). Whenever I plug in a disk drive it is automatically mounted and shown in the file manager.



I don't want this because I am afraid of the disk to be rescued is modified by the mounting process. It is me who decides if and when that disk is mounted, and not some OS function.



Surprisingly I could not find a setting to deactivate the auto-mount function. Some solutions suggest to enter the affected partitions in /etc/fstab and disable mounting there, however as each disk drives to be rescued may have different partitions this is not going to work in my case.



Please advise how to fully disable the auto mount feature of Ubuntu.










share|improve this question













I have an Ubuntu 16.04 LTS desktop system that I use to rescue disk drives (using dd or ddrescue). Whenever I plug in a disk drive it is automatically mounted and shown in the file manager.



I don't want this because I am afraid of the disk to be rescued is modified by the mounting process. It is me who decides if and when that disk is mounted, and not some OS function.



Surprisingly I could not find a setting to deactivate the auto-mount function. Some solutions suggest to enter the affected partitions in /etc/fstab and disable mounting there, however as each disk drives to be rescued may have different partitions this is not going to work in my case.



Please advise how to fully disable the auto mount feature of Ubuntu.







ubuntu debian filesystems automounting






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 11 '16 at 16:38







nn4l











migrated from serverfault.com Dec 30 '16 at 8:40


This question came from our site for system and network administrators.






migrated from serverfault.com Dec 30 '16 at 8:40


This question came from our site for system and network administrators.










  • 1




    Good question, but I don't think it belongs on Server Fault. Would be a better fit for Ask Ubuntu or Unix & Linux. I have voted to migrate the question.
    – kasperd
    Dec 11 '16 at 19:24










  • I'd suggest you gogle for linux forensic distribution there are better choices for your task. For ubuntu a search for dsiable automount gets you some hits.
    – LotPings
    Dec 11 '16 at 22:44














  • 1




    Good question, but I don't think it belongs on Server Fault. Would be a better fit for Ask Ubuntu or Unix & Linux. I have voted to migrate the question.
    – kasperd
    Dec 11 '16 at 19:24










  • I'd suggest you gogle for linux forensic distribution there are better choices for your task. For ubuntu a search for dsiable automount gets you some hits.
    – LotPings
    Dec 11 '16 at 22:44








1




1




Good question, but I don't think it belongs on Server Fault. Would be a better fit for Ask Ubuntu or Unix & Linux. I have voted to migrate the question.
– kasperd
Dec 11 '16 at 19:24




Good question, but I don't think it belongs on Server Fault. Would be a better fit for Ask Ubuntu or Unix & Linux. I have voted to migrate the question.
– kasperd
Dec 11 '16 at 19:24












I'd suggest you gogle for linux forensic distribution there are better choices for your task. For ubuntu a search for dsiable automount gets you some hits.
– LotPings
Dec 11 '16 at 22:44




I'd suggest you gogle for linux forensic distribution there are better choices for your task. For ubuntu a search for dsiable automount gets you some hits.
– LotPings
Dec 11 '16 at 22:44










2 Answers
2






active

oldest

votes


















0














So you want to recover disks without messing with their contents. Yes, mounting their filesystems will increment counters, and possibly damage an already damaged filesystem.



In this case you can't just run dd on a disk to prevent this from happening, because by the time you plug it in that system has already automatically mounted it. You will be using the new udisks system to auto-mount new volumes based on udev events. You can turn this functionality off entirely in your GUI.



Within "Settings" > "Removable Drives and Media": uncheck all of the "removable storage" boxes. This should disable the feature entirely.






share|improve this answer





















  • I can't find the "Settings" > "Removable Drives and Media" dialog you are mentioning. My Ubuntu system has a "System Settings" dialog but that page does not have a "Removable Drives and Media" dialog. I found a "Details" program having a "Removable Media" dialog but the "removable storage" check boxes do not exist.
    – nn4l
    Dec 11 '16 at 19:05



















0














The core of the automount system is probably the udisks system. The daemon process should be udisksd and the systemd service might be udisks2.service (at least on my Debian 9; the name might vary on Ubuntu).



Once you stop that service (e.g. with systemctl stop udisks2.service) the GUI session should be unable to auto-mount anything.



To make sure any other service does not reactivate it, you could mask it: systemctl mask udisks2.service.






share|improve this answer





















    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%2f333721%2fhow-to-stop-auto-mounting-of-devices-in-ubuntu%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown
























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    So you want to recover disks without messing with their contents. Yes, mounting their filesystems will increment counters, and possibly damage an already damaged filesystem.



    In this case you can't just run dd on a disk to prevent this from happening, because by the time you plug it in that system has already automatically mounted it. You will be using the new udisks system to auto-mount new volumes based on udev events. You can turn this functionality off entirely in your GUI.



    Within "Settings" > "Removable Drives and Media": uncheck all of the "removable storage" boxes. This should disable the feature entirely.






    share|improve this answer





















    • I can't find the "Settings" > "Removable Drives and Media" dialog you are mentioning. My Ubuntu system has a "System Settings" dialog but that page does not have a "Removable Drives and Media" dialog. I found a "Details" program having a "Removable Media" dialog but the "removable storage" check boxes do not exist.
      – nn4l
      Dec 11 '16 at 19:05
















    0














    So you want to recover disks without messing with their contents. Yes, mounting their filesystems will increment counters, and possibly damage an already damaged filesystem.



    In this case you can't just run dd on a disk to prevent this from happening, because by the time you plug it in that system has already automatically mounted it. You will be using the new udisks system to auto-mount new volumes based on udev events. You can turn this functionality off entirely in your GUI.



    Within "Settings" > "Removable Drives and Media": uncheck all of the "removable storage" boxes. This should disable the feature entirely.






    share|improve this answer





















    • I can't find the "Settings" > "Removable Drives and Media" dialog you are mentioning. My Ubuntu system has a "System Settings" dialog but that page does not have a "Removable Drives and Media" dialog. I found a "Details" program having a "Removable Media" dialog but the "removable storage" check boxes do not exist.
      – nn4l
      Dec 11 '16 at 19:05














    0












    0








    0






    So you want to recover disks without messing with their contents. Yes, mounting their filesystems will increment counters, and possibly damage an already damaged filesystem.



    In this case you can't just run dd on a disk to prevent this from happening, because by the time you plug it in that system has already automatically mounted it. You will be using the new udisks system to auto-mount new volumes based on udev events. You can turn this functionality off entirely in your GUI.



    Within "Settings" > "Removable Drives and Media": uncheck all of the "removable storage" boxes. This should disable the feature entirely.






    share|improve this answer












    So you want to recover disks without messing with their contents. Yes, mounting their filesystems will increment counters, and possibly damage an already damaged filesystem.



    In this case you can't just run dd on a disk to prevent this from happening, because by the time you plug it in that system has already automatically mounted it. You will be using the new udisks system to auto-mount new volumes based on udev events. You can turn this functionality off entirely in your GUI.



    Within "Settings" > "Removable Drives and Media": uncheck all of the "removable storage" boxes. This should disable the feature entirely.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 11 '16 at 17:39









    Spooler

    1765




    1765












    • I can't find the "Settings" > "Removable Drives and Media" dialog you are mentioning. My Ubuntu system has a "System Settings" dialog but that page does not have a "Removable Drives and Media" dialog. I found a "Details" program having a "Removable Media" dialog but the "removable storage" check boxes do not exist.
      – nn4l
      Dec 11 '16 at 19:05


















    • I can't find the "Settings" > "Removable Drives and Media" dialog you are mentioning. My Ubuntu system has a "System Settings" dialog but that page does not have a "Removable Drives and Media" dialog. I found a "Details" program having a "Removable Media" dialog but the "removable storage" check boxes do not exist.
      – nn4l
      Dec 11 '16 at 19:05
















    I can't find the "Settings" > "Removable Drives and Media" dialog you are mentioning. My Ubuntu system has a "System Settings" dialog but that page does not have a "Removable Drives and Media" dialog. I found a "Details" program having a "Removable Media" dialog but the "removable storage" check boxes do not exist.
    – nn4l
    Dec 11 '16 at 19:05




    I can't find the "Settings" > "Removable Drives and Media" dialog you are mentioning. My Ubuntu system has a "System Settings" dialog but that page does not have a "Removable Drives and Media" dialog. I found a "Details" program having a "Removable Media" dialog but the "removable storage" check boxes do not exist.
    – nn4l
    Dec 11 '16 at 19:05













    0














    The core of the automount system is probably the udisks system. The daemon process should be udisksd and the systemd service might be udisks2.service (at least on my Debian 9; the name might vary on Ubuntu).



    Once you stop that service (e.g. with systemctl stop udisks2.service) the GUI session should be unable to auto-mount anything.



    To make sure any other service does not reactivate it, you could mask it: systemctl mask udisks2.service.






    share|improve this answer


























      0














      The core of the automount system is probably the udisks system. The daemon process should be udisksd and the systemd service might be udisks2.service (at least on my Debian 9; the name might vary on Ubuntu).



      Once you stop that service (e.g. with systemctl stop udisks2.service) the GUI session should be unable to auto-mount anything.



      To make sure any other service does not reactivate it, you could mask it: systemctl mask udisks2.service.






      share|improve this answer
























        0












        0








        0






        The core of the automount system is probably the udisks system. The daemon process should be udisksd and the systemd service might be udisks2.service (at least on my Debian 9; the name might vary on Ubuntu).



        Once you stop that service (e.g. with systemctl stop udisks2.service) the GUI session should be unable to auto-mount anything.



        To make sure any other service does not reactivate it, you could mask it: systemctl mask udisks2.service.






        share|improve this answer












        The core of the automount system is probably the udisks system. The daemon process should be udisksd and the systemd service might be udisks2.service (at least on my Debian 9; the name might vary on Ubuntu).



        Once you stop that service (e.g. with systemctl stop udisks2.service) the GUI session should be unable to auto-mount anything.



        To make sure any other service does not reactivate it, you could mask it: systemctl mask udisks2.service.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 18 at 7:03









        telcoM

        15.7k12143




        15.7k12143






























            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.





            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%2funix.stackexchange.com%2fquestions%2f333721%2fhow-to-stop-auto-mounting-of-devices-in-ubuntu%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

            Morgemoulin

            Scott Moir

            Souastre