PDA

View Full Version : OpenVZ error: Can't umount /vz/root/*: Device or resource busy



Fli
09-01-2014, 03:33 PM
When using OpenVZ, from time to time one can see following error when trying to start/restart/stop VPS:


Can't umount /vz/root/*: Device or resource busy

#1

In some cases i found helpfull to list all OpenVZ server processes (command: ps aux) and grep processes contianing VPS container ID..

example VPS contianer id is CTID 1010, so i do:

ps aux | grep 1010

there might be some process that is running and accessing some file on the VM preventing to unmount VM (Can't umount).

so to kill such process, enter its command and kill it, i killed example:

pkill -f "/vz/root/1210/etc/udev/devices"

or maybe safer option:

kill -9 PROCESS_PID_HERE

#2

Several people adviced:

umount -l /var/lib/vz/root/CTID

* CTID is VPS openvz number, example: 1210

#3

Dirty way if nothing helped: Creating new mountpoint (directory) for the VPS, and then changing the VE_ROOT="/var/lib/vz/root/$VEID" path in /etc/vz/conf/CTID_HERE.conf to your newly created directory. Then maybe stopping VM and changing back or deleting (backup first) remaining files in old dir which failed to unmount?