linux系统管理使用磁盘配额

来源:Linux认证    发布时间:2012-11-10    Linux认证视频    评论

  1024+0 records in

  1024+0 records out

  [redhat@localhost redhat]$ quota -u redhat

  Disk quotas for user redhat (uid 502):

  Filesystem  blocks   quota   limit   grace   files   quota   limit   grace

  /dev/sdb1  1040*  10  0   6days  4  0  9
  [redhat@localhost redhat]$ touch file1

  [redhat@localhost redhat]$ touch file2

  [redhat@localhost redhat]$ touch file3

  [redhat@localhost redhat]$ touch file4

  [redhat@localhost redhat]$ touch file5

  [redhat@localhost redhat]$ ls

  file1  file2  file3  file4  file5
  [redhat@localhost redhat]$ quota -u redhat

  Disk quotas for user redhat (uid 502):

  Filesystem  blocks   quota   limit   grace   files   quota   limit   grace

  /dev/sdb1  1032*  10  0   6days  6  0  9
  [redhat@localhost redhat]$ touch file6

  [redhat@localhost redhat]$ touch file7

  [redhat@localhost redhat]$ touch file8

  [redhat@localhost redhat]$ touch file9

  sd(8,17): write failed, user file limit reached.

  touch: creating `file9': Disk quota exceeded

  [redhat@localhost redhat]$ touch file10

  touch: creating `file10': Disk quota exceeded
  [redhat@localhost redhat]$ quota -u redhat

  Disk quotas for user redhat (uid 502):

  Filesystem  blocks   quota   limit   grace   files   quota   limit   grace

  /dev/sdb1  1032*  10  0   6days  9*  0  9

  [redhat@localhost redhat]$ cat /etc/fstab

  LABEL=/      /            ext3  defaults  1 1

  none         /dev/pts     devpts  gid=5,mode=620  0 0

  none         /proc        proc  defaults  0 0

  none         /dev/shm     tmpfs   defaults  0 0

  /dev/cdrom   /mnt/cdrom   udf,iso9660 noauto,owner,kudzu,ro 0 0
  /dev/fd0     /mnt/floppy  auto  noauto,owner,kudzu 0 0

  /dev/sdb5    /mnt/sdb5    ext3  defaults  0 0

  [root@localhost root]# repquota -a

  *** Report for user quotas on device /dev/sdb1

  Block grace time: 7days; Inode grace time: 7days

  Block limits     File limits
  User    used  soft  hard  grace  used  soft  hard  grace

  ----------------------------------------------------------------------

  root  --  20  0  0              2  0  0

  redhat  +-  1032  10  0  7days  9  0  9

  #quotaoff  /mnt/sdb1

  #edquota –u redhat
  如果要永久用配额限制的话,可以手动编辑/etc/fstab 增加:

  /dev/sdb1  /mnt/sb1  ext3   defaults,usrquota,grpquota  0   0

  保存退出!

  取消磁盘配额的方法:

  1)、使用命令quotaoff –a 关闭对应磁盘分区上的配额文件 2)、可编辑/etc/fstab文件 3)、删除/mnt/sd1目录下的aquota.usr、aquota.group两个数据库文件.

上一页234下一页

视频学习

我考网版权与免责声明

① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;

② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。

最近更新

社区交流

考试问答