Sponsored Content
Operating Systems Linux Red Hat User and Group quota is not working on RHEL6.2 ext4/ext3 Post 302598514 by admin_xor on Tuesday 14th of February 2012 05:43:36 PM
Old 02-14-2012
Thank you linuxcricket!!

I tried setting the SELinux context as that of /var, but I still got permission denied while trying to set quota.

Code:
# chcon --reference=/var /u02
# r ls
ls -ldZ /u02
drwxr-xr-x. root root system_u:object_r:var_t:s0       /u02
# quotacheck -cug /u02
quotacheck: Cannot rename new quotafile /u02/aquota.user.new to name /u02/aquota.user: Permission denied
quotacheck: Cannot rename new quotafile /u02/aquota.group.new to name /u02/aquota.group: Permission denied

The system is registered with RedHat. But, I need to go through a lot of approval processes to log a ticket with RedHat support.

Anyways, I dug deeper and went through AVC denials by doing this:
Code:
sealert -a /var/log/audit/audit.log

It showed me the solution as:
Code:
SELinux is preventing /sbin/quotacheck from write access on the directory /u02.

*****  Plugin restorecon (82.4 confidence) suggests  *************************

If you want to fix the label.
/u02 default label should be default_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /u02

*****  Plugin file (7.05 confidence) suggests  *******************************

If this is caused by a newly created file system.
Then you need to add labels to it.
Do
/sbin/restorecon -R -v /u02

*****  Plugin file (7.05 confidence) suggests  *******************************

If you think this is caused by a badly mislabeled machine.
Then you need to fully relabel.
Do
touch /.autorelabel; reboot

*****  Plugin catchall_labels (4.59 confidence) suggests  ********************

If you want to allow quotacheck to have write access on the u02 directory
Then you need to change the label on /u02
Do
# semanage fcontext -a -t FILE_TYPE '/u02'
where FILE_TYPE is one of the following: boot_t, root_t, tmp_t, usr_t, var_t, mail_spool_t, etc_t, mqueue_spool_t, var_spool_t, home_root_t.
Then execute:
restorecon -v '/u02'


*****  Plugin catchall (1.31 confidence) suggests  ***************************

If you believe that quotacheck should be allowed write access on the u02 directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep quotacheck /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

I executed this:
Code:
grep quotacheck /var/log/audit/audit.log | audit2allow -M mypol
semodule -i mypol.pp

And it worked. I could run the quotacheck command without any problem. Thanks for your time to post here.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how can I check the user's mail quota?

how can I check mail quota, and then how can I send mail to user whose quota get full??? :confused: For this which script must I use? (8 Replies)
Discussion started by: emreatlier
8 Replies

2. Linux

How to set user quota

I've a redhat 9.0 and I want to set a user quota. but the question is where should I start from and How ??? :confused: :confused: :confused: :confused: (2 Replies)
Discussion started by: KaiXiang
2 Replies

3. UNIX for Advanced & Expert Users

Adding quota for a group

***deleted by reborg for rule 1 violation*** (1 Reply)
Discussion started by: manoranjan
1 Replies

4. UNIX for Dummies Questions & Answers

Enable user quota

hi! i would like to enable user quota on my system (FreeBSD 6.2) i've check on enabling user quota here but i still confuse with fstab it shows there: /dev/da1s2g /home ufs rw,userquota 1 2 but my current /etc/fstab : # Device Mountpoint FStype Options ... (1 Reply)
Discussion started by: rdns
1 Replies

5. Red Hat

User quota

Hi, I want to apply the user quota, but i am unable to apply the quota to user. Kindly provide the guide line, so that i can sortout the problem. Step 1: Create partion on device #fdisk /dev/sda (because hard disk is scsi) #n (new partition table) i.e /dev/sda8. #p ( to print the partition... (2 Replies)
Discussion started by: sahu.tapan
2 Replies

6. UNIX for Advanced & Expert Users

lvm user quota

Whats the best method of setting lvm user quota? I saw both of these and I am not sure which to use. Linux File System Quotas Howtos Linux-Vserver With LVM And Quotas - 5dollarwhitebox.org Media Wiki (1 Reply)
Discussion started by: cokedude
1 Replies

7. Red Hat

Convert ext4 to ext3

Is there any way to conver ext4 to ext3 filesystem without formatting the partition/disk .. Had ext3 filesystem and had converted it to ext4 by issuing following command # tune2fs -O extents,uninit_bg,dir_index /dev/sda1 # fsck -pf /dev/sda1 # blkid /dev/sda1 /dev/sda1:... (1 Reply)
Discussion started by: Shirishlnx
1 Replies

8. Linux

Quota issue on user belongs to multiple Group

I have setup a group quota for better disk usage. What i am doing is to setup a quota with Samba share. I created user1,user2 and group project1 which belongs to /home/project1 dir. Quota is implemented on project1 group to write 100 MB on this share and This is working fine if a user1 and user2... (3 Replies)
Discussion started by: sunnysthakur
3 Replies

9. Red Hat

Auto Increasing Quota for User.

Hi, I would like to know wheather we can increase the quota for particular user automatically? I am having requirement to increase the quota only for 2 days in a week. but that shoule be automatically instead of manualy modification. is it possible? (3 Replies)
Discussion started by: manoj.solaris
3 Replies

10. Red Hat

User is a Part of a Group But Group Details Do Not Show the User

Hi, In the following output you can see the the user "richard" is a member on the team/group "developers": # id richard uid=10247(richard) gid=100361(developers) groups=100361(developers),10053(testers) but in the following details of the said group (developers), the said user... (3 Replies)
Discussion started by: indiansoil
3 Replies
quotacheck(1M)						  System Administration Commands					    quotacheck(1M)

NAME
quotacheck - ufs file system quota consistency checker SYNOPSIS
quotacheck [-fp] [-v] filesystem... quotacheck -a [-fpv] DESCRIPTION
quotacheck examines each mounted ufs file system, builds a table of current disk usage, and compares this table against the information stored in the file system's disk quota file. If any inconsistencies are detected, both the quota file and the current system copy of the incorrect quotas are updated. filesystem is either a file system mount point or the block device on which the file system resides. quotacheck expects each file system to be checked to have a quota file named quotas in the root directory. If none is present, quotacheck will not check the file system. quotacheck accesses the character special device in calculating the actual disk usage for each user. Thus, the file systems that are checked should be quiescent while quotacheck is running. OPTIONS
The following options are supported: -a Check the file systems which /etc/mnttab indicates are ufs file systems. These file systems must be read-write mounted with disk quotas enabled, and have an rq entry in the mntopts field in /etc/vfstab. -f Force check on file systems with logging enabled. Use in combination with the -p option. -p Check quotas of file systems in parallel. For file systems with logging enabled, no check is performed unless the -f option is also specified. -v Indicate the calculated disk quotas for each user on a particular file system. quotacheck normally reports only those quotas modi- fied. USAGE
See largefile(5) for the description of the behavior of quotacheck when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). FILES
/etc/mnttab Mounted file systems /etc/vfstab List of default parameters for each file system ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
edquota(1M), quota(1M), quotaon(1M), repquota(1M), attributes(5), largefile(5), quotactl(7I), mount_ufs(1M) SunOS 5.10 31 Jul 1998 quotacheck(1M)
All times are GMT -4. The time now is 07:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy