Home » General » Support » About quotas
About quotas [message #43318] |
Tue, 23 August 2011 19:40 |
cyrolancer
Messages: 15 Registered: July 2011
|
Junior Member |
|
|
Hi,
I am having problems with the quotas.
According to some research, I think, I have to enable the quotas in the HW node first. Anyway, I have managed to edit /etc/fstab like this
[root@xxx ~]# cat /etc/fstab
/dev/md2 / ext3 defaults,usrquota,grpquota 1 1
/dev/md1 /tmp ext3 noexec,nosuid 1 2
/dev/md0 /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/md3 swap swap defaults 0 0
As you see, I have no other partitions except "/".
Later on, I have tried the approach I have found on the internet:
touch /aquota.user
touch /aquota.group
chmod 600 /quota.*
And accordingly, I have used the "quotacheck" to build up the database. Somehow, by using -f switch, I have managed to get aquota.user.new and aquota.group.new files. I have renamed them to aquota.user and aquota.group, respectively.
At least, after waiting 2 hours, I got the files but when I use the command "quotaon -a" I am getting:
[root@xxx ~]# quotaon -a
quotaon: using //aquota.group on /dev/md2 [/]: No such process
quotaon: Quota format not supported in kernel.
quotaon: using //aquota.user on /dev/md2 [/]: No such process
quotaon: Quota format not supported in kernel.
Well after doing some additional research, I have found that I need the kernel modules. So,
[root@xxx ~]# modprobe quota_v1
FATAL: Module quota_v1 not found.
[root@xxx ~]# modprobe quota_v2
FATAL: Module quota_v2 not found.
Wow! Anyway,
[root@xxx ~]# insmod quota_v1
insmod: can't read 'quota_v1': No such file or directory
[root@xxx ~]# insmod quota_v2
insmod: can't read 'quota_v2': No such file or directory
and
[root@xxx ~]# uname -a
Linux xxx.localhost 2.6.18-238.19.1.el5.028stab092.2 #1 SMP Thu Jul 21 19:23:22 MSD 2011 x86_64 x86_64 x86_64 GNU/Linux
After all, I couldn't enable the quotas in HW node. Do I need to enable it in HW node? Because, in the VE /dev/simfs was not mounted as usrquotas, grpquotas option. fstab file in the VE is empty, so I cannot edit the mountpoint.
Therefore, I have stuck at this point. Could anybody please kindly explain how to enable per-user quotas in an OpenVZ container?
[Updated on: Tue, 23 August 2011 19:41] Report message to a moderator
|
|
|
Re: About quotas [message #43319 is a reply to message #43318] |
Tue, 23 August 2011 22:37 |
cyrolancer
Messages: 15 Registered: July 2011
|
Junior Member |
|
|
I have solved the problem. Here is the details:
Note: Container id is 10.
1. Start your container, as usual.
vzctl start 10
2. Kill the processes of the container. You can find the processes, using this command:
lsof 2> /dev/null | egrep '/vz/root/10|/vz/private/10'
Change 10 with your container id.
You are going to see something like this:
saslauthd 14512 root mem REG 9,2 522749462 /vz/root/10/lib64/libdl-2.5.so (path dev=0,23)
saslauthd 14512 root mem REG 9,2 522749426 /vz/root/10/lib64/libkeyutils-1.2.so (path dev=0,23)
saslauthd 14512 root mem REG 9,2 522749371 /vz/root/10/lib64/libselinux.so.1 (path dev=0,23)
saslauthd 14512 root mem REG 9,2 522749423 /vz/root/10/lib64/libaudit.so.0.0.0 (path dev=0,23)
saslauthd 14512 root mem REG 9,2 522650620 /vz/root/10/usr/lib64/libsasl2.so.2.0.22 (path dev=0,23)
saslauthd 14512 root mem REG 9,2 522749418 /vz/root/10/lib64/libssl.so.0.9.8e (path dev=0,23)
saslauthd 14512 root mem REG 9,2 522650670 /vz/root/10/usr/lib64/libz.so.1.2.3 (path dev=0,23)
saslauthd 14512 root mem REG 9,2 522749408 /vz/root/10/lib64/libsepol.so.1 (path dev=0,23)
saslauthd 14512 root 0u CHR 1,3 15819 /vz/root/10/dev/null
saslauthd 14512 root 1u CHR 1,3 15819 /vz/root/10/dev/null
saslauthd 14512 root 2u CHR 1,3 15819 /vz/root/10/dev/null
saslauthd 14512 root 4u REG 0,23 6 522749136 /vz/root/10/var/run/saslauthd/saslauthd.pid
saslauthd 14512 root 6u REG 0,23 0 522749135 /vz/root/10/var/run/saslauthd/mux.accept
You can kill the processes using the PID, i.e. kill -9 14512 (that's the PID of saslauthd in my example)
There are a lot of processes. Finally, you kill the init process.
3. Start writing:
vzctl set 10 --quotaugidlimit 10000 --save
vzquota off 10
vzquota on 10 -s 1
vzctl restart 10
Setting the "quotaugidlimit" parameter is a must for 2nd level quota activation.
4. Then enter container:
vzctl enter 10
And action
edquota -u cyro
The rules I have learned:
1. Don't try to add quota to the HW node, it is useless.
2. RTFM carefully, very carefully.
3. and, I think, that's all
Have a nice day!!!
[Updated on: Wed, 21 September 2011 10:07] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Sep 16 11:21:27 GMT 2024
Total time taken to generate the page: 0.04399 seconds
|