Score:0

How do you get resize2fs to actually fit to your filesystem?

ve flag

Using Ubuntu Mint here, 20.1 Cinnamon.

I'm trying to reduce a SD partition as much as possible, but when use resize2fs

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

it resizes the partition to around 7 GB rather than the expected around 5 GB. df confirms as much:

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

It is the last partition (sdb1 is the system-boot partition).

Why is it showing that behavior? I would expect it to be a lot closer to the actual filesystem.

The result of the tune2fs command is the following:

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
Nikita Kipriyanov avatar
za flag
Can you [attach](https://serverfault.com/posts/1122844/edit) `tune2fs -l /dev/sdb2`?
Silverlord avatar
ve flag
Done, thank you.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.