Wondering how to fix Openvz “Failed to mount image” error? We can help you.
At times while trying to start Container we may end up with a “Failed to mount image” error.
Here at Bobcares, we often handle requests from our customers to fix similar errors as a part of our Server Management Services. Today we will see how our support engineers fix this for our customers.
What causes Openvz “Failed to mount image” error
Before going into the steps for fixing this error we will see what causes this error.
A typical error may look like the one given below:
The container’s mount fails due to file system errors inside the ploop virtual disk.
Steps to fix Openvz “Failed to mount image” error
Firstly, we must run the check disk.
Then to run
fsck, follow the following steps:
1. Ensure that the container is stopped by using the following commands:
~# vzctl stop 101 ~# vzlist 101 CTID NPROC STATUS IP_ADDR HOSTNAME 101 - stopped 10.10.10.11 fsck.test
Note: Do not perform
fsck when the container is running or mounted.
2. Mount the container’s ploop image. This allocates a ploop device on the host:
~# ploop mount /vz/private/101/root.hdd/DiskDescriptor.xml add delta dev=/dev/ploop12345 img=/vz/private/101/root.hdd/root.hds (rw)
fdisk -l for the
/dev/ploopX device reported by the previous command.
We will need to let the system fetch a list of partitions on
~# fdisk -l /dev/ploop12345 WARNING: GPT (GUID Partition Table) detected on '/dev/ploop12345'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/ploop12345: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/ploop12345p1 1 1306 10485759+ ee GPT
4. After that we will perform a file system check for the partition reported in the previous command’s output (note p1 at the end):
~# e2fsck /dev/ploop12345p1 e2fsck 1.41.12 (17-May-2010) /dev/ploop12345p1: clean, 22404/655360 files, 238012/2620923 blocks
Note: We can add more options to
e2fsck, check the manual pages if needed.
5. Now we can unmount the ploop image with the following commands:
~# ploop umount -d /dev/ploop12345 Unmounting device /dev/ploop12345
6. Finally, we can start the container using the following:
~# vzctl start 101
[Need assistance? We can help you]
In short, we saw how our Support Techs fix Openvz “Failed to mount image” error for our customers.