18.2.1 About Mount Options

To modify the behavior of mount, use the -o flag followed by a comma-separated list of options or specify the options in the /etc/fstab file. The following are some of the options that are available:

auto

Allows the file system to be mounted automatically by using the mount -a command.

exec

Allows the execution of any binary files located in the file system.

loop

Uses a loop device (/dev/loop*) to mount a file that contains a file system image. See Section 18.5, “Mounting a File Containing a File System Image”, Section 18.6, “Creating a File System on a File”, and the losetup(8) manual page.

Note

The default number of available loop devices is 8. You can use the kernel boot parameter max_loop=N to configure up to 255 devices. Alternatively, add the following entry to /etc/modprobe.conf:

options loop max_loop=N

where N is the number of loop devices that you require (from 0 to 255), and reboot the system.

noauto

Disallows the file system from being mounted automatically by using mount -a.

noexec

Disallows the execution of any binary files located in the file system.

nouser

Disallows any user other than root from mounting or unmounting the file system.

remount

Remounts the file system if it is already mounted. You would usually combine this option with another option such as ro or rw to change the behavior of a mounted file system.

ro

Mounts a file system as read-only.

rw

Mounts a file system for reading and writing.

user

Allows any user to mount or unmount the file system.

For example, mount /dev/sdd1 as /test with read-only access and only root permitted to mount or unmount the file system:

# mount -o nouser,ro /dev/sdd1 /test

Mount an ISO image file on /mount/cdrom with read-only access by using the loop device:

# mount -o ro,loop ./OracleLinux-R6-U1-Server-x86_64-dvd.iso /media/cdrom

Remount the /test file system with both read and write access, but do not permit the execution of any binary files that are located in the file system:

# mount -o remount,rw,noexec /test