Home » Virtualization » 3 November 2019 » 137 supporters » No Comment »

Howto repair corrupted Virtuozzo container

3 November 2019 137 supporters No Comment

Sometimes some broken Virtuozzo container cannot start due to container corruption like example below;

root@pcs4 [~]# vzctl start 9068405
Mount image: /vz/private/9068405/root.hdd

(i.e., without -a or -p options)
Failed to mount image /vz/private/9068405/root.hdd: Error in e2fsck (fsutils.c:282): e2fsck failed (exit code 4)

Failed to mount image: Error in e2fsck (fsutils.c:282): e2fsck failed (exit code 4)
Unmount image: /vz/private/9068405/root.hdd

Data corruption can occur from a variety of reasons. Usually this can be fixed by doing file system check to the disk image.

First we need to know the ploop ID. This can be done by mounting the ploop image.

root@pcs4 [~]# ploop mount /vz/private/9068405/root.hdd/DiskDescriptor.xml
Opening delta /pstorage/pcs1-cluster/private/9068405/root.hdd/root.hds
Opening delta /pstorage/pcs1-cluster/private/9068405/root.hdd/root.hds
Adding delta dev=/dev/ploop16823 img=/pstorage/pcs1-cluster/private/9068405/root.hdd/root.hds (rw)

Once we know the ploop ID, we need to know ploop partition device.

root@pcs4 [~]# fdisk -l /dev/ploop16823

WARNING: GPT (GUID Partition Table) detected on '/dev/ploop16823'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/ploop16823: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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/ploop16823p1 1 13055 104857599+ ee GPT

Doing file system check to the partition.

root@pcs4 [~]# fsck /dev/ploop16823p1 -Cy
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
/dev/ploop16823p1: clean, 807261/6553600 files, 16353823/26213888 blocks

Umount back the ploop.

root@pcs4 [~]# ploop umount -d /dev/ploop16823p1
Unmounting device /dev/ploop16823
Opening delta /pstorage/pcs1-cluster/private/9068405/root.hdd/root.hds

Start back the container.

root@pcs4 [~]# vzctl --verbose start 9068405
Mount image: /vz/private/9068405/root.hdd
Container is mounted
Starting the Container ...
running: /usr/sbin/cpufeatures --quiet sync
running: /usr/sbin/vzpkg info -q centos-6-x86_64 osrelease
Warning: VSwap_slm compatiblity mode all
RAM: 2097152 Swap: 0 ovr: 1.00
UB_LOCKEDPAGES, {2097152, 2097152}
UB_PRIVVMPAGES, {9223372036854775807, 9223372036854775807}
UB_NUMPROC, {500, 500}
UB_PHYSPAGES, {2097152, 2097152}
UB_VMGUARPAGES, {2097152, 2097152}
UB_OOMGUARPAGES, {2097152, 2097152}
CPU limit: 100%
Running the command: /etc/sysconfig/vz-scripts/vz-start
Setting permissions 20002 dev 0x7d00
Adding offline management to Container(1): 4643
Adding IP addresses:
Running the command: /etc/sysconfig/vz-scripts/vz-net_add
Run the script /etc/sysconfig/vz-scripts/dists/scripts//redhat-add_ip.sh
Hostname of the Container set: main.test.com.my
Run the script /etc/sysconfig/vz-scripts/dists/scripts//redhat-set_hostname.sh
Run the script /etc/sysconfig/vz-scripts/dists/scripts//set_dns.sh
File resolv.conf was modified
Run the script /etc/sysconfig/vz-scripts/dists/scripts//set_console.sh
Starting the Container ...

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.