linux磁盘配额
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-04-26
ated 格式化home的逻辑卷 [root@localhost ~]# mkfs -t ext3 /dev/newvg/home mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 2490368 inodes, 4980736 blocks 249036 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=0 152 block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 33 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. 挂载home分区到/mnt下 [root@localhost ~]# mount /dev/newvg/home /mnt/ 开机自动挂载并检查 [root@localhost ~]# vim /etc/fstab LABEL=/ / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 devpts /dev/pts devpts gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs defaults 0 0 proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 LABEL=SWAP-sda2 swap swap defaults 0 0 /dev/newvg/home /home ext3 defaults,usrquota,grpquota 0 1 ~ ~ ~ :wq 保持权限复制/home 下的文件到 新的分区 [root@localhost ~]# cp -a /home/* /mnt/ 删除/home 下所有文件 [root@localhost mnt]# rm -rf /home/* 重新挂载 [root@localhost home]# umount /mnt/ [root@localhost home]# mount /dev/newvg/home /home/ 重新挂载开启磁盘配额 [root@localhost home]# mount -o uerquota,grpquota,remount /dev/newvg/home mount: /home not mounted already, or bad option 开启磁盘配额 [root@localhost home]#mount –o usrquota,grpquota /dev/newvg/home 重新生成配额文件 [root@localhost home]# quotacheck -cuvg /home quotacheck: Scanning /dev/mapper/newvg-home [/home] quotacheck: Cannot stat old group quota file: No such file or directory quotacheck: Cannot stat old group quota file: No such file or directory done quotacheck: Checked 4 directories and 6 files quotacheck: Old file not found. [root@localhost home]# ls -l total 36 -rw------- 1 root root 7168 Feb 21 02:02 aquota.group -rw------- 1 root root 7168 Feb 21 02:02 aquota.user drwx------ 2 root root 16384 Feb 21 01:28 lost found drwx------ 2 redhat redhat 4096 Aug 17 2008 redhat 创建用户并设置密码 [root@localhost home]# useradd yueyang [root@localhost home]# passwd yueyang Changing password for user yueyang. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. 设置对用户yueyang的配额 [root@localhost home]# edquota -u yueyang Disk quotas for user yueyang (uid 501): Filesystem blocks |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于linux磁盘配额的所有评论