ext是由开放资源社区开发的日志文件系统ext被设计成是ext的升级版本ext在ext的基础上加入了记录元数据的日志功能努力保持向前和向后的兼容性这个文件系统被称为ext的下一个版本 extfs最大的优点是向下兼容ext而且extfs还支持异步的日志这意味着它的性能可能比ext还好但是使用ext文件系统时不支持磁盘限量功能 red hat从kernelpre以后支持ext的磁盘quota我选择了更为稳定的kernel来实现 <1.源文件> kernel: quota:ftp:///linux/redhat//en/os/i/RedHat/RPMS/quotairpm 把档案放在/home/src下 <2.设定方法> )kernel升级过程 #cd /home/src #mkdir kernel_update #cp /linuxtargz /kernel_update #cd kernel_update #tar zxvf linuxtargz #cd linux #make menuconfig 此时出现Linux Kernel v Configuration的窗口 Processor type and features > General setup > Memory Technology Devices (MTD) > Parallel port support > Plug and Play configuration > Block devices > Multidevice support (RAID and LVM) > Networking options > Telephony Support > ATA/IDE/MFM/RLL support > SCSI support > Fusion MPT device support > IO device support > Network device support > Amateur Radio support > IrDA (infrared) support > ISDN subsystem > Old CDROM drivers (not SCSI not IDE) > Input core support > Character devices > Multimedia devices > File systems > Console drivers > Sound > USB support > Kernel hacking > Load an Alternate Configuration File Save Configuration to an Alternate File 以下都是kernel里的选项可以根据server硬件的不同自行选择 与quota有关的设定如下 找到File systems > 的字样 (第行) 按空格键 把第一行的Quota support前打上*号 [*] Quota support Kernel automounter support <*> Kernel automounter version support (also supports v) < > Reiserfs support Ext journalling file system support (EXPERIMENTAL) [*] JBD (ext) debugging support < > DOS FAT fs support < > Compressed ROM file system support [*] Virtual memory file system support (former shm fs) < > Simple RAMbased file system support <*> ISO 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/ HPFS file system support [*] /proc file system support [*] /dev/pts file system for Unix PTYs < > ROM file system support <*> Second extended fs support < > System V/Xenix/V/Coherent file system support < > UDF file system support (read only) < > UFS file system support (read only) Network File Systems > 选定以后选择exit退出 出现以下 ┌──────────────────────────────────────────────────────────┐ │ Do you wish to save your new kernel configuration? │ ├──────────────────────────────────────────────────────────┤ │ < Yes > < No > │ └──────────────────────────────────────────────────────────┘ 选择yes 然后出现以下字样 Saving your kernel configuration *** End of Linux kernel configuration *** Check the toplevel Makefile for additional configuration *** Next you must run make dep )编译kernel #make dep #make clean #make bzImage #make modules #make modules_install )cp新的kernel到启动区 #cp /home/src/kernel_update/linux/arch/i/boot/bzImage /boot/vmlinuz #mkinitrd /boot/initrdimg #vi /etc/nf 在最后添加以下 image=/boot/vmlinuz <= kernel的路径 label=newkernel <= 启动时的卷标 initrd=/boot/initrdimg <= kernelimg的路径 readonly root=/dev/hda <= / 所在的区 #/sbin/lilo m /boot/map )重新启动server #reboot 重新启动进入时在redhat lilo的选择界面选择newkernel进入 )设定quota )安装quota #cd /home/src #rpm ivv quotairpm )设定quota以home为例 #vi /etc/fstab 把 LABEL=/home /home ext defaults 改成 LABEL=/home /home ext defaultsusrquotagrpquota 重启server #/sbin/reboot )设定用户限定 #quotacheck uvg /home #edquota u test Disk quotas for user chenc (uid ): Filesystem blocks soft hard inodes soft hard /dev/hda 在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/hda minutes minutes 设定soft quota和hard quota之间的时间 启动quota #quotaon av <测试> 用test帐号用ftp进行测试当test目录达到了M时提示Disk quota exceeded |