작은숲:위키노트/Quota 설정: 두 판 사이의 차이
보이기
잔글 Utolee90님이 위키노트:Quota 설정 문서를 Quota 설정 문서로 이동했습니다: Move_Pages_by_removing_the_text_위키노트_via_pywikibot |
잔글 Utolee90님이 Quota 설정 문서를 넘겨주기를 만들지 않고 작은숲:위키노트/Quota 설정 문서로 이동했습니다: 위키노트 문서 작은숲으로 이동 |
||
| (같은 사용자의 중간 판 6개는 보이지 않습니다) | |||
| 1번째 줄: | 1번째 줄: | ||
[[위키노트 | [[작은숲:위키노트/데비안|데비안]]에서 <tt>quota</tt>를 설치하고 설정하기. | ||
== quota 패키지 설치 == | == quota 패키지 설치 == | ||
< | <syntaxhighlight lang="console"> | ||
# apt-get install quota | # apt-get install quota | ||
</ | </syntaxhighlight> | ||
== /etc/fstab 수정 == | == /etc/fstab 수정 == | ||
사용자 <tt>quota</tt>를 적용하고자 하는 파일시스템에 <tt>usrquota</tt> 옵션을 준다. 예를 들어 | 사용자 <tt>quota</tt>를 적용하고자 하는 파일시스템에 <tt>usrquota</tt> 옵션을 준다. 예를 들어 | ||
< | <syntaxhighlight lang="cfg"> | ||
# /etc/fstab: static file system information. | # /etc/fstab: static file system information. | ||
## <file system> <mount point> <type> <options> <dump> <pass> | ## <file system> <mount point> <type> <options> <dump> <pass> | ||
| 14번째 줄: | 14번째 줄: | ||
/dev/sda6 /var ext3 noatime 0 2 | /dev/sda6 /var ext3 noatime 0 2 | ||
/dev/sda2 none swap sw 0 0 | /dev/sda2 none swap sw 0 0 | ||
</ | </syntaxhighlight> | ||
만약 그룹 <tt>quota</tt>를 적용하고자 한다면, <tt>grpquota</tt>도 추가해준다. | 만약 그룹 <tt>quota</tt>를 적용하고자 한다면, <tt>grpquota</tt>도 추가해준다. | ||
== quotacheck 실행 == | == quotacheck 실행 == | ||
< | <syntaxhighlight lang="console"> | ||
# quotacheck -avug | # quotacheck -avug | ||
quotacheck: Scanning /dev/sda7 [/home] done | quotacheck: Scanning /dev/sda7 [/home] done | ||
quotacheck: Checked 8 directories and 13 files | quotacheck: Checked 8 directories and 13 files | ||
</ | </syntaxhighlight> | ||
<code>quotacheck</code>를 실행하면 <code>/home</code>에 <code>aquota.user</code> 파일이 생성된다. 이 파일에는 사용자별 quota 정보가 들어있다. 만약 그룹 quota를 설정한 경우에는 <code>aquota.group</code> 파일이 생성된다. | <code>quotacheck</code>를 실행하면 <code>/home</code>에 <code>aquota.user</code> 파일이 생성된다. 이 파일에는 사용자별 quota 정보가 들어있다. 만약 그룹 quota를 설정한 경우에는 <code>aquota.group</code> 파일이 생성된다. | ||
== Reboot == | == Reboot == | ||
| 27번째 줄: | 27번째 줄: | ||
== 사용자별 quota 설정 == | == 사용자별 quota 설정 == | ||
사용자별로 quota를 설정해주기 위해 <code>edquota</code>를 이용한다. <code>edquota -u hhyoon</code> 을 실행하면 기본 에디터(<tt>vi</tt>, <tt>vim</tt>, 혹은 <tt>$EDITOR</tt> 환경 변수에 설정된 에디터)가 실행되면서 아래와 같은 화면이 나온다. | 사용자별로 quota를 설정해주기 위해 <code>edquota</code>를 이용한다. <code>edquota -u hhyoon</code> 을 실행하면 기본 에디터(<tt>vi</tt>, <tt>vim</tt>, 혹은 <tt>$EDITOR</tt> 환경 변수에 설정된 에디터)가 실행되면서 아래와 같은 화면이 나온다. | ||
< | <syntaxhighlight lang="cfg"> | ||
Disk quotas for user hhyoon (uid 1000): | Disk quotas for user hhyoon (uid 1000): | ||
Filesystem blocks soft hard inodes soft hard | Filesystem blocks soft hard inodes soft hard | ||
/dev/sda7 36 0 0 8 0 0 | /dev/sda7 36 0 0 8 0 0 | ||
</ | </syntaxhighlight> | ||
이 값들을 적절히 수정한다. | 이 값들을 적절히 수정한다. | ||
< | <syntaxhighlight lang="cfg"> | ||
Disk quotas for user hhyoon (uid 1000): | Disk quotas for user hhyoon (uid 1000): | ||
Filesystem blocks soft hard inodes soft hard | Filesystem blocks soft hard inodes soft hard | ||
/dev/sda7 36 800000 1000000 8 0 0 | /dev/sda7 36 800000 1000000 8 0 0 | ||
</ | </syntaxhighlight> | ||
여기에서 각 필드의 의미는 다음과 같다. | 여기에서 각 필드의 의미는 다음과 같다. | ||
* <tt>Filesystem</tt>: quota가 적용되는 파일시스템 | * <tt>Filesystem</tt>: quota가 적용되는 파일시스템 | ||
| 60번째 줄: | 60번째 줄: | ||
== 설정된 사용자별 quota 확인 == | == 설정된 사용자별 quota 확인 == | ||
<code>quota hhyoon</code>을 실행하면 설정된 정보를 확인할 수 있다. | <code>quota hhyoon</code>을 실행하면 설정된 정보를 확인할 수 있다. | ||
< | <syntaxhighlight lang="console"> | ||
# quota hhyoon | # quota hhyoon | ||
Disk quotas for user hhyoon (uid 1000): | Disk quotas for user hhyoon (uid 1000): | ||
Filesystem blocks quota limit grace files quota limit grace | Filesystem blocks quota limit grace files quota limit grace | ||
/dev/sda7 36 800000 1000000 8 0 0 | /dev/sda7 36 800000 1000000 8 0 0 | ||
</ | </syntaxhighlight> | ||
== 파일 시스템의 quota 설정 확인 == | == 파일 시스템의 quota 설정 확인 == | ||
<code>repquota</code>는 파일 시스템의 quota를 정리해서 보여준다. | <code>repquota</code>는 파일 시스템의 quota를 정리해서 보여준다. | ||
< | <syntaxhighlight lang="console"> | ||
# repquota -a | # repquota -a | ||
*** Report for user quotas on device /dev/sda7 | *** Report for user quotas on device /dev/sda7 | ||
| 77번째 줄: | 77번째 줄: | ||
root -- 32884 0 0 9 0 0 | root -- 32884 0 0 9 0 0 | ||
hhyoon -- 36 800000 1000000 8 0 0 | hhyoon -- 36 800000 1000000 8 0 0 | ||
</ | </syntaxhighlight> | ||
{{리눅스}} | {{리눅스}} | ||
[[분류:공유]] | [[분류:위키노트/공유]] | ||
[[분류:리눅스]] | [[분류:리눅스]] | ||
[[분류:시스템 도구]] | [[분류:시스템 도구]] | ||
[[분류:소프트웨어 설치]] | [[분류:위키노트/소프트웨어 설치]] | ||
[[분류:소프트웨어 설정]]{{퍼온문서|위키노트|{{#invoke:string|replace|{{PAGENAME}}|위키노트:|}}}}[[분류:위키노트에서 가져온 문서]] | [[분류:위키노트/소프트웨어 설정]]{{퍼온문서|위키노트|{{#invoke:string|replace|{{PAGENAME}}|위키노트:|}}}}[[분류:위키노트에서 가져온 문서]] | ||
2022년 5월 7일 (토) 19:19 기준 최신판
데비안에서 quota를 설치하고 설정하기.
quota 패키지 설치
# apt-get install quota/etc/fstab 수정
사용자 quota를 적용하고자 하는 파일시스템에 usrquota 옵션을 준다. 예를 들어
# /etc/fstab: static file system information.
## <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/sda1 / ext3 defaults,errors=remount-ro 0 1
/dev/sda7 /home ext3 nosuid,usrquota 0 2
/dev/sda6 /var ext3 noatime 0 2
/dev/sda2 none swap sw 0 0만약 그룹 quota를 적용하고자 한다면, grpquota도 추가해준다.
quotacheck 실행
# quotacheck -avug
quotacheck: Scanning /dev/sda7 [/home] done
quotacheck: Checked 8 directories and 13 filesquotacheck를 실행하면 /home에 aquota.user 파일이 생성된다. 이 파일에는 사용자별 quota 정보가 들어있다. 만약 그룹 quota를 설정한 경우에는 aquota.group 파일이 생성된다.
Reboot
quota 설정을 적용하기 위해 reboot 시킨다.
사용자별 quota 설정
사용자별로 quota를 설정해주기 위해 edquota를 이용한다. edquota -u hhyoon 을 실행하면 기본 에디터(vi, vim, 혹은 $EDITOR 환경 변수에 설정된 에디터)가 실행되면서 아래와 같은 화면이 나온다.
Disk quotas for user hhyoon (uid 1000):
Filesystem blocks soft hard inodes soft hard
/dev/sda7 36 0 0 8 0 0이 값들을 적절히 수정한다.
Disk quotas for user hhyoon (uid 1000):
Filesystem blocks soft hard inodes soft hard
/dev/sda7 36 800000 1000000 8 0 0여기에서 각 필드의 의미는 다음과 같다.
- Filesystem: quota가 적용되는 파일시스템
- blocks: 현재 사용 중인 디스크량 (in Kbytes)
- soft: 사용가능한 디스크량의 soft limit (in Kbytes)
- hard: 사용가능한 디스크량의 hard limit (in Kbytes)
- inodes: 현재 사용 중인 inode의 수
- soft: 사용가능한 inode 수의 soft limit
- hard: 사용가능한 inode 수의 hard limit
여기에서 soft limit와 hard limit의 의미는 다음과 같다.
- Soft limit는 한 파일시스템에서 사용자가 쓸 수 있는 최대 용량을 나타낸다. 이 soft limit를 넘게 되면 유예 기간(grace period) 내에는 사용 용량 초과에 대한 경고를 받는다.
- Hard limit는 유예 기간(grace period)이 설정된 경우에만 동작하고, 디스크 사용에 있어 절대적인 한계를 나타낸다. 즉, 사용자는 hard limit 이상의 사용할 수 없다.
- 만약 hard limit를 초과한 경우 기존 파일을 갱신하면 파일 크기가 0으로 되니 조심해야 한다.
유예 기간 설정
유예 기간은 사용자의 사용 용량이 soft limit를 넘은 후부터 적용되는 시간 제한이다. edquota -t를 실행하면 설정된 유예 기간을 보거나 수정할 수 있다.
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/sda7 7days 7days
설정된 사용자별 quota 확인
quota hhyoon을 실행하면 설정된 정보를 확인할 수 있다.
# quota hhyoon
Disk quotas for user hhyoon (uid 1000):
Filesystem blocks quota limit grace files quota limit grace
/dev/sda7 36 800000 1000000 8 0 0파일 시스템의 quota 설정 확인
repquota는 파일 시스템의 quota를 정리해서 보여준다.
# repquota -a
*** Report for user quotas on device /dev/sda7
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 32884 0 0 9 0 0
hhyoon -- 36 800000 1000000 8 0 0| 배포판 | |
|---|---|
| 서버 프로그램 | |
| 시스템 도구 | |
| 시스템 보안 | |
| 시스템 설정 | |
| HOWTO 문서 | |
| 사용자 설정 | |
| 활용 | |
| 명령어 | |