我想更换运行 Linux 的嵌入式计算机中的 NVMe 驱动器。原始驱动器是 256 GB 的第三代驱动器,有 5 个分区。克隆到更大的驱动器分区 5 后,分区data
应该会增大到充分利用所有可用空间。
我曾经gparted
将原始 NVMe 克隆到 4 TB 驱动器,并尝试gparted
扩展data
分区以使用所有可用空间。虽然分区确实增长了,但文件系统却没有增长。我收到此错误:
resize2fs: New size results in too many block group descriptors
克隆当前已启动,设备正常运行。但是,如果不扩大文件系统,则不会使用更大的容量。以下是一些有用的信息:
$ sudo tune2fs -l /dev/sdb5
tune2fs 1.47.0 (5-Feb-2023)
Filesystem volume name: data
Last mounted on: /data
Filesystem UUID: 64f5365e-edfc-4781-a285-9a053e6937fa
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr dir_index filetype meta_bg extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 27583488
Block count: 220661060
Reserved block count: 8826764
Overhead clusters: 6962786
Free blocks: 122392011
Free inodes: 27535064
First block: 1
Block size: 1024
Fragment size: 1024
Group descriptor size: 64
Blocks per group: 8192
Fragments per group: 8192
Inodes per group: 1024
Inode blocks per group: 256
First meta block group: 258
Flex block group size: 16
Filesystem created: Fri Jan 13 14:00:05 2023
Last mount time: Fri Jun 14 11:27:22 2024
Last write time: Fri Jun 14 11:34:14 2024
Mount count: 0
Maximum mount count: -1
Last checked: Fri Jun 14 11:34:14 2024
Check interval: 0 (<none>)
Lifetime writes: 266 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: ef21ef18-27b0-4363-a679-6e709cc7027b
Journal backup: inode blocks
Checksum type: crc32c
Checksum: 0x4649ffc4
也许块大小太小了?
$ sudo blockdev --setbsz 4096 /dev/sdb5
$ sudo blockdev --getbsz /dev/sdb5
4096
我理解,除非安装了文件系统,否则结果blockdev --getbsz
不可信。blockdev --setbsz
安装后/dev/sdb5
:
$ sudo blockdev --getbsz /dev/sdb5
1024
嗯,块大小没有改变。我应该怎么做才能完成调整大小?