Fixing “Cannot start ploop container: Failed to mount image: e2fsck failed” in Virtuozzo/OpenVZ
Overview
While starting a Virtuozzo/OpenVZ container, administrators may encounter an error indicating filesystem corruption within the ploop disk image. The container fails to start because the filesystem check (e2fsck) detects inconsistencies that require manual intervention.
Error Message
When attempting to start the container:
vzctl start 38cf8886-ef92-40ad-882b-24319d5d3b
The following error is displayed:
Starting Container ...
Mount image: /vz/private/38cf8886-ef92-40ad-882b-24319d5d3b/root.hdd
/dev/ploop27421p1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
Failed to mount image /vz/private/38cf8886-ef92-40ad-882b-24319d5d3b/root.hdd:
Error in e2fsck (fsutils.c:451): e2fsck failed (exit code 4)
[41]
Cause
This issue occurs when the filesystem inside the container’s ploop disk image becomes inconsistent or corrupted. Virtuozzo attempts to perform an automatic filesystem check during startup, but the detected errors require a manual repair.
Common causes include:
- Unexpected host shutdowns
- Storage interruptions
- Host crashes or kernel panics
- Forced container termination
- Underlying disk I/O issues
Resolution
Step 1: Force a Ploop Consistency Check
Run a ploop check against the container’s disk image:
ploop check -F /vz/private/139/root.hdd/root.hds
Step 2: Mount the Ploop Image Manually
ploop mount /vz/private/139/root.hdd/DiskDescriptor.xml
The command will return a device name similar to:
/dev/ploop56824
Step 3: Identify the Partition
Check the partition layout:
fdisk -l /dev/ploop56824
Typically, the filesystem will reside on:
/dev/ploop56824p1
Step 4: Repair the Filesystem
Run a manual filesystem check and repair:
e2fsck /dev/ploop56824p1
Answer Y to any prompts requesting permission to fix detected errors.
For fully automated repair, you may also use:
e2fsck -y /dev/ploop56824p1
Step 5: Start the Container
Once the filesystem repair completes successfully:
vzctl start 139
The container should now start normally.
Verification
Confirm that the container is running:
vzlist -a
Or:
vzctl status 139
Conclusion
The “e2fsck failed” error is usually caused by filesystem inconsistencies within a ploop image. Performing a manual filesystem check and repair using e2fsck resolves the issue in most cases. If filesystem corruption reoccurs frequently, administrators should investigate the host’s storage subsystem, RAID health, and system logs for underlying hardware or I/O problems.
Commands Summary
ploop check -F /vz/private/139/root.hdd/root.hds
ploop mount /vz/private/139/root.hdd/DiskDescriptor.xml
fdisk -l /dev/ploop56824
e2fsck /dev/ploop56824p1
vzctl start 139


