리눅스 쿼터(quata)설정 및 설명

· 18년 전 · 2248

리눅스 쿼터(quata)설정 및 설명
 

 
 
디스크 쿼터

1)커널에서 쿼터 지원여부 확인
[root@netdosapro44 ~]# cat /var/log/dmesg | grep quota
VFS: Disk quotas dquot_6.5.1

2)/etc/fstab에 쿼터 옵션 추가


    # This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults.usrquota  1 1
LABEL=/boot1            /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/home             /home                   ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/usr1             /usr                    ext3    defaults        1 2
LABEL=/var1             /var                    ext3    defaults        1 2
LABEL=SWAP-hda11        swap                    swap    defaults        0 0
/dev/hdc                /media/cdrom            auto    pamconsole,ro,exec,noauto,managed 0 0

3)쿼터 파티션 재설정
[root@netdosapro44 ~]# mount -o remount /

[root@netdosapro44 ~]# mount
/dev/hda10 on / type ext3 (rw,usrquota)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hda7 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/hda13 on /home type ext3 (rw)
/dev/hda12 on /tmp type ext3 (rw)
/dev/hda8 on /usr type ext3 (rw)
/dev/hda9 on /var type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root@netdosapro44 ~]#

4)쿼터 데이터베이스 파일 만들기 및 퍼미션 추가
[root@netdosapro44 ~]# touch /aquota.user
[root@netdosapro44 ~]# cd /
[root@netdosapro44 /]# chmod 600 /aquota.user
[root@netdosapro44 /]#

5)쿼터 상태 체크
[root@netdosapro44 /]# quotacheck -avugm
quotacheck: WARNING -  Quotafile //aquota.user was probably truncated. Can't save quota settings...
quotacheck: Scanning /dev/hda10 [/] quotacheck: Old group file not found. Usage will not be substracted.
done
quotacheck: Checked 3910 directories and 10070 files

6)쿼터 활성화
root@netdosapro44 /]# quotaon /

7)계정 용량 제한하기
[root@netdosapro44 /]# adduser soul1
[root@netdosapro44 /]# ls /home
lost+found  pcs  soul  soul1
[root@netdosapro44 /]# edquota soul1

Disk quotas for user soul1 (uid 502):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/hda10                        0          0          0          0        0        0

(참고)
blocks : 현제 사용자가 사용 중인 총 블럭수 (용량)
soft : 사용자가 실제로 사용할수 있는 계정용량
hard : 하드로 할당된 용량 범위 내까지 소프트 용량을 사용할수 있게 함
inodes : 총 파일의 갯수


8)유예 기간(grace period)
Grace period before enforcing soft limits for users:
Time units may be: days, hours, minutes, or seconds
  Filesystem             Block grace period     Inode grace period
  /dev/hda10                    7days                  7days
~

9)쿼터 설정 사용 확인
[root@netdosapro44 /]# repquota -a
*** Report for user quotas on device /dev/hda10
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --  282620       0       0          13949     0     0
news      --     388       0       0             28     0     0
rpm       --      84       0       0              1     0     0

10) 사용자 자신 쿼터 용량 확인
[root@netdosapro44 /]# su soul1
[soul1@netdosapro44 /]$ quota
Disk quotas for user soul1 (uid 502): none
[soul1@netdosapro44 /]$

11)쿼터 설정을 다른 사용자와 동일하게 설정하기
-soul2 를 soul1 처럼 용량 설정
[root@netdosapro44 /]# edquota -p soul1 soul2
[root@netdosapro44 /]# repquota -a
*** Report for user quotas on device /dev/hda10
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --  282620       0       0          13949     0     0
news      --     388       0       0             28     0     0
rpm       --      84       0       0              1     0     0


[root@netdosapro44 /]#

 
 

[이 게시물은 관리자님에 의해 2011-10-31 17:32:05 Linux에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
18년 전 조회 3,605
18년 전 조회 2,274
18년 전 조회 2,214
18년 전 조회 5,625
18년 전 조회 2,799
18년 전 조회 2,554
18년 전 조회 2,835
18년 전 조회 2,191
18년 전 조회 3,178
18년 전 조회 1만
18년 전 조회 2,040
18년 전 조회 2,953
18년 전 조회 3,003
18년 전 조회 2,224
18년 전 조회 3,095
18년 전 조회 4,074
18년 전 조회 3,047
18년 전 조회 2,419
18년 전 조회 6,150
18년 전 조회 3,779
18년 전 조회 6,442
18년 전 조회 2,539
18년 전 조회 2,459
18년 전 조회 2,485
18년 전 조회 3,438
18년 전 조회 3,298
18년 전 조회 2,077
18년 전 조회 3,822
18년 전 조회 1,746
18년 전 조회 1,483
18년 전 조회 1,511
18년 전 조회 1,657
18년 전 조회 1,743
18년 전 조회 3,529
18년 전 조회 2,378
18년 전 조회 1,833
18년 전 조회 2,244
18년 전 조회 4,723
18년 전 조회 2,458
18년 전 조회 3,094
18년 전 조회 2,068
18년 전 조회 3,586
18년 전 조회 1,939
18년 전 조회 7,763
18년 전 조회 3,426
18년 전 조회 1,393
18년 전 조회 2,435
18년 전 조회 3,643
18년 전 조회 2,475
18년 전 조회 2,249
18년 전 조회 2,873
18년 전 조회 3,837
18년 전 조회 3,594
18년 전 조회 2,686
18년 전 조회 2,047
18년 전 조회 2,062
18년 전 조회 2,644
18년 전 조회 2,103
18년 전 조회 2,998
18년 전 조회 1,785
18년 전 조회 2,335
18년 전 조회 1,812
18년 전 조회 2,261
18년 전 조회 2,476
18년 전 조회 2,413
18년 전 조회 2,375
18년 전 조회 2,286
18년 전 조회 3,598
18년 전 조회 1,775
18년 전 조회 3,556
18년 전 조회 2,126
18년 전 조회 5,398
18년 전 조회 2,263
18년 전 조회 2,445
18년 전 조회 1,843
18년 전 조회 2,244
18년 전 조회 3,757
18년 전 조회 1,618
18년 전 조회 1,846
18년 전 조회 4,428
18년 전 조회 3,816
18년 전 조회 3,371
18년 전 조회 3,479
18년 전 조회 3,990
18년 전 조회 4,449
18년 전 조회 4,370
18년 전 조회 2,801
18년 전 조회 2,433
18년 전 조회 3,362
18년 전 조회 3,283
18년 전 조회 3,444
18년 전 조회 3,373
18년 전 조회 5,030
18년 전 조회 5,321
18년 전 조회 3,535
18년 전 조회 2,835
18년 전 조회 3,079
18년 전 조회 2,392
18년 전 조회 2,197
18년 전 조회 2,151