對於比較大的 filesystem,預設在 mount 次數 > 30次或180天後,系統若有重新開機會自動作 FSCK,這會使 downtime 非常長
所以有關閉 EXT3 AUTO FSCK 的需求
 
首先使用以下指令檢查檔案系統資訊:
tune2fs -l /dev/mapper/VolGroup00-LogVol00


 
 
 
 
tune2fs 1.39 (29-May-2006)
Filesystem volume name:
Last mounted on:
Filesystem UUID: 3629cde7-a2c5-4d8c-bf41-176081629bb7
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 145424384
Block count: 145416192
Reserved block count: 1454161
Free blocks: 102103654
Free inodes: 144557899
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 989
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 32768
Inode blocks per group: 1024
Filesystem created: Mon Aug 3 18:09:20 2015
Last mount time: Mon Sep 14 10:13:13 2015
Last write time: Mon Sep 21 14:22:32 2015
Mount count: 14
Maximum mount count: -1
Last checked: Mon Aug 3 18:09:20 2015
Check interval: 0 ()
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: tea
Directory Hash Seed: 9f45b315-a11b-41e2-817c-1d535ae9d1c0
Journal backup: inode blocks

 
 
 
 
方法一:永久關閉 tune2fs
只關閉天數限制
tune2fs -i 0 /dev/mapper/VolGroup00-LogVol00
 
關閉 mount 次數與天數限制
tune2fs -c 0 -i 0 /dev/mapper/VolGroup00-LogVol00
 
方法二:永久關閉 fstab
編輯 /etc/fstab,在第 6 欄位修改成 0
 
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
修改成
/dev/VolGroup00/LogVol00 / ext3 defaults 1 0
 
方法三:暫時關閉(reboot系統前)
使用以下指令reboot 系統
shutdown -rf
 
參數說明:
-r Reboot after shutdown
-f Skip fsck on reboot
 
# 關閉系統寫入文件最後讀取時間
sed -i ‘s/ext3 defaults[[:space:]]/ext3 defaults,noatime/’ /etc/fstab
# 關閉系統按時間間隔決定下次重啟時運行fsck
grep ext3 /etc/fstab | grep -v boot | awk ‘{print $1}’ | xargs -i tune2fs -i0 {}
# 關閉系統按mount次數決定下次重啟時運行fsck
# grep ext3 /etc/fstab | grep -v boot | awk ‘{print $1}’ | xargs -i tune2fs -c-1 {}
19580012

Tags: , , ,