今天的我們?cè)缟衔业姆?wù)器無(wú)法啟動(dòng),停在檢查
mail.wofman.com/var filesystem bad ,我的mail文件在此目錄下;
Bad magic number in super_block while trying to open /var
***An error occured during the file system check
*** Dropping you to a shell; the system will reboot
*** when you leave the shell.
Press enter for maintenance
(or type Control-D to continue):
輸入admai pass 后進(jìn)入 (Repair filesystem)#
查看/etc/fstab 沒(méi)有錯(cuò)誤,
運(yùn)行fsck -p /var
運(yùn)行完畢有下面提示:
/dev/sda3 contains a file system with errors, check forced.
/dev/sda3: Inodes that were part of a corrupted orphan linked list found.
/dev/sda3: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
運(yùn)行fsck.ext3 -p /dev/sda3 ;未能修復(fù)
運(yùn)行fsck.ext3 -y /dev/sda3 ; repair ok
;注意在修復(fù)其他filesystem時(shí)要umount掉運(yùn)行該命令。
文件系統(tǒng)--fsck
指令:fsck
使用權(quán)限 : 終極使用者
使用方式 : fsck --help
fsck 1.35 (28-Feb-2004)
fsck.ext3: invalid option -- h
Usage: fsck.ext3 [-panyrcdfvstDFSV] [-b superblock] [-B blocksize]
[-I inode_buffer_blocks] [-P process_inode_size]
[-l|-L bad_blocks_file] [-C fd] [-j ext-journal]
[-E extended-options] device
Emergency help:
-p Automatic repair (no questions) ;自動(dòng)修復(fù)
-n Make no changes to the filesystem ;模擬修復(fù)
-y Assume "yes" to all questions ;所有的問(wèn)題都回答yes
-c Check for bad blocks and add them to the badblock list
;檢查壞塊,并記錄下壞塊列表
-f Force checking even if filesystem is marked clean
;對(duì)標(biāo)記為“干凈”的文件系統(tǒng)進(jìn)行強(qiáng)制檢查 v Be verbose ;周詳信息
-b superblock Use alternative superblock
-B blocksize Force blocksize when looking for superblock
-j external-journal Set location of the external journal
-l bad_blocks_file Add to badblocks list
-L bad_blocks_file Set badblocks list
引用網(wǎng)上的一個(gè)例子 :
問(wèn)題: SLES8 在mount盤陣的時(shí)候,出現(xiàn)
server1:/ # mount /dev/sde1 /foo
mount: wrong fs type, bad option, bad superblock on /dev/sde1,
or too many mounted file systems
的問(wèn)題。請(qǐng)問(wèn)這種問(wèn)題怎么能解決呢?
回答:
這個(gè)錯(cuò)誤信息標(biāo)識(shí) /dev/sde1 設(shè)備上的 ext3 文件系統(tǒng)的終極塊損壞了,ext3 文件系統(tǒng)的元數(shù)據(jù)保存在終極塊中。
ext3 文件系統(tǒng)更有一些備份的終極塊,能嘗試用備份的終極塊加載 ext3 文件系統(tǒng)和修復(fù) ext3 文件系統(tǒng)。
備份的終極塊信息能通過(guò)以下命令獲得,這個(gè)命令模擬 ext3 文件系統(tǒng)創(chuàng)建時(shí)的動(dòng)作并打印出備份終極塊的位置,給出的位置缺省是以4k為單位的,mount 在使用時(shí)需要為他提供以1k為單位的偏移,需要乘4:
注意!!!!!一定要使用’-n’作為參數(shù)模擬 ext3 文件系統(tǒng)的創(chuàng)建而不是真的創(chuàng)建 ext3 文件系統(tǒng)
# mkfs.ext3 -n /dev/hda7
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2198880 inodes, 4393738 blocks
219686 blocks (5.00%) reserved for the super user
First data block=0
135 block groups
32768 blocks per group, 32768 fragments per group
16288 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
使用備份的終極塊來(lái)加載 ext3 文件系統(tǒng)的命令:
語(yǔ)法: mount.ext3 -o sb=n
# mount.ext3 -o sb=131072 /dev/hda7 /media/hda7
使用備份的終極塊來(lái)修復(fù) ext3 文件系統(tǒng)的命令
語(yǔ)法:fsck.ext3 -b superblock
# fsck.ext3 -b 32768 /dev/hda7