1

I was trying implement disk user and group quotas at Google Compute Engine with Ubuntu 16.04 LTS, but till now i'm unsuccessful.

Quota allows you to specify limits on two aspects of disk storage: the number of inodes a user or a group of users may possess; and the number of disk blocks that may be allocated to a user or a group of users.

The idea behind quota is that users are forced to stay under their disk consumption limit, taking away their ability to consume unlimited disk space on a system.

sudo -s
apt-get -y install quota quotatool
nano /etc/fstab

then I used

LABEL=cloudimg-rootfs   /    ext4   defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0 0

then I tried activate quota:

mount -o remount /
quotacheck -avugm
quotaon -avug
quotaon: using //quota.user on /dev/sda1 [/]: No such process
quotaon: Quota format not supported in kernel

Quota module not in kernel, I create the user and group quota.

touch /aquota.user /aquota.group
chmod 600 /aquota.*
mount -o remount /
quotacheck -avugm
quotaon -avug
quotaon: using //quota.user on /dev/sda1 [/]: No such process
quotaon: Quota format not supported in kernel

Didn't work.

I remembered a way used in AWS EC2:

apt-get -y install linux-image-extra-virtual

echo quota_v1 >> /etc/modules
echo quota_v2 >> /etc/modules

reboot

sudo -s
cat /proc/modules | grep -i quota

Nothing, Didn't work either.

modprobe quota_v1
modprobe: FATAL: Module quota_v1 not found in directory /lib/modules/4.8.0-46-generic

quotaon -pa
group quota on / (/dev/sda1) is off
user quota on / (/dev/sda1) is off

I made this work at EC2 but no luck with Google Compute Engine. Any idea what I can try more?

2

I have same problem running Ubuntu 18.04 on AWS instance

removing aws kernel and install the Generic one seems to fix the problem

here is what i do:

# Remove Aws Kernel | find your own kernel version
apt-get remove linux-image-4.15.0-*-aws

# Install Generic Kernel
apt-get -y install linux-image-generic
apt-get -y install linux-headers-generic

# Makesure everything is ok
reboot

modprobe quota_v2
modprobe quota_v2

# if no error on modprobe then add it to modules
echo quota_v1 >> /etc/modules
echo quota_v2 >> /etc/modules

# after that you can add quota options on fstab
1
  • The solution works for me. I have Ubuntu 18 in Google Compute Engine cloud and I deleted gcp default image sudo apt-get remove linux-image-4.15.0-*-gcp – srgbnd Feb 3 '19 at 18:17
1

Ok, found a solution. I do not need install linux-generic at EC2 but seems need be a procedure at Google Compute Engine. All procedure to get quota work:

sudo -s
apt-get -y install quota quotatool

nano /etc/fstab

Edit fstab:

LABEL=cloudimg-rootfs   /    ext4   defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0 0

Check for missing packages.

dpkg -s linux-generic
dpkg-query: package 'linux-generic' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

We can install the full missing linux-generic package:

apt-get -y install linux-generic

Or only the extras packages (I prefer this):

apt-get -y install linux-image-generic
apt-get -y install linux-headers-generic
apt-get -y install linux-image-extra-`uname -r`

We need add the quota modules to start with boot:

echo quota_v1 >> /etc/modules
echo quota_v2 >> /etc/modules

reboot

Check if it's working:

sudo -s
cat /proc/modules | grep -i quota

quota_v1 16384 0 - Live 0xffffffffc037c000
quota_v2 16384 2 - Live 0xffffffffc0377000
quota_tree 20480 1 quota_v2, Live 0xffffffffc0250000

quotaon -pa

group quota on / (/dev/sda1) is on
user quota on / (/dev/sda1) is on

Both quotas are activated.

2
  • Not working for me :( – Fran Marzoa Jun 19 '17 at 11:42
  • Not working, breaking my head for the last 2 days. – Anjum.... Dec 31 '19 at 13:27
0

Ok Fran, try this:

cat /proc/modules | grep -i quota

[...]

quota_v1 16384 0 - Live 0xffffffffc037c000

quota_v2 16384 2 - Live 0xffffffffc0377000

quota_tree 20480 1 quota_v2, Live 0xffffffffc0250000

[...]

quotaon -pa

[...]

group quota on / (/dev/sda1) is off

user quota on / (/dev/sda1) is off

[...]

quotacheck -avugm

[...]

quotacheck: Cannot stat old user quota file //quota.user: No such file or directory. Usage will not be subtracted.

quotacheck: Cannot stat old group quota file //quota.group: No such file or directory. Usage will not be subtracted.

[...]

quotaon -avug

[...]

/dev/sda1 [/]: group quotas turned on

/dev/sda1 [/]: user quotas turned on

[...]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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