Symptoms:
Customers increase the disk space on their VeloCloud Orchestrator by following https://docs.vmware.com/en/VMware-SD-WAN/4.5/sd-wan-orchestrator-deployment-and-monitoring-guide/GUID-A1ED5E3C-2B5D-4719-9D5B-143BB3F47FE2.html.
In step 10,
When attempting to extend a logical volume using the lvextend
command, the following error is encountered:
resize2fs: Permission denied to resize filesystem
The error occurs because:
The file system (EXT4
) has internal block-level errors.
These errors must be corrected before resizing operations can proceed.
Online resizing is not allowed when there are unresolved errors in the file system.
Error messages in /var/log/messages and dmesg output will be like 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
Follow these steps to resolve the issue:
Unmount the file system:
umount -l /dev/mapper/store3-data
Identify processes running on the file system:
fuser -v -m /dev/mapper/store3-data
Kill or stop the services using the file system. For example, if clickhouse
is running:
service clickhouse-server stop
Run the file system check and repair:
e2fsck -y /dev/mapper/store3-data
Note: This process can take a significant amount of time depending on the size of the file system.
Resize the file system:
resize2fs /dev/mapper/store3-data
Mount the file system:
mount /dev/mapper/store3-data /store3
Verify the resized file system:
df -h
Data Loss: File system errors or improper handling during repair can result in data loss.
Mitigation: Always back up critical data before starting the repair process.
Extended Downtime: Repairing and resizing large file systems can take considerable time.
Mitigation: Schedule the operation during a maintenance window to minimize impact on production.
Service Disruption: Stopping services to unmount the file system may disrupt dependent applications.
Mitigation: Plan service outages in advance.
Incomplete Repairs: Failure to resolve all block-level errors might cause issues during resizing.
Mitigation: Double-check the e2fsck
output and rerun the command if necessary until no errors remain.
Additional Notes
Ensure that all services dependent on the affected file system are stopped before proceeding.
It is recommended to perform a backup of the file system before initiating any repair or resize operations.
The e2fsck
command requires unmounted file systems to prevent data corruption.