When attempting to modify ACL permissions with setfacl --modify=g:adm:rw x.txt
on an older Ubuntu system (2.6.31 kernel), you're encountering a fundamental compatibility issue. The error suggests either:
1. The filesystem doesn't support ACLs (ext2/ext3 without acl mount option)
2. ACL kernel support isn't enabled
3. The specific inode implementation has restrictions
First confirm your filesystem type and mount options:
# Check filesystem type
df -Th x.txt
# Verify mount options
grep x.txt /proc/mounts
# OR for the entire filesystem
mount | grep "on / "
For ext3/ext4 filesystems, you should see acl
in the options. If missing, remount with:
sudo mount -o remount,acl /
On legacy systems (especially 2.6 kernels), check kernel config:
grep -i acl /boot/config-$(uname -r)
# Look for:
# CONFIG_EXT4_FS_POSIX_ACL=y
# CONFIG_XFS_POSIX_ACL=y
# CONFIG_BTRFS_FS_POSIX_ACL=y
Option 1: Classic Unix Permissions
When ACLs aren't available, use traditional group permissions:
sudo chgrp adm x.txt
chmod g+rw x.txt
Option 2: Filesystem Migration
For modern ACL support, consider upgrading to ext4 with:
sudo tune2fs -o acl /dev/sdXN
sudo mount -o remount,acl /path
Create a test file on different filesystems to isolate the issue:
# tmpfs test
mount -t tmpfs -o size=1m tmpfs /mnt/tmp
touch /mnt/tmp/acltest
setfacl -m g:adm:rw /mnt/tmp/acltest
If this works, your main filesystem needs reconfiguration.
The 2.6.31 kernel (2009) had varying ACL support across filesystems. Notable implementation differences existed between:
- ext3 (needed explicit mount option)
- XFS (generally better ACL support)
- ReiserFS (limited implementations)
When working with older Linux distributions (like Ubuntu with 2.6.31 kernel), you might encounter the frustrating "Operation not supported" error when trying to modify file ACLs. Let's examine the specific case:
$ getfacl x.txt
# file: x.txt
# owner: cwhii
# group: cwhii
user::rw-
group::r--
other::r--
$ setfacl --modify=g:adm:rw x.txt
setfacl: x.txt: Operation not supported
This error typically occurs when the underlying filesystem doesn't support ACLs. The 2.6.31 kernel era often used ext3 by default, which requires explicit ACL enablement.
First, check if your filesystem supports ACLs:
$ tune2fs -l /dev/sda1 | grep "Default mount options"
Default mount options: user_xattr acl
If "acl" isn't listed, we need to either remount the partition or modify fstab.
Edit your /etc/fstab file and add the acl option:
# Before
UUID=xxxx-xxxx-xxxx / ext3 defaults 0 1
# After
UUID=xxxx-xxxx-xxxx / ext3 defaults,acl 0 1
Then remount the filesystem:
$ mount -o remount /
For immediate testing without reboot:
$ mount -o remount,acl /
After implementing the solution, retry your ACL modification:
$ setfacl --modify=g:adm:rw x.txt
$ getfacl x.txt
# file: x.txt
# owner: cwhii
# group: cwhii
user::rw-
group::r--
group:adm:rw-
mask::rw-
other::r--
For modern systems, consider upgrading to ext4 which has ACL support enabled by default. Conversion command:
$ tune2fs -O acl,user_xattr /dev/sdXN