How to perform fsck on a ploop container?

Due to various reasons like system crash, incorrect replication level etc, the file system in a ploop container will get corrupted that can result in data loss. So it is necessary to check the filesystem in a ploop container for consistency to avoid this loss of data.

Error

~# vzctl start 123

Starting container…

Opening delta /vz/private/123/root.hdd/root.hdd

Adding delta dev=/dev/ploopxxxxx img=/vz/private/123/root.hdd/root.hdd (rw)

/dev/ploopxxxxxp1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

(i.e., without -a or -p options)

Error in e2fsck (fsutils.c:315): e2fsck failed (exit code 4)

Failed to mount image: Error in e2fsck (fsutils.c:315): e2fsck failed (exit code 4)

Continue reading…