Filesystems
在超級塊中發現 ext4 損壞,但可以掛載文件系統
崩潰後,我有一個 Ext4 文件系統(在 LVM LV 上),執行時出現以下錯誤
fsck.ext4 -nf
:e2fsck 1.42.12 (29-Aug-2014) Corruption found in superblock. (blocks_count = 0). The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device>
我已經跑去
dumpe2fs
尋找超級塊的其他副本,但是無論我在fsck.ext4
s-b
選項之後添加哪個副本,我都會得到完全相同的輸出。此外,
dumpe2fs
查看正確的塊數(Block count: 4294967296
16TB 文件系統)。這是(截斷的)輸出:Filesystem volume name: <none> Last mounted on: /storage Filesystem UUID: fef00ffc-5341-4158-9279-88cad6cc211f Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: user_xattr acl Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 268435456 Block count: 4294967296 Reserved block count: 42949672 Free blocks: 534754162 Free inodes: 268391425 First block: 0 Block size: 4096 Fragment size: 4096 Group descriptor size: 64 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 2048 Inode blocks per group: 128 Flex block group size: 16 Filesystem created: Wed Jan 16 11:07:07 2013 Last mount time: Sun Feb 1 21:21:31 2015 Last write time: Sun Feb 1 21:21:45 2015 Mount count: 18 Maximum mount count: -1 Last checked: Wed Jan 16 11:07:07 2013 Check interval: 0 (<none>) Lifetime writes: 14 TB Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 256 Required extra isize: 28 Desired extra isize: 28 Journal inode: 8 Default directory hash: half_md4 Directory Hash Seed: c7ec9ee0-002b-431d-a37c-33db922c6057 Journal backup: inode blocks Journal features: journal_incompat_revoke journal_64bit Journal size: 128M Journal length: 32768 Journal sequence: 0x0000e3fe Journal start: 0 Group 0: (Blocks 0-32767) [ITABLE_ZEROED] Checksum 0x4623, unused inodes 2034 Primary superblock at 0, Group descriptors at 1-2048 Block bitmap at 2049 (+2049), Inode bitmap at 2065 (+2065) Inode table at 2081-2208 (+2081) 28637 free blocks, 2036 free inodes, 1 directories, 2034 unused inodes Free blocks: 4130-4133, 4135-32767 Free inodes: 11, 14-2048 Group 1: (Blocks 32768-65535) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xfd95, unused inodes 2048 Backup superblock at 32768, Group descriptors at 32769-34816 Block bitmap at 2050 (bg #0 + 2050), Inode bitmap at 2066 (bg #0 + 2066) Inode table at 2209-2336 (bg #0 + 2209) 1522 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: 34817, 35343-36863 Free inodes: 2049-4096 Group 2: (Blocks 65536-98303) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x95d0, unused inodes 2048 Block bitmap at 2051 (bg #0 + 2051), Inode bitmap at 2067 (bg #0 + 2067) Inode table at 2337-2464 (bg #0 + 2337) 115 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: 85901-86015 Free inodes: 4097-6144 Group 3: (Blocks 98304-131071) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x6e40, unused inodes 2048 Backup superblock at 98304, Group descriptors at 98305-100352 Block bitmap at 2052 (bg #0 + 2052), Inode bitmap at 2068 (bg #0 + 2068) Inode table at 2465-2592 (bg #0 + 2465) 1505 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: 100895-102399 Free inodes: 6145-8192 Group 4: (Blocks 131072-163839) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x4788, unused inodes 2048 Block bitmap at 2053 (bg #0 + 2053), Inode bitmap at 2069 (bg #0 + 2069) Inode table at 2593-2720 (bg #0 + 2593) 1808 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: 141552-143359 Free inodes: 8193-10240 Group 5: (Blocks 163840-196607) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x0d39, unused inodes 2048 Backup superblock at 163840, Group descriptors at 163841-165888 Block bitmap at 2054 (bg #0 + 2054), Inode bitmap at 2070 (bg #0 + 2070) Inode table at 2721-2848 (bg #0 + 2721) 2023 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: 165913-167935 Free inodes: 10241-12288 Group 6: (Blocks 196608-229375) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xc119, unused inodes 2048 Block bitmap at 2055 (bg #0 + 2055), Inode bitmap at 2071 (bg #0 + 2071) Inode table at 2849-2976 (bg #0 + 2849) 1755 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: 198541-198655, 223640-225279 Free inodes: 12289-14336 Group 7: (Blocks 229376-262143) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0xf858, unused inodes 2048 Backup superblock at 229376, Group descriptors at 229377-231424 Block bitmap at 2056 (bg #0 + 2056), Inode bitmap at 2072 (bg #0 + 2072) Inode table at 2977-3104 (bg #0 + 2977) 1796 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: 231676-233471 Free inodes: 14337-16384 Group 8: (Blocks 262144-294911) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x6a75, unused inodes 2048 Block bitmap at 2057 (bg #0 + 2057), Inode bitmap at 2073 (bg #0 + 2073) Inode table at 3105-3232 (bg #0 + 3105) 1700 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: 278876-280575 Free inodes: 16385-18432 Group 9: (Blocks 294912-327679) [INODE_UNINIT, ITABLE_ZEROED] Checksum 0x3840, unused inodes 2048 Backup superblock at 294912, Group descriptors at 294913-296960 Block bitmap at 2058 (bg #0 + 2058), Inode bitmap at 2074 (bg #0 + 2074) Inode table at 3233-3360 (bg #0 + 3233) 1986 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes Free blocks: 297022-299007 Free inodes: 18433-20480 ... truncated ...
奇怪的是我可以掛載文件系統而沒有任何(明顯的)問題(儘管我還不敢寫它)。
對於允許我完成 fsck 的解決方案有任何建議/指針/想法嗎?
您的設備正好有 4294967296 個塊,即 2 32,所以這聽起來像是一個可變大小的問題……如果您執行的是 32 位 e2fsck,則可以解釋錯誤消息;您看到的錯誤來自
e2fsck/super.c
:check_super_value(ctx, "blocks_count", ext2fs_blocks_count(sb), MIN_CHECK, 1, 0);
其中
check_super_value()
定義為static void check_super_value(e2fsck_t ctx, const char *descr, unsigned long value, int flags, unsigned long min_val, unsigned long max_val)
因此,在 4 個字節的 32 位系統上
unsigned long
,您blocks_count
最終將是 0 並且無法通過最小值檢查,而不會表明文件系統存在實際問題。僅在崩潰後才能看到此內容的原因是,
fsck
它僅在崩潰後或文件系統沒有被檢查太久時執行。如果您正在執行 32-bit ,那麼您的問題的答案將是
e2fsck
嘗試 64-bit 版本…