How to remove VirtFS like a boss

Like a bossRecently I was unfortunate to witness huge filesystem loop on a cPanel server that was caused by combination of VirtFS and Idera's Server Backup software (previously known as R1soft CDP backup). To cut the chase, I had to disable and remove VirtFS for all users on the server. cPanel has documented how to do this on their wiki, but they failed to mention couple of very important things that will help you not to destroy your server.

So, cPanel provided us with nice little script that can unmount orphaned VirtFS mounts. The script is located at /scripts/clear_orphaned_virtfs_mounts and you can get to know it better if you run it with --help switch. Running the script with no arguments will simply unmount obsolete VirtFS mounts (e.g. for terminated account), but if you have to remove VirtFS for an account that is still active, you will have to take a different approach.