Announcement

Collapse
No announcement yet.

Enabling quotas permanently on CentOS 7 not so clear-cut

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Enabling quotas permanently on CentOS 7 not so clear-cut

    Greetings:

    When I run --

    Code:
    # mount | grep ' / '
    the output suggests quotas are installed and enabled:

    Code:
    /dev/sda on / type ext4 (rw,noatime,quota,usrquota,grpquota,errors=remount-ro,data=ordered)
    Notice that the file system is ext4 and not the default XPS.

    These 3 commands will get quotas cranking:

    Code:
    # ln -s /dev/sda /dev/root
    # quotacheck -cugvmf -F vfsv0 /
    # quotaon /
    I may or may not restart the iworx service since it doesn't seem to matter.

    At which point quotas go from pink/disabled to green/enabled on the System Health page in Nodeworx. To disable quotas again all that's needed is a reboot which loses the symlink for /dev/root and quotas can't enable.

    So my first question is what would be best practice for making this symlink permanent?

    The legacy method in CentOS 6.x is to place the symlink in this file:

    Code:
    /etc/rc.d/rc.local
    With newer distros the answer seems to be creating a systemd unit file in directory --

    Code:
    /etc/systemd/system/
    I've been referring to articles like these that discuss it:

    https://www.centos.org/forums/viewtopic.php?t=48140

    http://forums.fedoraforum.org/showthread.php?t=295048

    Interworx has a guide for quotas and CentOS 7 that involves GRUB that isn't working for me:

    http://www.interworx.com/support/faq...uotas-centos7/

    From what I've read here in the forums the GRUB method hasn't worked for some people. In my case GRUB entries also don't look anything like the instructions, so I'm lost. The systemd method loses me also. Oddly enough, the legacy method for CentOS 6 seems to be loading the symlink every boot so far.
    Last edited by sysnop; 07-14-2016, 02:10 PM.

  • sysnop
    replied
    Nathan fixed me up. He pointed out that my fstab needed to state the correct file system so I changed it from ext3 to ext4 and rebooted. I didn't even notice this mismatch.

    Then he 1) created a symlink between the root partition and /dev/root; 2) ran quotacheck; 3) setup a cron job that retains the symlink after booting.

    # ln -s /dev/sda /dev/root

    # quotacheck -cugmf /

    # crontab -l
    @reboot ln -s /dev/sda /dev/root


    Quotas are now working in Interworx after booting.

    Thanks everybody.

    Leave a comment:


  • d2d4j
    replied
    Hi Richard

    Many thanks, and your fstab does confirm quotas (which is what your first post shows on grep as well), so I'm thinking you don't need to use grub (for xfs, I think grub is needed)

    Also, your fstab shows ext3, but I'm thinking it should be fine

    I'm thinking now that centos 7 on ext3 and 4, does need the systemd unit as your first post

    IW support will confirm exactly the issue, they rock and hopefully IW or your good self will update your post when resolved.

    I think I'll make this post a sticky as there is good content for grub and centos 7, but it will be tommorow when I'm by a PC, unless tapatalk can do this

    Many thanks and have a lovely night

    John

    Leave a comment:


  • sysnop
    replied
    Thanks Nathan, I will start a ticket sometime today or tonight.

    Richard

    Leave a comment:


  • sysnop
    replied
    Hey John,

    Yes, as far as I know I could upload my own spin of CentOS or the full package I suppose. But I'm not willing to go that far.

    When rolling out an OS disk at Linode there are options for reserving disk space for other partitions. I simply use all space for a single partition and a small swap partition, /dev/sda & /dev/sdb, respectively. And like Ubuntu on a laptop, no /home partition is created, just a /home directory. On the same setup page the 'root/boot device' can be assigned to any of these partitions but I just use the 'standard' and default /dev/sda.

    Here's my /etc/fstab (notice the quotas):

    Code:
    /dev/sda       /               ext3    noatime,errors=remount-ro,usrquota,grpquota       0 1
    /dev/sdb       none            swap    sw                              0 0
    /proc           /proc           proc    defaults                        0 0
    tmpfs           /dev/shm        tmpfs   nodev,nosuid,noexec,mode=1777             0 0
    devpts          /dev/pts        devpts  gid=5,mode=620                  0 0
    sysfs           /sys            sysfs   defaults                        0 0
    Interestingly, my previous VPS -- also KVM but on CentOS 6.5 -- didn't have a /home partition either and was laid out much the same way as my current VPS. Quotas were working and stopped working only one time but quotacheck fixed it. Sorry I can't compare notes between the two, the old server is long gone.

    Leave a comment:


  • IWorx-Nathan
    replied
    Feel free to submit a support ticket if you'd like us to take a look at your configuration as well.

    Thanks,

    Nathan

    Leave a comment:


  • d2d4j
    replied
    Hi Richard

    Many thanks, and those are the 2 vps which need second level quotas (must be my age sorry)

    It's interesting that your not showing /home, and Nathan has replied to me over quotas (see below), which explains why your symlinking worked, as maybe your /home is on a different drive to sda perhaps

    Is there another centos 7 image you could use or perhaps have the option to upload your own - sorry I do not use linode

    Many thanks

    John

    You should enable quotas on the partition that contains the /home directory. I believe in our documentation we assume that /home is on the / partition, so the example commands reflect that directory.

    Leave a comment:


  • sysnop
    replied
    Originally posted by d2d4j View Post
    A thought just came to me, do you have to turn on second level quotas as your on a vps (I forgot which vps this refers to, but there are 2 I think which need this)
    If you mean do quotas need to be compiled in the kernel, I don't believe so on a KVM virtual machine. With openVZ or Parallels I believe compiling quotas is necessary.

    Leave a comment:


  • sysnop
    replied
    Hi John,

    The options for the quota partition are:

    Code:
    /
    /dev
    /dev/shm
    /run
    /sys/fs/cgroup
    No /chroot or /chroot/home although I did see a message flash by the screen during installation referring to these directories, something about a symlink? There wasn't enough time to take it in.

    I decided to scrub the VPS and start from scratch thinking it best to have quotas enabled in GRUB before installing Interworx. Oddly, I get this now:

    Code:
    -bash: grub2-mkconfig: command not found
    I started over a second time, still no grub2-mkconfig. Too strange.

    I'm thinking it's time to toss Linode's CentOS 7 image in the /bin.

    Leave a comment:


  • d2d4j
    replied
    Hi Richard

    A thought just came to me, do you have to turn on second level quotas as your on a vps (I forgot which vps this refers to, but there are 2 I think which need this)

    Many thanks

    John

    Leave a comment:


  • d2d4j
    replied
    Hi Richard

    Many thanks

    Did you try set it to /home or /chroot or /chroot/home

    If you look at IW-cp, login to nodeworx, server settings, it should show directories which can be set

    I'm just wondering if your is a reverse of mine, as mine was originally set to /home (pink disabled) and not /, which turns it green enabled

    I've emailed IW as I said I would but maybe an idea to open a support ticket with IW, so they can see what's gone wrong (I do not think it has gone wrong, just that IW is not seeing quotas as active, when they are as you have shown this to be the case

    Hope that helps a little

    Many thanks

    John

    Leave a comment:


  • sysnop
    replied
    Hey John,

    Making sure '/' was listed as the quota partition in Nodeworx (iworx.ini) was one of the first things I checked early on (it never was listed as /home as in your case). I verified by 1) rebooting after making no changes knowing GRUB looks ok; 2) rebooting after getting quotas to show green/enabled with the symlink and quotacheck. Either way I end up with pink/disabled in Nodeworx.

    Sorry about the bad news, I appreciate all your effort with this puzzle.

    Richard

    Leave a comment:


  • d2d4j
    replied
    Hi Sysnop
    Many thanks, much appreciated for your information.
    Yes, your definately not on a stock centos, but think this is because it is a VPS install
    My dedicated test server is using XFS (not Ext4) with the following:
    InterWorx Version 5.1.23-1175
    Distribution: CentOS Linux release 7.2.1511 (Core)
    Operating System: Linux 3.10.0-327.22.2.el7.x86_64 (SMP)
    (latest updates installed prior to installing Interworx using:
    sh <((curl -sL interworx.com/inst.sh)) -r release-candidate
    I can report that this test server showed Quotas not working (oh dear).
    However, I know the Quotas are correctly setup in grub, so my thoughts turned to a different direction, and I have resolved it a follows:
    Login to Nodeworx, Server, Settings, schroll towards the very bottom of the page and change Quota Settings from /home to /, save and check system health, which shuold show Quotas Green and working.
    Reboot server as final test, and all should be good.
    I will email IW though, as it is slightly confusing if the quota count is going to be correct (I expect the quota to be correct for /home as it should cover /home) but could be wrong sorry.
    Please could I ask if this works for you as well
    Many thanks
    John

    Leave a comment:


  • sysnop
    replied
    I'm using a VPS. Forgot to mention that earlier.

    Initially I mentioned my server is ext4 since so many CentOS 7 tutorials seem to prefer xps. The OS image only offers ext4... not that I prefer xps but apparently VPS providers do.

    YES! Nodeworx appears to be calculating correct numbers for Siteworx account storage and email. It's as if quotas were always enabled and working but Interworx doesn't agree.

    Looking forward to hearing if you discover anything with an ext4 setup.

    Edit:

    Sorry John, I neglected to answer a pertinent question of yours. Interworx is installed on CentOS Linux release 7.2.1511 (Core). And the kernel doesn't appear to be stock (the server is at Linode): Linux 4.5.5-x86_64-linode69 (SMP).

    You have a nice weekend too!
    Last edited by sysnop; 07-16-2016, 01:31 PM.

    Leave a comment:


  • d2d4j
    replied
    Hi sysnop

    Many thanks and your grub looks good with quota

    There are a few possibilities then as follows

    Your using ext4, I did default on xps

    I have not loaded IW on centos 7 yesterday - which version are you seeing this on and I'll load tommorow if I have time

    If xps with IW works, I restart using ext4

    Does IW calculate quotas correctly if you reboot and leave pink

    Also, are you using vps or dedicated server (I tested on a dedicated server)

    I'll update when I have loaded IW to let you know

    Many thanks and have a lovely weekend

    John

    Leave a comment:

Working...
X