FSCK is the Linux utility to check a disk for errors. It’s like the counterpart to the Windows disk defrag utility. When using Virtuozzo 7 with SolusVM you can FSCK a Virtuozzo 7 Ploop container. This will usually resolve any disk errors that might stop the container from being mounted.
Fix Ploop Disk Errors
If a ploop container has a disk error when the container is rebooted. It likely won’t boot again, an error in the console will be displayed;
Starting Container ... Mount image: /vz/private/e9b38c85-f5c4-400a-b065-7b69580f2c12/root.hdd /dev/ploop41483p1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.<br>(i.e., without -a or -p options)<br>Failed to mount image /vz/private/e9b38c85-f5c4-400a-b065-7b69580f2c12/root.hdd: Error in e2fsck (fsutils.c:473): e2fsck failed (exit code 4)<br><br>Unlock fd=5
FSCK Ploop Container SolusVM
To resolve the disk errors and to boot the server again we need to run an FSCK check manually. This involves mounting the disk to the host so we can run the disk check utility and fix the errors.
First get the CTID of the container that won’t boot. You can use the vzlist -a command to get this information.(Useful VZCTL Commands) Next, we need to mount the disk image to the host.
Mount Ploop Disk
Mount the disk to the host using the command below so we can inspect the drive and run the FSCK check. Ensure you use the correct CTID. We are using CTID 4452.
ploop mount /vz/private/4452/root.hdd/DiskDescriptor.xml
Looking at the console, you will now see the disk is mounted;
ploop mount /vz/private/4452/root.hdd/DiskDescriptor.xml Opening delta /vz/private/4452/root.hdd/root.hds Opening delta /vz/private/4452/root.hdd/root.hds Opening delta /vz/private/4452/root.hdd/root.hds Adding delta dev=/dev/ploop20460 img=/vz/private/4452/root.hdd/root.hds (rw)
The output above shows that the Ploop device is /dev/ploop20460. So we could use this information to inspect the drive using disk if we wanted. To inspect the drive, issue the fdisk -l command but this is not needed to run an FSCK check.
fdisk -l /dev/ploop20460
Run FSCK Check On Ploop Container
Using the above drive information (/dev/ploop20460) we can now run the FSCK check on the container. But for this to work we need to modify the name of the device. Just add a p1 to the end. So, our drive information would become /dev/ploop20460p1
e2fsck -f -y /dev/ploop20460p1
The output of the FSCK check will be displayed in the console;
e2fsck 1.42.9 (28-Dec-2013) 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 /dev/ploop20460p1: 26229/655360 files (0.1% non-contiguous), 500427/2620928 blocks
Unmount & Boot Container
Now the FSCK is complete all that is required is to unmount the drive from the host and boot the container. To do this use the device name;
ploop umount -d /dev/ploop20460
Finally use VZCTL to start the container
vzvtl start 4452
How was this article? FSCK Virtuozzo 7 Ploop Container – SolusVM
You might also like
More from SolusVM
Free Up Space VirtuozzoWhen using Virtuozzo and Ploop containers sometimes there can be issues with space management. It's possible that …