Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2017-11-07, 21:23:29

Author Topic: Please fix quotas and add inode usage  (Read 761 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 3,944
  • Karma: +1/-0
    • View Profile
Please fix quotas and add inode usage
« on: 2015-07-29, 15:34:07 »
I don't know why you are using 4x times quota because of 4k blocks. I had to fix this manually after each Kloxo update...

Proper code is as follows:

Quote
        // Issue #680 - Too high inode count in Kloxo quota - set 0 that unlimited
//      $inode = $disk * 500;
//      $inode = 0;

        if ($disk === 0) {
                // MR -- that meaning 'unlimited'
                $totalblock = 0;
                $totalinode = 5000000;
        } else {
                // MR -- assume 1GB space = 1.000.000 KB / 4 KB = 250.000 blocksize
                // where blocksize = 4KB -> inode = 25.000
                // So, make set $totalblock = $inode * 10

        if ($inode === 0) {
        $totalinode = (int) (($disk / 100) + 1);
        } else {
        $totalinode = (int) $inode;
        }

                $perblock = 1;
                $totalblock = $disk / $perblock;
        }

        lxshell_return("setquota", "-u", $username, $totalblock, $totalblock, $totalinode, $totalinode, "-a");
}
« Last Edit: 2015-07-29, 15:35:39 by Spacedust »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,381
  • Karma: +112/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Please fix quotas and add inode usage
« Reply #1 on: 2015-07-29, 16:02:16 »
Inform here:
Code: [Select]
echo ''>/tmp/mustafa.lia.armando; du -k /tmp/mustafa.lia.armando|awk '{print $1}'; 'rm' -f /tmp/mustafa.lia.armando
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 3,944
  • Karma: +1/-0
    • View Profile
Re: Please fix quotas and add inode usage
« Reply #2 on: 2015-07-29, 17:30:57 »
4

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 3,944
  • Karma: +1/-0
    • View Profile
Re: Please fix quotas and add inode usage
« Reply #3 on: 2015-07-29, 17:32:12 »
It all works fine example for user with 15 GB and 150 000 files limit:

Kloxo setting: 15360 MB

Quote
quota -u mariuszartur1
Disk quotas for user mariuszartur1 (uid 1209):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
       /dev/md2       0  15728640 15728640               2  157287  157287
       /dev/md3      96  15728640 15728640              24  157287  157287
       /dev/md4 6783352  15728640 15728640           99424  157287  157287

User with 60 GB and 600 000 files limit:

Kloxo setting: 61440 MB

Quote
quota -u topmedium
Disk quotas for user topmedium (uid 1095):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
       /dev/md2       0  62914560 62914560               2  629146  629146
       /dev/md3     168  62914560 62914560              42  629146  629146
       /dev/md4 16503268  62914560 62914560          263486  629146  629146
« Last Edit: 2015-07-29, 17:34:08 by Spacedust »

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix

Page created in 0.047 seconds with 17 queries.

web stats analysis
 
Mirror created by MasterkinG32.CoM