“resize2fs: Permission denied to resize filesystem” | ARKIT
Observed error message while doing online resize “resize2fs: Permission denied to resize filesystem”. Unable to extend the file system size.
# resize2fs /dev/xvdh resize2fs 1.42.9 (28-Dec-2013) Filesystem at /dev/xvdh is mounted on /data3; on-line resizing required old_desc_blocks = 256, new_desc_blocks = 319 resize2fs: Permission denied to resize filesystem
Error messages in /var/log/messages and dmesg output as below
EXT4-fs (xvdh): error count since last fsck: 1 EXT4-fs (xvdh): initial error at time 1587778646: ext4_free_blocks:4885 EXT4-fs (xvdh): last error at time 1587778646: ext4_free_blocks:4885 [43567001.312562] EXT4-fs warning (device xvdh): ext4_resize_begin:44: There are errors in the filesystem, so online resizing is not allowed
resize2fs: Permission denied to resize filesystem – Solution
Since file system has internal block level errors you need to un-mount the file system then run the file system check and correct block level errors.
# unmount -l /data3 # e2fsck -y /dev/xvdh
above command will take longer time based on the FS size.
Resize the file system before mounting it back
# resize2fs /dev/xvdh
After successful resize, mount it back
# mount /dev/xvdh /data3
That’s about the error and solution. if you need more details on e2fsck check man page.
# umount /data3 # e2fsck /dev/xvdh e2fsck 1.42.9 (28-Dec-2013) /dev/xvdh contains a file system with errors, check forced. 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 Block bitmap differences: -(440462435--440463535) Fix<y>? yes Free blocks count wrong for group #13441 (2069, counted=3170). Fix<y>? yes Free blocks count wrong (42040857, counted=42041958). Fix<y>? yes /dev/xvdh: ***** FILE SYSTEM WAS MODIFIED ***** /dev/xvdh: 244102/134217728 files (25.9% non-contiguous), 494828954/536870912 blocks # resize2fs /dev/xvdh resize2fs 1.42.9 (28-Dec-2013) Resizing the filesystem on /dev/xvdh to 667942912 (4k) blocks. The filesystem on /dev/xvdh is now 667942912 blocks long. # mount -av /data3 : successfully mounted # df -h Filesystem Size Used Avail Use% Mounted on /dev/xvdh 2.5T 1.9T 526G 78% /data3