Hello!
I am in a weird problem of not able to set quota on an ext4 file system. I have setup a logical volume on which this ext4 filesystem resides. It's going to be used by an application for dumping data. But we want to setup quota so that it does not consume all the free space of the lv. The application will generate an error log if the quota limit is crossed. But the problem is that I am not able to set quota on the filesystem.
Here's the mount options used:
# mount | grep u02
/dev/mapper/vg_app-lv_app on /u02 type ext4 (rw,acl,usrquota,grpquota)
Here's what I get when trying to enable quota:
# quotacheck -cug /u02
quotacheck: Cannot create new quotafile /u02/aquota.user.new: Permission denied
quotacheck: Cannot initialize IO on new quotafile: Permission denied
quotacheck: Cannot create new quotafile /u02/aquota.group.new: Permission denied
quotacheck: Cannot initialize IO on new quotafile: Permission denied
Here's the permissions on the /u02 directory:
# ls -ld /u02
drwxr-xr-x. 4 root root 4096 Feb 13 18:38 /u02
# getfacl /u02
getfacl: Removing leading '/' from absolute path names
# file: u02
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
dmesg | tail gives a hint that SELinux is using xattr on this filesystem:
EXT4-fs (dm-1): mounted filesystem with ordered data mode
SELinux: initialized (dev dm-1, type ext4), uses xattr
SELinux is set to enforcing. After setting SELinux to permissive mode, I was actually able to run the quotacheck command. But, I need to figure out a solution for this as SELinux has to be set to Enforcing as per the company policy.
There's no boolean for quota:
# getsebool -a | grep quota
#
SELinux context for the directory is like this:
# ls -ldZ /u02
drwxr-xr-x. root root system_u:object_r:file_t:s0 /u02
My guess is that this xattr thingy is causing the problem. Anyone has any idea what it is and how I can do my job without having to set SELinux to permissive mode? Thanks.