ext3格式下的quota的实现(转)

ext3格式下的quota的实现(转)[@more@]  ext3是由开放资源社区开发的日志文件系统,ext3被设计成是ext2的升级版本,ext3在ext2的基础上加入了记录元数据的日志功能,努力保持向前和向后的兼容性。这个文件系统被称为ext2的下一个版本。
  ext3fs最大的优点是向下兼容ext2,而且ext3fs还支持异步的日志,这意味着它的性能可能比ext2还好。但是使用ext3文件系统时不支持磁盘限量功能。
  red hat从kernel2.4.17-pre8以后支持ext3的磁盘quota,我选择了更为稳定的kernel2.4.18来实现。
  
  <1.源文件>
  kernel-2.4.18: http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.18.tar.gz
  quota: ftp://ftp.rpmfind.net/linux/redh ... ota-3.03-1.i386.rpm
  把档案放在/home/src下

  2-1-2)kernel升级过程:
  #cd /home/src
  #mkdir kernel_update
  #cp ./linux-2.4.18.tar.gz ./kernel_update
  #cd kernel_update
  #tar zxvf linux-2.4.18.tar.gz
  #cd linux
  #make menuconfig
  此时出现Linux Kernel v2.4.18 Configuration的窗口
  
  Processor type and features ---&gt
  General setup ---&gt
  Memory Technology Devices (MTD) ---&gt
  Parallel port support ---&gt
  Plug and Play configuration ---&gt
  Block devices ---&gt
  Multi-device support (RAID and LVM) ---&gt
  Networking options ---&gt
  Telephony Support ---&gt
  ATA/IDE/MFM/RLL support ---&gt
  SCSI support ---&gt
  Fusion MPT device support ---&gt
  I2O device support ---&gt
  Network device support ---&gt
  Amateur Radio support ---&gt
  IrDA (infrared) support ---&gt
  ISDN subsystem ---&gt
  Old CD-ROM drivers (not SCSI, not IDE) ---&gt
  Input core support ---&gt
  Character devices ---&gt
  Multimedia devices ---&gt
  File systems ---&gt
  Console drivers ---&gt
  Sound ---&gt
  USB support ---&gt
  Kernel hacking ---&gt
  ---
  Load an Alternate Configuration File
  Save Configuration to an Alternate File
  以下都是kernel里的选项,可以根据server硬件的不同自行选择
  
  与quota有关的设定如下
  找到File systems ---&gt 的字样 (第22行) 按空格键
  把第一行的Quota support前打上*号
   Quota support
  Kernel automounter support
   Kernel automounter version 4 support (also supports v3)
   Reiserfs support
  Ext3 journalling file system support (EXPERIMENTAL)

   JBD (ext3) debugging support
   DOS FAT fs support
   Compressed ROM file system support
   Virtual memory file system support (former shm fs)
   Simple RAM-based file system support
   ISO 9660 CDROM file system support
  [ ] Microsoft Joliet CDROM extensions
  [ ] Transparent decompression extension
   Minix fs support
   FreeVxFS file system support (VERITAS VxFS(TM) compatible)
   NTFS file system support (read only)
   OS/2 HPFS file system support

   /proc file system support
   /dev/pts file system for Unix98 PTYs
   ROM file system support
   Second extended fs support
   System V/Xenix/V7/Coherent file system support
   UDF file system support (read only)
   UFS file system support (read only)
  Network File Systems ---&gt
  
  选定以后选择exit退出。
  
  出现以下:
  ┌──────────────────────────────────────────────────────────┐
  │ Do you wish to save your new kernel configuration? │
  ├──────────────────────────────────────────────────────────┤
  │ │
  └──────────────────────────────────────────────────────────┘
  选择yes
  
  然后出现以下字样:
  Saving your kernel configuration...
  
  *** End of Linux kernel configuration.
  *** Check the top-level Makefile for additional configuration.
  *** Next, you must run 'make dep'.
  
  2-1-2)编译kernel
  #make dep
  #make clean
  #make bzImage
  #make modules
  #make modules_install
  
  2-1-3)cp新的kernel到启动区
  #cp /home/src/kernel_update/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.4.18
  #mkinitrd /boot/initrd-2.4.18.img 2.4.18
  #vi /etc/lilo.conf
  在最后添加以下
  image=/boot/vmlinuz-2.4.18 <= kernel的路径
  label=newkernel <= 启动时的卷标
  initrd=/boot/initrd-2.4.18.img <= kernelimg的路径
  read-only
  root=/dev/hda2 <= / 所在的区
  
  #/sbin/lilo -m /boot/map
  
  2-1-4)重新启动server
  #reboot
  
  重新启动进入时在redhat lilo的选择界面选择newkernel进入
  
  2-2)设定quota

  2-2-1)安装quota。
  #cd /home/src
  #rpm -ivv quota-3.03-1.i386.rpm
  
  2-2-2)设定quota,以home为例
  #vi /etc/fstab
  把
  LABEL=/home /home ext3 defaults 1 2
  改成
  LABEL=/home /home ext3 defaults,usrquota,grpquota 1 2
  重启server
  #/sbin/reboot
  
  2-2-3)设定用户限定
  #quotacheck -uvg /home
  #edquota -u test
  Disk quotas for user chenc (uid 694):
  Filesystem blocks soft hard inodes soft hard
  /dev/hda5 6000 5000 6000 3 5000 6000
  在soft和hard下添上需要限制的磁盘大小(单位是K)
  
  #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/hda5 1minutes 1minutes
  设定soft quota和hard quota之间的时间。
  
  启动quota
  #quotaon -av
  
  
  用test帐号用ftp进行测试,当test目录达到了5M时,提示Disk quota exceeded。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10617542/viewspace-948723/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10617542/viewspace-948723/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值