Search for:

Available article translations:

How to place containers on partition different from /vz

Article ID: 113447, created on Mar 12, 2012, last review on May 8, 2014

  • Operations Automation 5.4
  • Virtuozzo
  • Virtuozzo containers for Linux
  • Virtuozzo hypervisor


This article describes ways to change containers private area location in Parallels Virtuozzo Containers for Linux. It might be needed in various cases:

  1. While deploying PVCfL or PSBM the server has only local middle-capacity HDD and later it needs to host containers and VMs on SAN or external storage
  2. A particular container needs to be placed on a separate HDD
  3. Containers have to be moved to a bigger HDD attached to the server

This article presents two different ways to achieve the goal:

  1. Place several particular containers on a separate partition
  2. Move all containers to the other location

Particular container(s)

To move a particular container to a location, different from /vz follow these steps:

  1. Copy container files to the desired location

    [18:22:06][~]# mkdir /vz2
    [18:22:27][~]# mkdir /vz2/private
    [18:22:40][~]# mkdir /vz2/root
    [18:22:43][~]# rsync -au /vz/private/3147 /vz2/private/
    [18:23:18][~]# ls -la /vz2/private/
    total 12
    drwxr-xr-x 3 root root 4096 Feb  6 18:23 .
    drwxr-xr-x 4 root root 4096 Feb  6 18:22 ..
    drwxr-xr-x 7 root root 4096 Feb  6 17:02 3147
  2. Make sure that ve.conf points to correct private and root area location

    [18:24:19][~]# cd /etc/vz/conf/
    [18:24:21][/etc/vz/conf]# rm 3147.conf
    [18:24:31][/etc/vz/conf]# ln -s /vz2/private/3147/ve.conf 3147.conf
    [18:25:28][/etc/vz/conf]# vim /vz2/private/3147/ve.conf
    [18:27:11][/etc/vz/conf]# grep -E "ROOT|PRIVATE" /vz2/private/3147/ve.conf
  3. Verify the container can be started

    [18:28:02][/etc/vz/conf]# vzctl start 3147
    Starting the Container ...
    Container is unmounted
    Container is mounted
    Setting permissions 20002 dev 0x7d00
    Adding offline management to Container(1): 8443 4643
    Adding IP addresses:
    Starting the Container ...

All containers

To move all containers to a different HDD follow these steps:

  1. Stop service vz to ensure the copied data consistency

    [root@pvclin40 ~]# service vz stop
    Shutting down Container 1
    Turn off offline management for Container 123:             [  OK  ]
    Turn off offline management for Container 123456:          [  OK  ]
    Stopping Virtuozzo:                                        [  OK  ]
    [root@pvclin40 ~]#
  2. Copy all the data from /vz partition to the new storage

    [root@pvclin40 ~]# mkdir /vz2
    [root@pvclin40 ~]# mount /dev/sdb3 /vz2
    [root@pvclin40 ~]# rsync -auv /vz/ /vz2
    building file list ... done
    wrote 3282238799 bytes  read 1596884 bytes  11876440.08 bytes/sec
    total size is 3275211083  speedup is 1.00
  3. Remount the storage as /vz

    [root@pvclin40 ~]# umount /vz
    [root@pvclin40 ~]# umount /vz2
    [root@pvclin40 ~]# mount /dev/sdb3 /vz
  4. Start service vz

    [root@pvclin40 ~]# service vz start
    Starting Virtuozzo:                                        [  OK  ]
    Loading Virtuozzo license:                                 [  OK  ]
    Set vzprivrange:                                           [  OK  ]
    Configuring Virtuozzo accounting:                          [  OK  ]
    Starting Container: 1 123 123456
    Container 1 started:                                       [  OK  ]
    Container 123 started:                                     [  OK  ]
    Container 123456 started:                                  [  OK  ]
    Setup offline management for Container 123:                [  OK  ]
    Setup offline management for Container 123456:             [  OK  ]

Search words:

private area

move vz

move private

move /vz

a26b38f94253cdfbf1028d72cf3a498b d02f9caf3e11b191a38179103495106f 2897d76d56d2010f4e3a28f864d69223 5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e8e50b42231236b82df27684e7ec0beb 0dd5b9380c7d4884d77587f3eb0fa8ef ac82ce33439a9c1feec4ff4f2f638899 2554725ed606193dd9bbce21365bed4e 614fd0b754f34d5efe9627f2057b8642

Was this article helpful?
Tell us how we may improve it.
Yes No
Server Virtualization
- Odin Cloud Server
- Odin Containers for Windows 6.0
- Odin Virtuozzo Containers
- Odin Automation
- Odin Automation for Cloud Infrastructure
- Odin Business Automation Standard
- Odin Virtual Automation
- Odin Plesk Panel Suite
- Web Presence Builder
- Odin Plesk Automation
- Odin Small Business Panel
- Value-added Services for Hosters
- Odin Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification