0

I want to replace the NVMe drive in an embedded computer that runs Linux. The original drive is a 256 GB gen 3 with 5 partitions. After cloning to a larger drive, partition 5, the data partition, should grow to all utilize all available space.

I used gparted to clone the original NVMe to a 4 TB drive, and I used gparted to attempt to expand the data partition to use all available space. Although the partition did grow, the filesystem did not. I got this error:

resize2fs: New size results in too many block group descriptors

The clone currently boots and the device works. However, if the filesystem is not enlarged, the larger capacity will not be used. Here is some helpful information:

$ 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

Perhaps the block size is too small?

$ sudo blockdev --setbsz 4096 /dev/sdb5
$ sudo blockdev --getbsz /dev/sdb5
4096

I understand that the result from blockdev --getbsz cannot be trusted after a blockdev --setbsz unless the file system is mounted.

After mounting /dev/sdb5:

$ sudo blockdev --getbsz /dev/sdb5
1024

Hmm, the block size is unchanged. What should I do to complete the resizing?

1 Answer 1

2

The explanation is provided here: https://github.com/tytso/e2fsprogs/issues/50#issuecomment-702818715

Your only option is to reformat or use a different FS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .