Specifically, I'm looking for a way to change the 'noexec' flag, which seems to be the current default, to 'exec' for any USB device when it is first mounted. At the moment, I have to do this manually using the command 'mount -o remount,exec /media/removable/nameofusb' every time I boot the system.

Whilst I could add this to the list of autostart applications (this USB is rarely removed from my Chromebook), I would like to change the default options for any device so that files on them can be executed without manually changing this.

I am running Ubuntu 14.04 (xfce) on an Acer Chromebook 14 using crouton.


any USB device when it is first mounted

this USB is rarely removed from my Chromebook

ok so in theory it might be feasible to disable the auto-mounting, which is performed by your graphical desktop environment (XFCE). then you can configure your own automounter in such a way to use the options you desire

What would be much simpler is to create an /etc/fstab entry for your specific USB device.

Editing /etc/fstab could potentially cause your system boot to fail. GNOME Disks provides a GUI for it though. Select the device in the left pane, select the filesystem ("Volume") in the main pane, click on the cog button below, and select "edit mount options". The box for mount options sadly appears to be the unlabeled one, but the default contents will hopefully look familiar. E.g. "nosuid,nodev,nofail,x-gvfs-show".

The Ubuntu package to install for GNOME Disks is called gnome-disk-utility. You can run it using the gnome-disks command.

GNOME Disks does not have an XFCE equivalent, it can be used for a number of tasks, so if it doesn't require too many other packages then you might well want to keep it installed.

  • Thanks for the answer; so it sounds like changing this so files can be executed from any device is somewhat complicated for me at the moment; however, the fstab solution could well solve the current issue. I have fount a folder in the specified location; however, this is currently empty. Do I need to install GNOME disks to be able to edit mount options as I can't seem to find this option in the default file explorer? – Revilo Oct 28 '16 at 18:44
  • that's what I tried to write :). if you prefer you can edit /etc/fstab manually. the instructions for gnome disks are simpler for me to write out, you can look at /etc/fstab afterwards and see pretty much what it does. you'll see the usb filesystem will be identified by a UUID, which could be read out of lsblk -f. – sourcejedi Oct 28 '16 at 18:59
  • OK, so I've installed GNOME disks and have added 'exec' to the list of options ('nosuid,nodev etc.) but no change unfortunately. Maybe I added it incorrectly: I first set automatic mount options to OFF as with this on I was unable to edit any fields, then added 'exec' to the end of the list of mount options, as well as checking the 'mount on startup' box. I then exited and re-entered ubuntu to make sure it mounted with these settings but no change... – Revilo Oct 29 '16 at 20:14
  • I'm sorry to hear that. To refresh the settings, you don't need to reboot, just unmount ("safely remove") the device, and remount it. (GUI users may be forced to unplug and replug the device). 1) I am not certain that logging out and back in without a reboot would work though. 2) Are your custom settings still visible in GNOME Disks? Looking at the dialog again, I have missed a step that could be important. Where it says "Identify As", I would prefer the line UUID=.... – sourcejedi Oct 29 '16 at 20:31
  • 2b) before trying to change the "Identify As" line, I think you should check /etc/fstab and remove the old line that was added. Hopefully it will be clear from the path. – sourcejedi Oct 29 '16 at 20:31

You can edit the fstab using the command gksudo leafpad /etc/fstab.


  1. Identify the USB filesystem. Use lsblk -f to find the UUID of the filesystem. (For basic FAT filesystems, it won't be a real UUID; it will be shorter and numeric only).

  2. Create a permanent mount point for the filesystem. Don't try to create it under a temporary filesystem like /run :). You can double-check whether e.g. /media is a tmpfs by checking findmnt for a /media entry. (The FSTYPE column would show tmpfs). It's a question of taste, but I would use sudo mkdir -p /mnt/nameofusb.

  3. Choose your options.

    • nofail to make sure failure at boot time does not cause a failure to boot.
    • user to allow your unprivileged user to mount the device.
    • exec is not necessary because it is part of the default, according to man fstab.
    • errors=remount-ro is a commonly used, when a device starts to fail it will stop you writing to it, generally preventing further data loss (and giving you a nice clear signal).
    • On basic FAT (type vfat) filesystems you will want a number of FAT-specific options. It would be simplest to copy the list of options from mount beforehand. uhelper=udisks2 should probably be removed :). You wanted to remove noexec specifically. On my distribution I see showexec instead, you would have wanted to remove this too (meaning explained in man fstab; type in `/showexec' + enter to search).

The fstab line to add looks like this:

UUID=6132-6337 /mnt/nameofusb auto nofail,user,errors=remount-ro 0 0

The GUI should respect this setting if you safely remove + re-insert the device.

Manual commands could be useful for debugging if the GUI doesn't behave as expected:

  • sudo mount or findmnt to list mounted filesystems
  • sudo umount /media/removable/nameofusb to unmount a filesystem.
  • sudo mount /mnt/nameofusb to mount a filesystem according to /etc/fstab
  • lsblk -f will show the current NAME of all block devices.
  • udisksctl mount -b /dev/sdb1 will mount the block device named sdb1, via the same udisks daemon which the GUI sends requests to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.