Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
errors with user quotas
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Frautoincnam
Guru
Guru


Joined: 19 May 2017
Posts: 324

PostPosted: Fri Mar 15, 2024 3:06 am    Post subject: errors with user quotas Reply with quote

Hi,

A long time ago, I set up user quotas on my /home. But for a while now I've had boot warnings telling me about obsolete concepts.
So I decided to start from 0 by following https://wiki.gentoo.org/wiki/Disk_quotas#Group_quotas_.28local_system.29
But is this documentation up to date?
If yes, why jqfmt=vfsv0 and not jqfmt=vfsv1?

I have the correct options in the kernel.
I activated quotas on the FS with tune2fs -O quota /dev/md126
In fstab I have:
Code:
/dev/md126 /home ext4 noatime,acl,usrquota,jqfmt=vfsv0 1 2

Code:
/etc/conf.d/quota
RUN_QUOTACHECK="yes"
QUOTACHECK_OPTS="-avu"
QUOTAON_OPTS="-avu"
QUOTAOFF_OPTS="-avu"

Code:
# quotaon --print-state --all
group quota on /home (/dev/md126) is on
user quota on /home (/dev/md126) is on
project quota on /home (/dev/md126) is off

Code:
# LANG=C repquota -as
*** Report for user quotas on device /dev/md126
Block grace time: 7days; Inode grace time: 7days
                         Space limits File limits
User used soft hard grace used soft hard grace
-------------------------------------------------- --------------------
root -- 4000K 0K 0K 44 0 0
wizd -- 152K 0K 0K 11 0 0
spamd -- 23396K 0K 0K 10 0 0
chris -- 6874M 9766M 11719M 114k 0 0
christophe -- 536M 684M 782M 5537 0 0
fail2ban -- 16K 0K 0K 4 0 0
ilian -- 113M 167M 215M 4182 0 0
jean-didier -- 646M 831M 879M 8132 0 0
linda -- 39552K 60000K 70000K 417 0 0
mailing_list -- 744K 0K 0K 74 0 0
novazur -- 1268K 0K 0K 202 0 0
regine -- 8622M 11719M 13672M 99931 0 0
spam -- 8K 0K 0K 2 0 0
kevin -- 3324M 4883M 5860M 45322 0 0

Code:
# LANG=C quotastats
Kernel quota version: 6.5.1
Number of dquot lookups: 21195
Number of dquot drops: 19771
Number of dquot reads: 17
Number of dquot writes: 82509
Number of quotafile syncs: 0
Number of dquot cache hits: 21178
Number of allocated dquotes: 17
Number of free dquotes: 11
Number of in use dquot entries (user/group): 6

I can perfectly update quotas with setquota and edquota. Everything works, except that I have error messages that I don't understand:
First, the mount options do not mention journaled quota support (jqfmt option of fstab)
Code:
# mount | grep /home
/dev/md126 on /home type ext4 (rw,noatime,quota,usrquota)

And then :
Code:
# rc-service quota start
  * Checking quotas (may take a while)...
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option. [!! ]
  *Starting quota...
/dev/md126 [/home]: user quotas enabled [ok]

Or
Code:
# quotacheck -u /home
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

I don't understand what's wrong.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5065
Location: Bavaria

PostPosted: Fri Mar 15, 2024 2:06 pm    Post subject: Reply with quote

Do you have quota support in your kernel ?
Code:
File systems  --->
    [*] Quota support
    [*] Report quota messages through netlink interface
    [*] Quota format vfsv0 and vfsv1 support

_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Frautoincnam
Guru
Guru


Joined: 19 May 2017
Posts: 324

PostPosted: Fri Mar 15, 2024 2:10 pm    Post subject: Re: errors with user quotas Reply with quote

As said in my first message

Frautoincnam wrote:
I have the correct options in the kernel.


Code:
# grep QUOTA /usr/src/linux/.config
CONFIG_NETFILTER_XT_MATCH_QUOTA=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
CONFIG_QUOTACTL=y
# CONFIG_TMPFS_QUOTA is not set
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5065
Location: Bavaria

PostPosted: Sat Mar 16, 2024 2:33 am    Post subject: Re: errors with user quotas Reply with quote

Frautoincnam wrote:
As said in my first message

I'm sorry, I didn't read it. Unfortunately I can't help anymore; we need an expert for quotas.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Frautoincnam
Guru
Guru


Joined: 19 May 2017
Posts: 324

PostPosted: Wed Aug 21, 2024 9:24 pm    Post subject: Reply with quote

5 months later, I still have the same error and never found a solution.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20476

PostPosted: Wed Aug 21, 2024 11:31 pm    Post subject: Reply with quote

Frautoincnam wrote:
First, the mount options do not mention journaled quota support (jqfmt option of fstab)
That may be related to default behavior...

From the ext4 man page:
Code:
usrjquota=aquota.user|grpjquota=aquota.group
       For journaled quotas (jqfmt=vfsv0 or jqfmt=vfsv1), the mount options usrjquota=aquota.user and grpjquota=aquota.group are required
       to tell the quota system which quota database files to use. When the quota file system feature is enabled, journaled quotas are used
       automatically, and this mount option is ignored.
