熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

ext3格式下的quota的實現

2022-06-13   來源: Oracle 

  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

From:http://tw.wingwit.com/Article/program/Oracle/201311/16642.html
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.