歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux LVM邏輯卷錯誤恢復一例

Linux LVM邏輯卷錯誤恢復一例

日期:2017/2/28 16:17:29   编辑:Linux教程

使用LVM建立了一個邏輯卷為/dev/mapper/test-test。

由於異常關機,造了邏輯卷錯誤,無法掛載。

於是檢查邏輯卷,提示:

# 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?

然後,查看了一下這個邏輯卷的信息:

# 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

然後,嘗試了一下,用備用超級塊來修復:

# 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?

結果仍然報錯。那就再試試重啟lvm服務吧,執行

/etc/init.d/lvm stop

/etc/init.d/lvm start

然後再執行:

# 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

執行/etc/init.d/checkfs.sh start,也可檢查、修復文件系統。

Copyright © Linux教程網 All Rights Reserved