The man page also mentions that usrquota is the same as quota. Maybe try with only one of them?

Does tune2fs -l /dev/md126 mention anything about quotas?

Maybe strace will help? strace -f quotacheck -u /home

strace can be verbose, so it may benefit from using wgetpaste. For example, append the following to the command to save it to a file: 2>&1 | tee strace-quotacheck.out
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Frautoincnam
Guru
Guru


Joined: 19 May 2017
Posts: 324

PostPosted: Thu Aug 22, 2024 7:40 pm    Post subject: Reply with quote

pjp wrote:
The man page also mentions that usrquota is the same as quota. Maybe try with only one of them?

Using usrquota or quota as option gives the same result. Both are in mount result.
Actually, only that line permits to mount /home:
(1)
Code:
/dev/md126              /home           ext4            noatime,acl,usrquota    1 2


With all others syntaxes:
Code:
#/dev/md126             /home           ext4            noatime,acl,usrjquota=aquota.user,grpjquota=quota.group,jqfmt=vfsv0     1 2
#/dev/md126             /home           ext4            noatime,acl,usrquota,jqfmt=vfsv1        1 2
#/dev/md126             /home           ext4            noatime,acl,usrquota,jqfmt=vfsv0        1 2

I have an error:
Code:
LANG=C mount -o remount /home
mount: /home: mount point not mounted or bad option.
       dmesg(1) may have more information after failed mount system call.


And with (1), I get:
Code:
# mount | grep /home
/dev/md126 on /home type ext4 (rw,noatime,quota,usrquota)


I feel like I'm using 2 different quota systems (kernel and other) which means that although it works, I still get errors on a command. But what should I remove to no longer have errors and for it to continue working?
If I remove sys-fs/quota I won't have tool to manage anymore.
Should I simply remove /etc/init.d/quota at start ?

I realize that remouting a system doesn't remove quota option. To test, I added quota option to /var, but after removing the option in fstab and remounting /var, the option is still active.
Code:
# grep /dev/md127 /etc/fstab
/dev/md127              /var            ext4            noatime,acl,user_xattr  1 2
# LANG=C mount -o remount /var
# mount | grep /dev/md127
/dev/md127 on /var type ext4 (rw,noatime,quota,usrquota)

This doesn't help to test. It's a server, can't reboot at each test.

Quote:
Does tune2fs -l /dev/md126 mention anything about quotas?

Yes it does.
Code:
# tune2fs -l /dev/md126 | grep -i quota
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize quota
User quota inode:         3
Group quota inode:        4


Quote:
Maybe strace will help? strace -f quotacheck -u /home

