Jailshell virtfs

NEVER DELETE ANY FILES FROM /home/virtfs/

/home/virtfs is used to chroot the user into jailed shell. Cpanel will hard link files into this directory so deleting files in /home/virtfs will also delete the files on the server in the actual location. (example: rm /home/virtfs/user/etc/exim.pl will delete /etc/exim.pl)

If a user is reporting double the quota and it is from /home/virtfs then we need to umount or kill and hanging jailshell process. To do this run

ps aufx |grep user |grep jailshell

If there are no jailshell processes then run

cat /proc/mounts

It will show,
/dev/root /home/virtfs/user/lib ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/lib ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/sbin ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/share ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/bin ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/man ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/X11R6 ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/kerberos ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/libexec ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/bin ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/share ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/Zend ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/include ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/lib ext3 rw,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/spool ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/lib ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/run ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/log ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda6 /home/virtfs/user/tmp ext3 rw,nosuid,nodev,noexec,data=ordered 0 0
/dev/root /home/virtfs/userbin ext3 rw,data=ordered,usrquota 0 0

You will need to unmount each of these by running
umount /home/virtfs/user/tmp and so on

You can also run

for i in `cat /proc/mounts |grep virtfs |grep user |awk ‘{print$2}’`; do umount $i; done

Make sure to replace user with the cpanel username in the above command. This will then clear up the files in /home/virtfs and the quota should return to normal.

2 Responses to “Jailshell virtfs”
Peter Posted on May 4, 2010 at 7:54 pm

On “If there are no jailshell processes then run
cat /proc/mount” I think you mean /proc/mounts correct?

Jacob Posted on May 4, 2010 at 8:04 pm

Thanks, I fixed that

Post a Comment