Author Topic: Setup disk quota  (Read 1213 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Setup disk quota
« on: January 23, 2020, 05:32:58 AM »
I am following instructions at http://forum.centos-webpanel.com/centos-configuration/how-to-setup-user-quotas/

I have the following code

Quote
#
# /etc/fstab
# Created by anaconda on Thu May 10 19:11:59 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=b6138c62-a2ac-44ab-8bc4-005d04b4d505 /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0

Since it has /boot and not either / or /home, I am confused.

Please help

Offline
*****
Re: Setup disk quota
« Reply #1 on: January 23, 2020, 08:27:49 AM »
As I see you use XSF filesystem. Use the last part from the instructions:  "XFS Quota (only for XFS file system!!!)"
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
Re: Setup disk quota
« Reply #2 on: January 23, 2020, 01:29:42 PM »
Yes. In the instructions, it says to look for

Code: [Select]
/dev/mapper/centos_root-home /home xfs defaults 0 0

I have

Code: [Select]
UUID=b6138c62-a2ac-44ab-8bc4-005d04b4d505 /boot                   xfs     defaults        0 0
Since i dont understand this, I want to make sure what should I do? Should I change /boot to /home ?

Or should i continue to use /boot

In my cwp ->Disk quota settings it is saying

You should setup quota for the / partition.
/dev/mapper/centos-root / xfs defaults 0 0

It is just / , neither /boot or /home

Please help


Offline
****
Re: Setup disk quota
« Reply #3 on: January 23, 2020, 04:27:19 PM »
It's scary when folks try to run their own servers/VPS without a clue about the basics.  :o

Quote
/dev/mapper/centos-root /                       xfs     defaults        0 0
That is your / partition, it even tells you so.
When YOU installed your server, YOU didn't choose to have a separate /home partition.
Running a server/VPS means YOU take responsibility to learn how to do it properly. If you can't manage, buy shared hosting.
Back to lurking mode. :-/

Offline
*
Re: Setup disk quota
« Reply #4 on: January 24, 2020, 05:59:27 AM »
Yes. Very new. Trying to learn :)

VPS came with cwp preinstalled

Offline
***
Re: Setup disk quota
« Reply #5 on: January 26, 2020, 04:21:31 PM »
A little addition for XFS systems.  If adding quota's to fstab doesn't enable quota's, you may have to make a change to the grub bootloader, as the kernal won't load quotas by default.

1)  Verify quota's aren't on:      mount | grep ' / '
2)  If they are not on even after editing FSTAB, do the following.
a) Because "noquota" is a default kernel mounting option, we must change it in the kernel boot options.
Edit the file:
/etc/default/grub

b) Find the line with the variable "GRUB_CMDLINE_LINUX", that might look like this (it may not look exactly the same, don't worry):
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto  vconsole.keymap=us rhgb quiet"

c) We're going to put a "rootflags=" variable at the end of the line
- And add uquota,pquota as the values
It might look something like this:
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto  vconsole.keymap=us rhgb quiet rootflags=uquota,pquota"

d) Now, based on that setup, we'll backup, then create a new grub.cfg file:
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig
grub2-mkconfig -o /boot/grub2/grub.cfg

The path on some OSs has been changed to
/boot/efi/EFI/centos/grub.cfg

e) Lastly, we must reboot the box in order for the kernel to see these new options
reboot

f) We keep our fingers crossed that the box comes back, and login again.  Go back to step 0) to check the mounting options to ensure that "noquota" is gone, eg:
[root@es7-64 ~]# mount | grep ' / '
/dev/mapper/centos-root on / type xfs (rw,relatime,attr2,inode64,usrquota,prjquota)
[root@es7-64 ~]#

Once it's gone, we want to see usrquota,prjquota(or uquota,pquota, they're the same thing).
If you don't see, them, then add them to the / partition with the standard quota setup guide.

g)  Enable quota's in CWP
Google Hangouts:  rcschaff82@gmail.com

Offline
*
Re: Setup disk quota
« Reply #6 on: January 27, 2020, 08:26:54 AM »
Unable to edit etc/default/grub

It says readonly

Offline
***
Re: Setup disk quota
« Reply #7 on: January 27, 2020, 08:40:33 AM »
Do
lsattr /etc/default/grub

Of it shows r, do chattr -r /etc/default/grub.  Then edit
Google Hangouts:  rcschaff82@gmail.com

Offline
***
Re: Setup disk quota
« Reply #8 on: January 27, 2020, 08:43:47 AM »
Also do ls -al and see if you have write access.  Might need to chmod it 600
Google Hangouts:  rcschaff82@gmail.com