Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I wanted to set ACL for a directory. For that it is important that the device should be mounted as acl on that directory.

But I do not want to add the acl mount in /etc/fstab. So I am tempoararily mounting the device to some temporary directory as acl and setting ACL and then unmounting it. Then, I'm mounting it to the original directory.

The code is below:

tmp="/tmp1/backup"
orig="/mnt1/backup"
dev="/dev/sda2"

mkdir -p $tmp
mkdir -p $orig
mount -o acl $dev $tmp
mkdir -p $tmp/stdsymp
chgrp 557 $tmp/stdsymp
setfacl -m g:599:r $tmp/stdsymp
umount $tmp

mount $dev $orig

ll /mnt/backup shows

drwxr-xr-x 2 root _nokfsuimanage  4096 Sep  8 09:37 stdsymp

The group is being changed, but ACL is not set for the directory. Where is the problem?

share|improve this question

migrated from stackoverflow.com Sep 8 '11 at 9:24

This question came from our site for professional and enthusiast programmers.

1 Answer 1

If you disable the acl option, it turns off all ACL-related operations – not just setting, but also testing and even reading ACLs. You will have to mount with acl in order for your changes to be visible.

If you for some curious reason do not want to edit fstab, you can enable the option in the superblock with tune2fs -o acl $dev, and it will be applied anywhere the disk is mounted. (This is limited to ext[234] filesystems, however.)

FYI, you do not need to mount/unmount/mount – you can reconfigure a mounted filesystem with mount -o remount,acl /mnt1/backup.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.