resize2fs 后 LUKS/ext4 映射驱动器扇区数不匹配

resize2fs 后 LUKS/ext4 映射驱动器扇区数不匹配

使用 e2resize 并在 luks 容器内重新分区 ext4 fs 后,我得到了一些奇怪的结果:

# e2fsck /dev/mapper/a 
e2fsck 1.44.1 (24-Mar-2018)
The filesystem size (according to the superblock) is 356487715 blocks
The physical size of the device is 356487205 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? yes

# fdisk -l /dev/sdc
Disk /dev/sdc: 2.7 TiB, 3000558944256 bytes, 732558336 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xe520dd91

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdc1             256 356487972 356487717  1.3T 83 Linux


Disk /dev/mapper/a: 1.3 TiB, 1460171591680 bytes, 356487205 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

再次调整文件系统大小也不起作用:

# e2fsck -f /dev/mapper/a 
e2fsck 1.44.1 (24-Mar-2018)
The filesystem size (according to the superblock) is 356487715 blocks
The physical size of the device is 356487205 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? no
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/a: 145786/89128960 files (4.8% non-contiguous), 354794507/356487715 blocks

# resize2fs /dev/mapper/a 
resize2fs 1.44.1 (24-Mar-2018)
Resizing the filesystem on /dev/mapper/a to 356487205 (4k) blocks.
resize2fs: Attempt to read block from filesystem resulted in short read while trying to resize /dev/mapper/a
Please run 'e2fsck -fy /dev/mapper/a' to fix the filesystem
after the aborted resize operation.

不知何故,映射驱动器的扇区数现在小于文件系统的扇区数?区别在于就差一点2MB(2MB 是 luks 标头的大小,我相信?)

现在的情况是无法挂载fs。但如果我使用 e2fsck 它不会报告任何错误。

那么这个长度在哪里设置呢。可以以某种方式将其更改为“正确”值吗?

相关内容