OVZ: container "disappeared" fix

From vpsget wiki
Jump to: navigation, search

This issue could be detected in some cases after OS reinstall on VPS. Anyway this way show how to try to restore container in case of it's folder appears with .tmp

vzlist -a | grep <CID> #or by name anyway you can't find it

#ll /vz/private/ | grep <CID>
 drwx------  3 root solusvm  4096 Jun  7 19:25 <CID>.tmp

Take a look who use it and kill:

#lsof /vz/private/<CID>.tmp/
 COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
 tar     850690 root  cwd    DIR    8,3     4096 57544151 /vz/private/33224.tmp
#kill  850690


Make a backup somewhere first :

#cp -avr /vz/private/33224.tmp/  /tmp/CID_BCP/

And copy to the correct place:

#cp -avr /vz/private/33224.tmp/ /vz/private/33224/

After that start container

#vzctl start


""