Setelah kita mengaktifkan fasilitas quota pada server Centos 7 kita, kita akan memberlakukan quota kepada pengguna server Centos 7 kita. 

Berikut contoh langkah-langkah pemberlakukan quota ke user Centos 7

  1. Memberlakukan quota dengan perintah edquota:

    [root@localhost ~]# edquota andi
    Disk quotas for user andi (uid 1000):
      Filesystem                   blocks       soft       hard     inodes     soft     hard
      /dev/mapper/centos-home          12       1000       2000          4       5        10
    ~
    ~
    — INSERT —

    Pada perintah edquota ini menggunakan vi editor.

    Bloks memiliki soft limit 1000K dan hard limit 2000K.
    Terlihat bahwa untuk bloks memiliki limit 2000K atau sekitar 2 MB.

    Inodes memiliki soft limit 4 file dan memiliki hard limit 10 file.
     

  2. Melihat hasil setting pemberlakuan quota dengan perintah repquota -as:

    [root@localhost ~]# repquota -as
    *** Report for user quotas on device /dev/mapper/centos-home
    Block grace time: 7days; Inode grace time: 7days
                            Space limits                File limits
    User            used    soft    hard  grace    used  soft  hard  grace
    ———————————————————————-
    root      —      0K      0K      0K              3     0     0
    andi      —     12K   1000K   2000K              4     5    10

  3. Mencoba quota space:

    login as: andi
    Access denied
    andi@192.168.21.160’s password:
    Last login: Thu Sep 15 19:06:26 2016 from aris
    [andi@localhost ~]$ dd if=/dev/zero of=cobafile bs=3M count=8
    dd: error writing âcobafileâ: Disk quota exceeded
    1+0 records in
    0+0 records out
    2035712 bytes (2.0 MB) copied, 0.00205937 s, 989 MB/s

    Terlihat bahwa saat user andi membuat file melebihi quota akan gagal dan ada peringatan ‘Disk quota exceeded’.

  4. Mencoba quota jumlah file:

    [andi@localhost ~]$ rm cobafile
    [andi@localhost ~]$ touch 5
    [andi@localhost ~]$ touch 6
    [andi@localhost ~]$ touch 7
    [andi@localhost ~]$ touch 8
    [andi@localhost ~]$ touch 9
    [andi@localhost ~]$ touch 10
    [andi@localhost ~]$ touch 11
    touch: cannot touch â11â: Disk quota exceeded

    Terlihat bahwa saat user andi membuat file ke 11 maka melebihi quota jumlah file dan ada peringatan ‘Disk quota exceeded’.

Informasi lebih lanjut silahkan mengunjungi
1. http://www.linuxtechi.com/enable-user-group-disk-quota-on-centos-7-rhel-7/ .
2. https://en.wikipedia.org/wiki/Dd_(Unix) .
3. http://www.computerhope.com/unix/dd.htm .

Kunjungi www.proweb.co.id untuk menambah wawasan anda.

Memberlakukan quota kepada user Centos 7
× Ada yang dapat saya bantu ? Available on SundayMondayTuesdayWednesdayThursdayFridaySaturday