好好的系統(tǒng)突然啟動(dòng)時(shí)出現(xiàn)了
***an error occurred during the file system check
***Dropping you to a shell;thesystem will reboot
***when you leave the shell.
Give root password for mainteance
(or type Control -D for normal startup)
是文件系統(tǒng)出了錯(cuò)誤。用fsck進(jìn)行回復(fù),剛開(kāi)始使用-a選項(xiàng),沒(méi)有成功,后來(lái)仔細(xì)看了出錯(cuò)提示,
解決方法,root密碼
于是檢查邏輯卷,提示:
# fsck.ext3 -f /dev/mapper/test-test
e2fsck 1.38 (30-Jun-2005)
fsck.ext3: Attempt to read block from filesystem resulted in short read while trying to open /dev/mapper/test-test
Could this be a zero-length partition?
然后,查看了一下這個(gè)邏輯卷的信息:
# mkfs.ext3 -n /dev/mapper/test-test
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
6553600 inodes, 13107200 blocks
655360 blocks (5.00%) reserved for the super user
First data block=0
400 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
然后,嘗試了一下,用備用超級(jí)塊來(lái)修復(fù):
# fsck.ext3 -b 163840 /dev/mapper/test-test
e2fsck 1.38 (30-Jun-2005)
fsck.ext3: Attempt to read block from filesystem resulted in short read while trying to open /dev/mapper/test-test
Could this be a zero-length partition?
結(jié)果仍然報(bào)錯(cuò)。那就再試試重啟lvm服務(wù)吧,執(zhí)行
/etc/init.d/lvm stop
/etc/init.d/lvm start
然后再執(zhí)行:
# fsck.ext3 -b 163840 /dev/mapper/test-test
e2fsck 1.38 (30-Jun-2005)
ext3 recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
/dev/mapper/test-test: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/test-test: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mapper/test-test: 31/6553600 files (3.2% non-contiguous), 1823265/13107200 blocks
執(zhí)行/etc/init.d/checkfs.sh start,也可檢查、修復(fù)文件系統(tǒng)。
執(zhí)行
(Repair filesystem)# fdisk -l 查看所有的/dev
之后依次 :
(Repair filesystem)#fsck -y /dev/sda2
(Repair filesystem)#fsck -y /dev/sda3
(Repair filesystem)#fsck -y /dev/sda4
(Repair filesystem)#fsck -y /dev/sda5
說(shuō)可以嘗試用不帶-a或-p的fsck,過(guò)程中會(huì)讓你選擇幾個(gè)yes/no,是關(guān)于文件塊修復(fù)的,都選yes就可以了,成功。
以后要養(yǎng)成正常關(guān)機(jī)的好習(xí)慣。。