Ubuntu – setting mount options on an USB drive automounted by Gnome

automountgnomeusb-drive

My USB drive is currently automounted correctly under Gnome (Ubuntu 18.04), but I want to set the "noatime" option at mount.

I know I can do this via the Gnome "disks" untility, but I prefer to document in code what I did to set up my system, so I'm looking for the command-line way to do this.

Best Answer

First run df to see what device your external drive is, for example, for me the appropriate line looks like this:

/dev/sdc1              4883769340 2392246688 2491522652  49% /media/drew/LACIE-5GB

/media/drew/LACIE-5GB is where the disk got mounted and the appropriate device is /dev/sdc1 - this can change depending on how many external drives you have and in what order they were connected.

blkid /dev/sdc1
/dev/sdc1: LABEL="LACIE-5GB" UUID="703C31971BEBAA7E" TYPE="ntfs" PTTYPE="dos" PARTLABEL="LACIE-5GB" PARTUUID="6afdadd9-39ce-4875-b747-82cae734ae02"

The UUID is 703C31971BEBAA7E

So one can put a line like this into fstav:

UUID=703C31971BEBAA7E   /media/drew/LACIE-5GB   ntfs    defaults,noauto,noatime,uid=1000,gid=1000,umask=0000,fmask=0111      0       0

Note that noauto is important - if the drive is not connected on startup and that option is not present, the boot halts and needs to be manually restarted. uid=1000,gid=1000,umask=0000,fmask=0111 are just options for NTFS not to make every file executable (which prompts Nautilus to ask if a file is to be displayed or run when I try to read a txt file, for example). noatime is the option originally requested.