Code:
# LANG=C strace -f quotacheck -u /home
execve("/usr/bin/quotacheck", ["quotacheck", "-u", "/home"], 0x7ffec21d1f08 /* 44 vars */) = 0
brk(NULL)                               = 0x56237b24f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=43014, ...}) = 0
mmap(NULL, 43014, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7faecf41b000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/libext2fs.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=442720, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faecf419000
mmap(NULL, 445296, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7faecf3ac000
mmap(0x7faecf3ba000, 229376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe000) = 0x7faecf3ba000
mmap(0x7faecf3f2000, 147456, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x46000) = 0x7faecf3f2000
mmap(0x7faecf416000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x69000) = 0x7faecf416000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/libtirpc.so.3", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=165960, ...}) = 0
mmap(NULL, 167128, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7faecf383000
mmap(0x7faecf38a000, 98304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7faecf38a000
mmap(0x7faecf3a2000, 32768, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7faecf3a2000
mmap(0x7faecf3aa000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x27000) = 0x7faecf3aa000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20e\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
fstat(3, {st_mode=S_IFREG|0755, st_size=1937664, ...}) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 1964912, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7faecf1a3000
mmap(0x7faecf1c7000, 1417216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x24000) = 0x7faecf1c7000
mmap(0x7faecf321000, 344064, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17e000) = 0x7faecf321000
mmap(0x7faecf375000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d2000) = 0x7faecf375000
mmap(0x7faecf37b000, 31600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7faecf37b000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/libcom_err.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=22456, ...}) = 0
mmap(NULL, 24648, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7faecf19c000
mmap(0x7faecf19e000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7faecf19e000
mmap(0x7faecf1a0000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7faecf1a0000
mmap(0x7faecf1a1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7faecf1a1000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faecf19a000
arch_prctl(ARCH_SET_FS, 0x7faecf19ac40) = 0
set_tid_address(0x7faecf19af10)         = 25524
set_robust_list(0x7faecf19af20, 24)     = 0
rseq(0x7faecf19b560, 0x20, 0, 0x53053053) = 0
mprotect(0x7faecf375000, 16384, PROT_READ) = 0
mprotect(0x7faecf1a1000, 4096, PROT_READ) = 0
mprotect(0x7faecf3aa000, 4096, PROT_READ) = 0
mprotect(0x7faecf416000, 8192, PROT_READ) = 0
mprotect(0x56237ad32000, 4096, PROT_READ) = 0
mprotect(0x7faecf459000, 8192, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x7faecf41b000, 43014)           = 0
getrandom("\x98\x6a\x13\x5a\x35\x70\x1b\xcc", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x56237b24f000
brk(0x56237b270000)                     = 0x56237b270000
rt_sigaction(SIGSEGV, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faecf1df3b0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
newfstatat(AT_FDCWD, "/proc/sys/fs/quota", {st_mode=S_IFDIR|0555, st_size=0, ...}, 0) = 0
rt_sigaction(SIGSEGV, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faecf1df3b0}, NULL, 8) = 0
openat(AT_FDCWD, "/proc/mounts", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "/dev/root / ext4 rw,noatime 0 0\n"..., 1024) = 1024
quotactl(QCMD(Q_GETINFO, USRQUOTA), "/dev/root", 0x7ffd4d56c560) = -1 ESRCH (No such process)
quotactl(QCMD(Q_GETINFO, GRPQUOTA), "/dev/root", 0x7ffd4d56c560) = -1 ESRCH (No such process)
quotactl(QCMD(Q_GETINFO, PRJQUOTA), "/dev/root", 0x7ffd4d56c560) = -1 ESRCH (No such process)
quotactl(QCMD(Q_GETINFO, USRQUOTA), "/dev/md124", 0x7ffd4d56c560) = -1 ESRCH (No such process)
quotactl(QCMD(Q_GETINFO, GRPQUOTA), "/dev/md124", 0x7ffd4d56c560) = -1 ESRCH (No such process)
quotactl(QCMD(Q_GETINFO, PRJQUOTA), "/dev/md124", 0x7ffd4d56c560) = -1 ESRCH (No such process)
quotactl(QCMD(Q_GETINFO, USRQUOTA), "/dev/md126", {dqi_bgrace=604800, dqi_igrace=604800, dqi_flags=DQF_SYS_FILE, dqi_valid=IIF_BGRACE|IIF_IGRACE|IIF_FLAGS}) = 0
quotactl(QCMD(Q_GETINFO, GRPQUOTA), "/dev/md126", {dqi_bgrace=604800, dqi_igrace=604800, dqi_flags=DQF_SYS_FILE, dqi_valid=IIF_BGRACE|IIF_IGRACE|IIF_FLAGS}) = 0
quotactl(QCMD(Q_GETINFO, PRJQUOTA), "/dev/md126", 0x7ffd4d56c560) = -1 ESRCH (No such process)
readlink("/home", 0x7ffd4d56c1b0, 1023) = -1 EINVAL (Invalid argument)
statfs("/home", {f_type=EXT2_SUPER_MAGIC, f_bsize=4096, f_blocks=7331823, f_bfree=1652478, f_bavail=1610914, f_files=1875968, f_ffree=1579751, f_fsid={val=[0x6339dac0, 0x11547107]}, f_namelen=255, f_frsize=4096, f_flags=ST_VALID|ST_NOATIME}) = 0
newfstatat(AT_FDCWD, "/dev/md126", {st_mode=S_IFBLK|0660, st_rdev=makedev(0x9, 0x7e), ...}, 0) = 0
newfstatat(AT_FDCWD, "/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
quotactl(QCMD(Q_GETINFO, USRQUOTA), "/dev/md127", 0x7ffd4d56c560) = -1 ESRCH (No such process)
quotactl(QCMD(Q_GETINFO, GRPQUOTA), "/dev/md127", 0x7ffd4d56c560) = -1 ESRCH (No such process)
quotactl(QCMD(Q_GETINFO, PRJQUOTA), "/dev/md127", 0x7ffd4d56c560) = -1 ESRCH (No such process)
read(3, "rpc_pipefs rpc_pipefs rw,relatim"..., 1024) = 98
read(3, "", 1024)                       = 0
close(3)                                = 0
newfstatat(AT_FDCWD, "/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
readlink("/home", 0x7ffd4d56d270, 1023) = -1 EINVAL (Invalid argument)
write(2, "quotacheck: ", 12quotacheck: )            = 12
write(2, "Cannot find filesystem to check "..., 77Cannot find filesystem to check or filesystem not mounted with quota option.
) = 77
exit_group(1)                           = ?
+++ exited with 1 +++

which doesn't talk to me at all...

Quote:
strace can be verbose, so it may benefit from using wgetpaste. For example, append the following to the command to save it to a file: 2>&1 | tee strace-quotacheck.out

Thanks for the tip.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20476

PostPosted: Thu Aug 22, 2024 9:13 pm    Post subject: Reply with quote

I was hoping it would have something more helpful.

The man page has options for --verbose and --debug. Perhaps one of those will help. There is also --interactive, which asks the user for input if there is an error.

--create-files mentions to create files, not read existing files. So I'm wondering if those files exist or if they are corrupt.

The error isn't particularly helpful as is, since it appears wrong.

The quota service checks all devices, which is where I thought the error was coming from, a device without quota support. Especially since it follows with 'enabled' for /home.

So hopefully one verbose, debug, or interactive provides something more useful.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum