无法再挂载 XFS 分区

无法再挂载 XFS 分区

我的服务器上有 9 个格式化为 XFS 的分区。

当我尝试安装其中一个时,失败了。其他的都可以正常安装。

root@fileserver2 # mount | grep xfs | head -1
/dev/sdb1 on /mnt/hdd1 type xfs (rw,noatime)

root@fileserver2 # mount -t xfs /dev/sdf3 /mnt/hdd3
mount: wrong fs type, bad option, bad superblock on /dev/sdf3,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

root@fileserver2 # dmesg | tail -2
XFS (sdf3): bad magic number
XFS (sdf3): SB validate failed

因此我尝试使用 xfs_repair -n 来查找辅助 SB,但失败了:

root@fileserver2 # xfs_check /dev/sdf3
xfs_check: /dev/sdf3 is not a valid XFS filesystem (unexpected SB magic number 0x00000000)
xfs_check: WARNING - filesystem uses v1 dirs,limited functionality provided.
xfs_check: read failed: Invalid argument
xfs_check: data size check failed
cache_node_purge: refcount was 1, not zero (node=0x14a7380)
xfs_check: cannot read root inode (22)
bad superblock magic number 0, giving up

root@fileserver2 # xfs_repair -n /dev/sdf3

Phase 1 - find and verify superblock...
bad primary superblock - bad magic number !!!

attempting to find secondary superblock...
............[etc.]
...found candidate secondary superblock... unable to verify superblock, continuing...
[etc.]
...Sorry, could not find valid secondary superblock
Exiting now.

这是该特定驱动器上的分区,包括根分区 (sdf1) 和交换分区 (sdf5)。我发现扩展分区不包含我的 sdf3 (XFS) 分区很奇怪。这意味着我的 XFS 分区将是第二个主分区,对吗?

root@fileserver2 # fdisk -l /dev/sdf

Disk /dev/sdf: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x20a0c72d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1   *           1        2612    20980858+  83  Linux
/dev/sdf2            2613        2855     1951867    5  Extended
/dev/sdf3            2856      243202  1930581796+  83  Linux
/dev/sdf5            2613        2855     1951866   82  Linux swap / Solaris

接下来,我尝试使用它file -s来识别该驱动器上的各种文件系统:

root@fileserver2 # file -s /dev/sdf1
/dev/sdf1: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files)

root@fileserver2 # file -s /dev/sdf2
/dev/sdf2: x86 boot sector; partition 1: ID=0x82, starthead 254, startsector 2, 3903732 sectors, extended partition table (last)\011, code offset 0x1

root@fileserver2 # file -s /dev/sdf3
/dev/sdf3: x86 boot sector; partition 1: ID=0xbf, starthead 254, startsector 63, 3861163530 sectors, extended partition table (last)\011, code offset 0x0

root@fileserver2 # file -s /dev/sdf5
/dev/sdf5: Linux/i386 swap file (new style) 1 (4K pages) size 487965 pages

那么,sdf3 似乎是第二个扩展分区..?奇怪。

我在可以挂载的 XFS 分区上尝试了相同的命令:

root@fileserver2 # file -s /dev/sdb1
/dev/sdb1: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs)

并且还尝试检查sdf3分区开头的数据:

root@fileserver2 # dd if=/dev/sdf3 bs=512 count=64 iflag=direct | hexdump -C
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 fe  |................|
000001c0  ff ff bf fe ff ff 3f 00  00 00 0a ae 24 e6 00 00  |......?.....$...|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200  9c 52 1d 9c b7 00 d7 e9  e8 fc 3c 6f 4e dc 31 27  |.R........<oN.1'|
00000210  e9 98 6b b0 2f 74 c1 69  40 12 58 90 4b e3 d0 73  |..k./[email protected]|
[...]
00007e00  58 46 53 42 00 00 10 00  00 00 00 00 1c c4 95 c1  |XFSB............|
00007e10  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00007e20  41 4c 30 10 33 23 45 5f  88 6c 25 e1 03 a1 be e3  |AL0.3#E_.l%.....|
00007e30  00 00 00 00 10 00 00 04  00 00 00 00 00 00 00 80  |................|
00007e40  00 00 00 00 00 00 00 81  00 00 00 00 00 00 00 82  |................|
00007e50  00 00 00 01 07 31 25 71  00 00 00 04 00 00 00 00  |.....1%q........|
00007e60  00 03 98 92 b4 a4 02 00  01 00 00 10 68 64 64 33  |............hdd3|
00007e70  00 00 00 00 00 00 00 00  0c 09 08 04 1b 00 00 05  |................|
00007e80  00 00 00 00 00 00 00 40  00 00 00 00 00 00 00 3d  |.......@.......=|
00007e90  00 00 00 00 1c c0 fd 1b  00 00 00 00 00 00 00 00  |................|
00007ea0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00007eb0  00 00 00 00 00 00 00 02  00 00 00 00 00 00 00 00  |................|
00007ec0  00 00 00 00 00 00 00 01  00 00 00 0a 00 00 00 0a  |................|
00007ed0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00008000

(完整结果转储:http://f.cl.ly/items/3I3F3c1F1I1Z2f1w1W3Z/hexdump-sdf3.txt

因此,分区不是从扇区 0 开始(就像其他驱动器,如 sdb1 那样),而是从扇区 63 开始(0x7e00 = 32256 / 512 字节/扇区 = 63)。

关于如何解决该问题并且能够安装这个有趣的分区,有什么指示吗?

谢谢。

答案1

您已确定文件系统从分区中的 63 个扇区开始;这是一个完整的磁道(63 个扇区/磁道,因此分区的第一个磁道是扇区 0-62)。考虑到这一点,您可以尝试修改分区表,以便/dev/sdf3从后面一个磁道开始,即从

/dev/sdf3            2856      243202  1930581796+  83  Linux

/dev/sdf3            2857      243202  1930581796+  83  Linux

然后看看是否可以安装它。

相关内容