23

Is it enough to see getfacl giving no error, or do I have to check some other place to see whether or not ACLs are supported by the file systems?

4 Answers 4

11

If you're talking about a mounted filesystem, I don't know of any intrinsic way to tell whether ACL are possible. Note that “are ACL supported?” isn't a very precise question since there are several types of ACL around (Solaris/Linux/not-POSIX-after-all, NFSv4, OSX, …). Note that getfacl is useless as a test since it will happily report Unix permissions if that's all there is: you need to try setting an ACL to test.

Still on mounted filesystem, you can check for the presence of acl in the mount options (which you can find in /proc/mount). Note that this isn't enough: you also need to take the kernel version and the filesystem type in consideration. Some filesystem types always have ACL available, regardless of mount options; this is the case for tmpfs, xfs and zfs. Some filesystems have ACL unless explicitly excluded; this is the case for ext4 since kernel 2.6.39.

2
  • as for the getfacl test you're right. Except if I were able to find a non-default ACL (by suppressing default ones and header). Checking /proc/mount doesn't appear to be enough in cases where the acl option is a default option not coming from the mount command or fstab, though. Commented Dec 31, 2014 at 9:03
  • I noticed when running ZFS on Linux, with acltype=posixacl, the /proc/mounts will show posixacl, but in another system with just ext4, there's nothing inside /proc/mounts, but acl was a default mount option for ext4. Commented Aug 4, 2016 at 13:33
8

acl should be enabled as default if you are using ext2/3/4 or btrfs.

Check with:

tune2fs -l /dev/sdXY | grep "Default mount options:"

If it isn't in the output do a:

tune2fs -o acl /dev/sdXY

2
  • 2
    grep acl /etc/mke2fs.conf will do it too. Commented Dec 30, 2014 at 21:00
  • 1
    Examining /etc/mke2fs.conf only tells you what the defaults would be if you created a new filesystem now. It tells you nothing about the actual configuration used in the past when the filesystem was created (which is what tune2fs will do). Commented May 24, 2023 at 7:40
5

To know if ACL is available you can:

  1. Check current kernel version and filesystem:
    uname -r
    df -T or mount | grep root

    Recent distro have ACL mount option included by default (since kernel 2.6). So it's not mandatory to redefine it in /etc/fstab (or similar). Non exhaustive list of filesystems concerned: ext3, ext4, tmpfs, xfs and zfs .

    If you have older setup then you may have to recompile the kernel and/or add acl in /etc/fstab.
    fstab example: /dev/root / ext4 acl,errors=remount-ro 0 1

  2. Look for existing ACL settings (the "usual" config place is on /boot):
    sudo mount | grep -i acl #optionnal
    cat /boot/config* | grep _ACL

    Depending of the system you could find the settings in /procinstead. Here is a way to extract the config from the .gz archive and then search for acl settings:
    cat /proc/config.gz | gunzip > running.config && grep -i 'acl' running.config
    cat running.config | grep _ACL

    You should see something like:
    CONFIG_EXT3_FS_POSIX_ACL=y
    CONFIG_EXT2_FS_POSIX_ACL=y
    CONFIG_XFS_POSIX_ACL=y

    For the filesystem you can try to get more info with:
    sudo tune2fs -l /xxx/xxx| grep 'Default mount options:'
    (replace xxx/xxx by your filesystem)

--
Helpfull information can be found on:
- superuser.com,
- serverfault,
- bencane.com,
- wiki.archlinux.org

-1

XFS will support it by default, and you can verify that with:

grep default_mntopts /etc/mke2fs.conf
2
  • Examining /etc/mke2fs.conf only tells you what the defaults would be if you created a new filesystem now. It tells you nothing about the actual configuration used at the time the filesystem was created. Commented May 24, 2023 at 7:41
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented May 30, 2023 at 22:16

You must log in to answer this question.

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