1

Topic: Error growing partition because of ext4 FS grow error

Hi, I dual boot W11 and a debian-based linux distro, I just tried to expand the extented partition (/dev/sda5) (linux) but I got an error in the "grow file system" step and my partition ended up like THIS which shows 17.01GB of unallocated space in sda5, I googled this and find similar cases that were fixed by running "sudo e2fsck --cc /dev/sda5"  and then checking the partition in gparted, (which i did  but i keep getting the same error message), I run "sudo e2fsck -f /dev/sda5" too before resizing but I get the same error; this is the log after performing a check in the partition:

CHECK

GParted 1.3.1

configuration --enable-libparted-dmraid --enable-online-resize

libparted 3.4

========================================

Device:    /dev/sda
Model:    ATA WDC WDS500G2B0A-
Serial:    183302A001D6
Sector size:    512
Total sectors:    976773168
 
Heads:    255
Sectors/track:    2
Cylinders:    1915241
 
Partition table:    msdos
 
Partition    Type    Start    End    Flags    Partition Name    File System    Label    Mount Point
/dev/sda1    Primary    2048    277133627    boot        ntfs        
/dev/sda2    Primary    277135360    278468607    msftres        ntfs        
/dev/sda3    Primary    278468608    817381375            ntfs    Disco local    
/dev/sda4    Extended    817381376    976773119    lba        extended        
    /dev/sda5    Logical    817383424    957911039            ext4        
    /dev/sda6    Logical    957913088    976773119            linux-swap        
========================================

Device:    /dev/sdb
Model:    Kingston DataTraveler 3.0
Serial:    none
Sector size:    512
Total sectors:    60437492
 
Heads:    255
Sectors/track:    2
Cylinders:    118504
 
Partition table:    none
 
Partition    Type    Start    End    Flags    Partition Name    File System    Label    Mount Point
/dev/sdb    Unpartitioned    0    60437491            iso9660    GParted-live    
========================================

Check and repair file system (ext4) on /dev/sda5  00:00:07    ( ERROR )
        
calibrate /dev/sda5  00:00:00    ( SUCCESS )
        
path: /dev/sda5 (partition)
start: 817383424
end: 957911039
size: 140527616 (67.01 GiB)
check file system on /dev/sda5 for errors and (if possible) fix them  00:00:07    ( SUCCESS )
        
e2fsck -f -y -v -C 0 '/dev/sda5'  00:00:07    ( SUCCESS )
        
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

1068111 inodes used (32.60%, out of 3276800)
8047 non-contiguous files (0.8%)
1335 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 884786/1104
11124960 blocks used (84.88%, out of 13106952)
0 bad blocks
1 large file

728106 regular files
145120 directories
0 character device files
0 block device files
3 fifos
8024 links
194872 symbolic links (182209 fast symbolic links)
1 socket
------------
1076126 files
e2fsck 1.46.2 (28-Feb-2021)
grow file system to fill the partition  00:00:00    ( ERROR )
        
resize2fs -p '/dev/sda5'  00:00:00    ( ERROR )
        
resize2fs 1.46.2 (28-Feb-2021)
Please run 'e2fsck -f /dev/sda5' first.

if i try to shrink the partition i get:

GParted 1.3.1

configuration --enable-libparted-dmraid --enable-online-resize

libparted 3.4

========================================

Device:    /dev/sda
Model:    ATA WDC WDS500G2B0A-
Serial:    183302A001D6
Sector size:    512
Total sectors:    976773168
 
Heads:    255
Sectors/track:    2
Cylinders:    1915241
 
Partition table:    msdos
 
Partition    Type    Start    End    Flags    Partition Name    File System    Label    Mount Point
/dev/sda1    Primary    2048    277133627    boot        ntfs        
/dev/sda2    Primary    277135360    278468607    msftres        ntfs        
/dev/sda3    Primary    278468608    817381375            ntfs    Disco local    /mnt/tmp
/dev/sda4    Extended    817381376    976773119    lba        extended        
    /dev/sda5    Logical    817383424    957911039            ext4        
    /dev/sda6    Logical    957913088    976773119            linux-swap        
========================================

Device:    /dev/sdb
Model:    Kingston DataTraveler 3.0
Serial:    
Sector size:    512
Total sectors:    60437492
 
Heads:    255
Sectors/track:    2
Cylinders:    118504
 
Partition table:    none
 
Partition    Type    Start    End    Flags    Partition Name    File System    Label    Mount Point
/dev/sdb    Unpartitioned    0    60437491            iso9660    GParted-live    
========================================

Shrink /dev/sda5 from 67.01 GiB to 50.00 GiB  00:00:08    ( ERROR )
        
calibrate /dev/sda5  00:00:00    ( SUCCESS )
        
path: /dev/sda5 (partition)
start: 817383424
end: 957911039
size: 140527616 (67.01 GiB)
check file system on /dev/sda5 for errors and (if possible) fix them  00:00:08    ( SUCCESS )
        
e2fsck -f -y -v -C 0 '/dev/sda5'  00:00:08    ( SUCCESS )
        
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

1068111 inodes used (32.60%, out of 3276800)
8047 non-contiguous files (0.8%)
1335 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 884786/1104
11124960 blocks used (84.88%, out of 13106952)
0 bad blocks
1 large file

728106 regular files
145120 directories
0 character device files
0 block device files
3 fifos
8024 links
194872 symbolic links (182209 fast symbolic links)
1 socket
------------
1076126 files
e2fsck 1.46.2 (28-Feb-2021)
shrink file system  00:00:00    ( ERROR )
        
resize2fs -p '/dev/sda5' 52428800K  00:00:00    ( ERROR )
        
resize2fs 1.46.2 (28-Feb-2021)
Please run 'e2fsck -f /dev/sda5' first.

as extra info, I shrinked the swap partition and then tried to expand sd5 again but it failed and only added the unallocted space to sda5, is there a way to fix this?

PS: I still can boot to linux without any issues

2

Re: Error growing partition because of ext4 FS grow error

Rename thread from:
    Error shrinking/expanding extented partition
to:
    Error growing partition because of ext4 FS grow error
to more specifically describe the fault encountered.

3

Re: Error growing partition because of ext4 FS grow error

I re-created your situation of an ext4 file system not filling it's partition and used GParted to perform a check operation.  It ran e2fsck -f -y -v -C 0 '/dev/PTN' successfully and then ran resize2fs -p '/dev/PTN' successfully.  I used GParted Live CD 1.3.1 which used the very same e2fsprogs 1.46.2 (28-Feb-2021) that your log shows.

The only thing I can conclude is that there is some unique issue with your ext4 file system in that /dev/sdb5 partition which causes these symptoms.

The options I can see are:
1. Backup sdb5, recreate FS and restore files.
   (Take a block level backup for satety and a file level backup to restore from.  Know how to restore your Linux booting).
2. Ask the EXT4 file system developers for help.
   Ask how to resolve resize2fs -p reporting Please run 'fsck -f /dev/PTN' first immediately after fsck -f ... had been run?
   Ext4 Wiki Mailinglists page, Linux-ext4 email list.

4 (edited by ravenous1 2022-03-27 03:00:07)

Re: Error growing partition because of ext4 FS grow error

Hi, I managed to recover the unallocated space within sda5 by deleting the swap partition (sda6) and then extending sda5 (only by 2GB), but I still can't shrink it, I keep getting the same error messages, I'll try to contact ext4 devs, if nothing comes up i'll delete the extended partition and start over , thanks for your help!