LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to stop mounting all hard drives at startup in Ubuntu? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-stop-mounting-all-hard-drives-at-startup-in-ubuntu-4175508682/)

judoka 06-20-2014 07:57 PM

How to stop mounting all hard drives at startup in Ubuntu?
 
I am running Ubuntu precise (12.04).
I installed and ran ntfs-config because I was an error while trying to copy files from my hard drive to a usb device. After checking the
'enable write support for external file'
box that issue was fixed; however, all my hard drives got mounted for some reason. I unmounted them with:
$ sudo umount /dev/...
but when I restart the computer they are all monted again. Is there a way to make sure that they don't mount upon startup?

frankbell 06-20-2014 08:08 PM

If they are in /etc/fstab, you could set the mount to "noauto."

Here's a line from my fstab. Where it says "auto," substitute "noauto." Then you will have to mount them manually, either from the command line or through the file manager:

Code:

UUID=7900ade7-de36-41e5-88b5-2d7aaa8adcd4      /media/sdb5    ext3    rw,user,auto    0      1
If the entry in your fstab is significantly different, post it here and we'll help you.

You can learn more about fstab here: http://pclosmag.com/html/Issues/200709/page07.html

judoka 06-20-2014 08:27 PM

Thanks for your quick reply; unfortunatelly, I don't see 'auto' option anywhere, so would really appreciate your help. Here's the file's contents. Out of the once listed I only need sde5 mounted.

Code:

# /etc/fstab: static file system information.
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>

proc        /proc        proc        nodev,noexec,nosuid        0        0
#Entry for /dev/sde5 :


michaelk 06-20-2014 08:44 PM

defaults is actually many options i.e.
rw, suid, dev, exec, auto, nouser, async, and relatime

The simplest would be to use defaults,noauto. The noauto takes precedence over the defaults.

frankbell 06-20-2014 09:16 PM

I was thinking I should have said more, and I see that michaelk has added a most useful post.

If you are not sure which partition is represented by a particular entry in your fstab, you can use the blkid command. For example:

Code:

$ /sbin/blkid
/dev/sda1: UUID="ad52eed9-c80c-41fe-81a6-e8a9a71e6f19" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="35f7217b-f73b-4cd1-b513-571bd0482a18"
/dev/sdb1: UUID="1655a198-15a7-471f-9e99-e3fc9fd92ca0" TYPE="ext3"
/dev/sdb5: UUID="7900ade7-de36-41e5-88b5-2d7aaa8adcd4" TYPE="ext3"


jefro 06-20-2014 09:27 PM

Isn't there something about automounting usb media?

michaelk 06-20-2014 09:50 PM

Yes... You can disable the gnome automount setting via gui dconf-editor or the CLI tool gsettings. I assume that you are using gnome.

settings set org.gnome.desktop.media-handling automount false

judoka 06-21-2014 12:13 AM

I tried installing dconf-editor and unchecking the box for 'org.gnome.desktop.media-handling automount' but to no avail. I'm afraid to mess with /etc/fstab file without really knowing what I am doing. From the posts above I gather that I can substitute
Code:

defaults,noauto
where ever I have
Code:

defaults,nls=utf8,umask=0222
that is do I do change the previous line to example 1:
Code:

defaults,noauto,nls=utf8,umask=0222
or to example 2:
Code:

noauto,nls=utf8,umask=0222
Also I think that the problem that I am experiencing now is a result of installing ntfs-config which overwrote my original /etc/fstab is there a way to get those settings back?

UPDATE: Okay I looked in the /etc and found a file called fstab-ntfs-cofig-save so I just replaced the fstab file with it and everything started working as desired :)


All times are GMT -5. The time now is 10:30 PM.