Things grow tedious quickly when playing with a massive tool like mount. With different filesystem types and different settings for each filesystem, mount stood the test of time. I wonder how mount knows which default settings when mounting a filesystem. Aside from the fact the udisksd daemon automatically mounts fielsystems, how does mount determine the appropriate settings when mounting a filesystem without options like the following:

# mount /dev/sdc /media/usb_drive

What we're particularly interested at is the long options of mount such as (ro, rw, noexec, exec, nodev,...). As seen above, the command doesn't list any long options:

$ mount | grep /dev/sdc
/dev/sdc on /media/usb_drive type ext4 (rw,relatime,data=ordered)

You can see some options were used by default for the ext4 filesystem when mounting /dev/sdc: (rw,relatime,data=ordered). Though, there's no entry for /dev/sdc in fstab. Notice that the filesystem lives on the whole usb drive not on a partition. The above command looks like as if we ran this command:

# mount /dev/sdc /media/usb_drive -o rw,relatime,data=ordered 

What is the mechanism that mount uses to determine the appropriate default mounting options?

2 Answers 2


On Linux at least, any defaults are either hard coded into:

  1. The mount command itself
  2. The filesystem specific mount helper (mount.ext4 in this case).
  3. The generic VFS layer mount function in the kernel
  4. The filesystem specific mount function in the kernel

relatime falls under case 3, and is actually a common location for people to locally patch in custom kernels (usually it gets patched to default to noatime). rw is also case 3, but it can be overridden by the FS specific mount function in the kernel.

data=ordered is from 4, is ext* specific, and can be changed at build time to data=writeback if you're building your own kernel (and may be different on some distros).

The exact list you get for default options will vary by filesystem type (BTRFS has a different set other than rw,relatime than ext4 for example), by specifics of the filesystem (you can embed some default options in the superblock for ext4), and sometimes even by hardware (BTRFS tries to guess if you have an SSD and will add the FS specific ssd mount option if it thinks you do).

The situation is pretty similar on most other systems as well, although on some older UNIX systems mount ends up just being a multiplexer for FS specific mount commands.

  • 2
    data=ordered default comes from the kernel (where it can be changed at build time): ext4.wiki.kernel.org/index.php/…
    – sourcejedi
    Aug 16, 2017 at 12:02
  • 1
    Thanks for pointing that out, I completely forgot about it. I've updated my answer with that info. Aug 16, 2017 at 12:16

This is from the mount(8) manual on an Ubuntu system:


Some of these options are only useful when they appear in the /etc/fstab file.

Some of these options could be enabled or disabled by default in the system kernel. To check the current setting see the options in /proc/mounts. Note that filesystems also have per-filesystem specific default mount options (see for example tune2fs -l output for extN filesystems).

The equivalent manual on e.g. OpenBSD makes it clear that the options listed in the manual are for setting non-default mount options. So there's a softdep and an noatime option since nosoftdep and atime is the default, for example.

  • 1
    Coincidentally I came across that paragraph just now. Could you clarify the last sentence in you answer?
    – direprobs
    Aug 16, 2017 at 11:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .