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.

  • #2
    Hi sysnop

    I myself have always edited grub and its works lovely

    If your a little unsure, you may want to try a few tests on a test server first, but if you follow IW guide as you posted, should work

    I think some users set wrong details in grub, which is why it fails

    These are just my thoughts and how I setup centos 7 with IW, but we do not use centos 7 in production as yet, just test servers

    Many thanks

    John

    Comment


    • #3
      Hey John,

      Sorry, I updated my post because I had tried two methods with some degree of success -- quotas remain on after booting. I need to study GRUB because that's how I'd like it to work.

      Thanks!

      Comment


      • #4
        Hi sysnop

        Many thanks

        If it helps, if I have time next few days, I may load a test server with default centos 7, then take screenshots of what needs to be completed

        Would that help

        Many thanks

        John

        Comment


        • #5
          Hey John,

          I'm sure it would help but that would be extra work for you unless it's already part of your testing schedule. I think I'm getting warmer after doing some research about CentOS 7. Once I see good results I will post what I did with GRUB.

          Thanks!

          Comment


          • #6
            Hi Sysnop
            Many thanks, but it was one I did specially to help.
            Hopefully it will make sense, and just followed the instructions from IW as you posted.

            I hope that helps and have highlighted where the code should be placed (before and after)
            Many thanks
            John
            Attached Files

            Comment


            • #7
              Thanks John! I will give it a try asap which may not be today but soon enough. I'm taking the day off from Interworx. IPv6 isn't working for me either and eventually I will post a new thread about that also.

              Comment


              • #8
                Thanks again for your screen shots, they're easily comparable to the instructions at http://www.interworx.com/support/faq...uotas-centos7/.

                I tried once more with no success: after rebooting a couple times quotas are not enabled according to the Nodeworx System Health page. Before editing GRUB I reversed the legacy method of placing a symlink in /etc/rc.d/rc.local to retain enabled quotas after rebooting (discussed above).

                The rootflags= line was indeed missing before editing. Here's my updated /etc/default/grub file:

                Code:
                GRUB_TIMEOUT=5
                GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
                GRUB_DEFAULT=saved
                GRUB_DISABLE_SUBMENU=true
                GRUB_TERMINAL_OUTPUT="console"
                GRUB_CMDLINE_LINUX="vconsole.keymap=us crashkernel=auto  vconsole.font=latarcyrheb-sun16 rhgb quiet rootflags=usrquota,grpquota
                "
                GRUB_DISABLE_RECOVERY="true"
                Output for

                # grub2-mkconfig -o /boot/grub2/grub.cfg:

                Code:
                Generating grub configuration file ...
                Found linux image: /boot/vmlinuz-3.10.0-327.22.2.el7.x86_64
                Found initrd image: /boot/initramfs-3.10.0-327.22.2.el7.x86_64.img
                Found linux image: /boot/vmlinuz-0-rescue-72863e389b584a4dab36fae7f3bffda2
                Found initrd image: /boot/initramfs-0-rescue-72863e389b584a4dab36fae7f3bffda2.img
                done"
                Next I verified that /boot/grub2/grub.cfg existed with a current time stamp since previously it did not, which explains the error when attempting to copy a backup.

                Rebooted...

                Output for

                # mount | grep ' / ':

                Code:
                /dev/sda on / type ext4 (rw,noatime,quota,usrquota,grpquota,errors=remount-ro,data=ordered)
                But quotas in Nodeworx' health page show pink/disabled.

                Next I got quotas to show green/enabled by issuing:

                # ln -s /dev/sda /dev/root
                # quotacheck -cugvmf -F vfsv0 /
                # quotaon /


                But rebooting takes it back to pink/disabled in Nodeworx. I'll re-issue these commands to have quotas on until the next reboot.

                Comment


                • #9
                  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

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      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

                      Comment


                      • #12
                        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

                        Comment


                        • #13
                          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

                          Comment


                          • #14
                            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

                            Comment


                            • #15
                              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.

                              Comment

                              Working...
                              X