mount - How to prevent partitions from being mounted automatically in Linux(Mint)?

28
2013-08
  • HardwareMuch

    I have a Linux(Mint)/Windows dual boot PC. Checked /etc/fstab and their are no entries for the Windows and System Reserved partition. Don't really understand how it's happening. Any other place I can look at?

  • Answers
  • drednout

    Perhaps ntfs-config utility does this automounting. See http://www.dedoimedo.com/computers/automount_ntfs.html for additional information.

  • Dave York

    cd /etc

    sudo find | grep autofs

    Check that file, it is autofs mounting them. Sry I would go into detail but I'm driving...

  • DragonLord

    By default, Linux is aware of the other partition(s) but does not mount them for you. To see what partitions exist, open a terminal and type:

    sudo fdisk -l
    

    which lists out the partitions. You should see some NTFS ones, note which device(s) they are. On my system it was /dev/sda2. Again from the terminal, create a folder for the mountpoint under Linus, thus:

    sudo mkdir /mnt/windows
    

    Now you add the NTFS partition as an entry to the File System Table file, /etc/fstab. Depending on what editor came with your Linux or what you installed/like, edit the fstab file. My example shows gedit:

    sudo gedit /etc/fstab
    

    At the end, add a new line for the NFTS partition, separate fields with tab:

    /dev/sda2  /mnt/windows  ntfs  umask=000,defaults  0  0
    

    Save the changes and close the editor. Next time you restart the NTFS partition should mount automatically and you can access the files through the folder /mnt/windows. To mount this now, type in:

    sudo mount -a
    
  • J H

    I had a similar issue recently while installing Mint over a system that'd previously been running Ubuntu. Would be nice if someone could confirm, but it appears to have been caused by the Mint installer automounting the swap portion of that partition.


  • Related Question

    Prevent a partition on a USB drive auto-mounting in Linux
  • Questioner

    On Linux (Gnome desktop) how do you prevent one of the partitions on an external USB drive auto-mounting when it attached to the machine?

    I don't just want to prevent the Nautilus window from popping up -- I want that partition not to mount.

    Fiddling with /etc/fstab is not acceptable, as this is a removable drive that is attached to different machines.

    I seem to remember that you create a hidden file in the root of the file system, but I can't remember what it's called. Something like:

    touch /media/usbdisk/.no-mount
    

    How do you actually make this work?


  • Related Answers
  • Andrew Koester

    To read that file, the partition would have to be mounted. The auto-mounting is a feature of the operating system (actually hotplug, or some other service monitoring USB) and has to be turned off per-machine.

  • nagul

    If you're specifically worried about auto-mounting in gnome, and would rather not touch /etc/fstab, try the following command to turn it off for a specific partition:

    gnome-mount --write-settings --mount-options noauto --device /dev/sda1
    

    If you no longer want this to happen, erase the settings:

    gnome-mount --erase-settings --device /dev/sda1
    

    I also think you can turn off auto-mount altogether through the gconf-editor utililty: *desktop > gnome > volume_manager > automount_media*

    I'm not aware of any way to have the auto-mount daemon look for a file on the drive and unmount the drive on finding it, though I can see the utility in having something like this.