如何让 resize2fs 真正适合您的文件系统?

如何让 resize2fs 真正适合您的文件系统?

这里使用 Ubuntu Mint,20.1 Cinnamon。

我正在尝试尽可能地减少 SD 分区,但是当使用 resize2fs

sudo e2fsck -f /dev/sdb2
sudo resize2fs -M /dev/sdb2

它将分区大小调整为大约 7 GB,而不是预期的大约 5 GB。df 确认了这一点:

/dev/sdb2       6,4G  4,4G  1,7G  73%

它是最后一个分区(sdb1 是系统启动分区)。

为什么会出现这种行为?我希望它更接近实际的文件系统。

tune2fs命令的结果如下:

Filesystem volume name:   writable
Last mounted on:          /
Filesystem UUID:          b09bb4c8-de4d-4ce6-a93f-30c4c9241a58
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 dir_nlink extra_isize metadata_csum
Filesystem flags:         unsigned_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              417664
Block count:              1688722
Reserved block count:     69406
Overhead blocks:          34024
Free blocks:              512908
Free inodes:              294800
First block:              0
Block size:               4096
Fragment size:            4096
Group descriptor size:    64
Reserved GDT blocks:      439
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8032
Inode blocks per group:   502
Flex block group size:    16
Filesystem created:       Tue Aug  9 14:05:18 2022
Last mount time:          Mon Feb 13 23:27:27 2023
Last write time:          Mon Feb 13 23:27:41 2023
Mount count:              2
Maximum mount count:      -1
Last checked:             Mon Feb 13 17:13:10 2023
Check interval:           0 (<none>)
Lifetime writes:          10 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:      24701edc-0cdd-48cd-a0ff-573147f7acac
Journal backup:           inode blocks
Checksum type:            crc32c
Checksum:                 0x174a0a99

相关内容