mount options shown in /proc/mounts

IIRC then the mount options shown in /proc/mounts have changed. Some time ago acl and user_xattr were shown, now it seems that only noacl and nouser_xattr are shown if these features are turned off.

Where is this configured? Does that depend on the compiled-in defaults of the filesystem code? How can I check whether a volume supports e.g. ACL? Is there a better solution than testing with setfacl, getfacl?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Upstream decided to enable acl and user_xattr by default and remove them as mount options (noacl / nouser_xattr are still valid mount options hence they are shown).

Method 2

Some filesystem types support ACLs with no mount option, others only with a mount option. For ext2/ext3/ext4, some default mount options including acl/noacl are stored in the filesystem (you can see this in tune2fs -l /dev/BLOCK_DEVICE | grep '^Default mount options:'). As noted by don_crissti, for ext4, whether the option is shown or not depends on the kernel version (since kernel 2.6.39, acl defaults on no matter what the filesystem says). Filesystems such as vfat and minix have no ACL support. Filesystems such as tmpfs, xfs and zfs always support ACLs.

Unless you want to build and maintain a big table of filesystem types, versions, commands to check defaults, and kernel versions, there is no way to determine whether a filesystem supports ACLs via mount options or filesystem characteristics. You can’t tell by pure observation with getfacl either as it will always at least report unix permissions. Even if a filesystem supports ACLs, it may not support the ACL types that you want. So your best bet is to call setfacl (or the underlying C APIs) to try to set the ACL you want. If the error status is EOPNOTSUPP (Operation not supported), you’ll know that the filesystem doesn’t support (this type of) ACLs.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x