Ubuntu 10.04 で quota メモ

インストール

[email protected]:/# apt-get install quota quotatool

fstab編集

[email protected]:/# vi /etc/fstab

“/etc/fstab” 12 lines, 681 characters
# /etc/fstab: static file system information.
#
# Use ‘blkid -o value -s UUID’ to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/vda1 during installation
UUID=c65156da-fd9f-4694-a3a3-cba8dd1db6bf /               ext4    errors=remount-ro,usrquota,grpquota 0       1
# swap was on /dev/vda5 during installation
UUID=2c8d9c41-c46a-4906-a633-cfd7be97d018 none            swap    sw              0       0

再マウント

[email protected]:/# mount -o remount /dev/vda1

wktk# mount
/dev/vda1 on / type ext4 (rw,errors=remount-ro,usrquota,grpquota)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
none on /var/lib/ureadahead/debugfs type debugfs (rw,relatime)

クオータの有効化

[email protected]:/# quotaon -p /dev/vda1
group quota on / (/dev/vda1) is on
user quota on / (/dev/vda1) is on
[email protected]:/# quota

[email protected]:/# quotaon -avug
/dev/vda1 [/]: group quotas turned on
/dev/vda1 [/]: user quotas turned on
[email protected]:/#

ファイルの所有権チェック

[email protected]:/# quotacheck -avugm
quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quot
a to avoid running quotacheck after an unclean shutdown.
quotacheck: WARNING – Quotafile //quota.user was probably truncated. Cannot save quota settings…
quotacheck: WARNING – Quotafile //quota.group was probably truncated. Cannot save quota settings…
quotacheck: Scanning /dev/vda1 [/] done
quotacheck: Checked 11909 directories and 76257 files
[email protected]:/#

 

クオータの状況確認

wktk# repquota -a
*** Report for user quotas on device /dev/vda1
Block grace time: 7days; Inode grace time: 7days
Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
———————————————————————-
root      — 1502740       0       0          78726     0     0

・・・(略)
wktk0002  —     120       0       0             14     0     0
wktk0003  —   51552       0       0           2517     0     0
wktk0004  —   47432       0       0           1168     0     0
wktk0005  —     860       0       0             82     0     0
・・・(略)
wktk#

 

クオータのDB更新

wktk# quotacheck -m -a

クオータテンプレートの適用

wktk# edquota -p tempuser wktk0003

 

 

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です