2

I'm working with ACLs on CentOS 7 and noticed that the partition (/) where ACLs are applied is mounted with defaults options.

As far as I know ACLs need that the acl option is enabled in the mount, and defaults = rw, suid, dev, exec, auto, nouser, async.

Does defaults include acl now and if yes, since which distro version?

EDIT: Just found that XFS has native support for ACLs, and XFS is the standard filesystem in CentOS 7, which explains everything.

EDIT 2: However, I just tested that ACLs are maintained - even after reboot - in an ext4 filesystem with no explicit acl mount option. Why is that?

1
  • I don't have the reference handy or I'd write an answer, but acl became a default option for ext4 years ago. It might even have been true in CentOS 6. Jan 20, 2016 at 22:24

2 Answers 2

2

For ext2/ext3/ext4 filesystems, the defaults option means "use the default mount options as specified by the filesystem itself", and those default mount options can be viewed and modified using the tune2fs command.

For example:

tune2fs -l <device containing an ext4 filesystem> | grep "Default mount options"
Default mount options:    user_xattr acl

If you wanted to remove acl from the default mount options, you could do it like this:

tune2fs -o ^acl <device containing an ext4 filesystem>

I think a modern mke2fs now sets acl in default mount options automatically at filesystem creation time, at least in "enterprise" Linux distributions; however, this is likely to be tweakable at mke2fs compilation time, and other distributions may have made different choices.

2

The exact meaning of "defaults" varies from filesystem to filesystem and from kernel version to kernel version. You can't depend on "defaults" not including "acl", but you also can't depend on it being included.

If you want to be sure, you'll have to specify it explicitly.

From man mount:

defaults
       (...) Note that the real set of the all default mount options depends on
       kernel and filesystem type. See the begin of this section for more details.

You must log in to answer this question.

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