Subject : Disk Quota System °ü·Ã Tip Description : . Section 1. °³¿ä 2. Setting Quotas 3. Checking Quotas . Content 1. °³¿ä ºÒƯÁ¤ ´Ù¼öÀÇ User¸¦ ´ë»óÀ¸·Î File Server¸¦ ¿î¿µÇÒ¶§ ¾î´À User°¡ Disk¸¦ µ¶Á¡Çϴ°ÍÀ» ¹æÁöÇÏ°í Á¦ÇÑµÈ SystemÀÇ file(indoe)¼ö¸¦ È¿À²ÀûÀ¸·Î °ü¸®ÇϱâÀ§ÇØ Quota¸¦ °ü¸®ÇÑ´Ù. ¾Æ·¡´Â Æ÷Ç×°ø´ë ¹°¸®Çаú¿¡¼ TEST ¹× ¿î¿µÇß´ø »ç·Ê¸¦ ±â¼úÇÑ °ÍÀÌ´Ù. Âü°í·Î Æ÷Ç×°ø´ë ¹°¸®Çаú´Â YP·Î ¹¿©ÀÖ´Ù. 2. Setting Quotas ( Super User¿¡¼ ) - Kernel¾È¿¡ Quota¸¦ Áö¿øÇϵµ·Ï ¼³Á¤( SunOS 4.1.x ) options QUOTAS #disk quotas options UFS #filesystem code - mount½Ã OptionÀ¸·Î Quota¸¦ ÁöÁ¤ SunOS 4.1.x) #vi /etc/fstab .. /dev/sd3h /home 4.2 rw,quota 1 3 .. Solaris 2.x) #vi /etc/vfstab .. /dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /home ufs 2 yes rw,quota .. - °¢ filesystemÀÇ mount point ¿¡ quotas ÈÀÏÀ» »ý¼º ex) #touch /home/quotas - °¢»ç¿ëÀÚÀÇ »ç¿ë·®À» ÇÒ´ç * /usr/etc/edquota(Solaris 2.x´Â /usr/sbin/edquota)¸¦ »ç¿ëÇÏ¿© ÆíÁý * #edquota user1 .. fs /home blocks (soft = 0, hard = 0) inodes (soft = 0, hard = 0) .. * edquota [ -p proto_user ] username1 username2 ... À§ÀÇ ¿¹Á¦´Â p optionÀ» ÀÌ¿ëÇÏ¿© proto_user¸¦ source·Î ÇÏ¿© ³ª¸ÓÁö user¸¦ targetÀ¸·Î ÀÏ·üÀûÀ¸·Î settingÇÏ°íÀÚ ÇÒ¶§ »ç¿ëÇÑ´Ù. * edquota -t username1 username2 ... fs /home blocks time limit = 3.50 days, files time limit = 3.50 days À§ÀÇ ¿¹Á¦´Â t optionÀ» ÀÌ¿ëÇÏ¿© time limit¸¦ settingÀ» ÇÑ´Ù. time limit settingÀ̶õ »ý¼ºµÈ fileÀÌ settingµÈ ±â°£ÀÌ °æ°úµÇ¸é ´Ü ¼öÁ¤µÈ fileÀÎ °æ¿ì soft limit±îÁö ÀÚµ¿À¸·Î ¼Ò¸êµÈ´Ù´Â °ÍÀÌ´Ù. ±×·¯¹Ç·Î ÁÖÀǸ¦ ¿äÇÑ´Ù. Default°ªÀº 7.0 day, time limit¸¦ ÁÖ´Â °æ¿ì, sec[onds],min[utes],hour[s],day[s],week[s],and month[s]. - example) #edquota user1 ÀÚµ¿À¸·Î ÆíÁý±â°¡ ¿Ã¶ó¿Â´Ù. (ȯ°æº¯¼ö EDITOR, default vi) fs /home blocks (soft = 2500, hard = 4500) inodes (soft = 800, hard = 1250) À§ÀÇ ¿¹Á¦¿¡¼ 1 blockÀº 1024byte. unlimit·Î settingÇÏ´Â °æ¿ì´Â 0À¸·Î settingÇÏ¸é µÈ´Ù. time limit¸¦ ¾ÈÁÙ¶§´Â soft limit¸¦ 0À¸·Î set. soft limit¸¦ ÃÊ°úÇϸé quota_ufs: Warning: over disk limit (pid 489, uid 154, inum 445456, fs /home) # block soft limit ÃÊ°ú½Ã quota_ufs: Warning: too many files (pid 607, uid 154, fs /home) #file¼ö soft limit ÃÊ°ú½Ã ÀÌ»óÀÇ Message¸¦ »Ñ¸®¸é¼ °æ°í¸¦ ÇÑ´Ù. ¶ÇÇÑ loginÇÏ´Â °æ¿ì Over file quota on /home, remove 10 files within 7.0 days Over disk quota on /home, remove 297K within 7.0 days Block limit reaced on /home File count limit reaced on /home ÀÌ»ó°ú °°Àº °æ°ímessage¸¦ »Ñ·ÁÁØ´Ù. hard limit¸¦ ÃÊ°úÇϸé quota_ufs: over hard disk limit (pid 489, uid 154, inum 445456, fs /home)#block hard limit ÃÊ°ú½Ã quota_ufs: over file hard limit (pid 607, uid 154, fs /home) #file¼ö soft limit ÃÊ°ú½Ã ÀÌ»óÀÇ Message¸¦ »Ñ¸®°í Disc quota exceeded ¶ó´Â Message¸¦ »Ñ¸®¸é¼ ´õÀÌ»óÀÇ file writtingÀÌ ¾ÈµÈ´Ù. - reboot booting ÇÒ¶§ ÇØ´ç quota¸¦ ÁöÁ¤ÇÑ filesystem check½Ã "Checking UFS quotas: done"À̶ó´Â message°¡ ³ª¿Â´Ù. booingÀÌ µÇ°í³ª¸é quota°¡ ±¸µ¿µÈ´Ù. mountµÈ»óÅ¿¡¼ quota¸¦ ¾È¾µ °æ¿ì #quotaoff -v -a #quotaoff -v /home ´Ù½Ã quota¸¦ ½ÃÀÛÇÒ °æ¿ì #quotaon -v -a (¸ðµç filesystem quota ±¸µ¿) #quotaon -v /home quotaon ¶Ç´Â quotaoff ´Â system booting½Ã ¸¶´Ù ÇØÁÖÁö¾Ê¾Æµµ µÈ´Ù. ÇØ´ç ½Ã½ºÅÛÀÇ filesystem quotaÁ¤º¸´Â home filesystemÀÇ quotas¿¡ Á¤º¸°¡ Àֱ⶧¹®ÀÌ´Ù. 3. Checking Quotas - °¢ partionÀÇ »ç¿ëÀÚº° »ç¿ë·®À» KB´ÜÀ§·Î º¸¿©ÁØ´Ù. #quot /dev/dsk/c0t2d0s7 /dev/dsk/c0t2d0s7 (/home): 711024 root 498 user1 302 user2 1 user3 1 user4 #quot -a (¸ðµç partionÀÇ »ç¿ëÀÚº° »ç¿ë·®À» KB´ÜÀ§·Î º¸¿©ÁØ´Ù.) #quot -f /dev/dsk/c0t2d0s7 (block size »Ó¸¸ ¾Æ´Ï¶ó file countµµ º¸¿©ÁÜ.) /dev/dsk/c0t2d0s7 (/home): 711024 7518 root 498 3 user1 302 11 user2 1 1 user3 1 1 user4 - °¢ »ç¿ëÀÚÀÇ disk quota¿Í »ç¿ë·®À» check #quota user1 Over disk quota on /home, remove 297K within 7.0 days #quota -v user2 Disk quotas for user2 (uid 155): Filesystem usage quota limit timeleft files quota limit timeleft /home 300 0 0 9 4 6 7.0 days - Filesystem¿¡ ´ëÇÑ quotasÀÇ ¿ä¾à # repquota -v -a /dev/dsk/c0t2d0s7 (/home): Block limits File limits User used soft hard timeleft used soft hard timeleft user1 +- 497 200 500 7.0 days 0 0 0 user2 -+ 300 0 0 9 4 6 7.0 days Revision History ÀÛ¼ºÀÏÀÚ : 96.06.13 ÀÛ¼ºÀÚ : À̹ÎÈ£ ¼öÁ¤ÀÏÀÚ : ¼öÁ¤ÀÚ