Move cagefs-skeleton directory from /usr/share to another partition

CageFS is a virtualized data file program and a tool to lock each program client in its own ‘cage’. Each client will have its own completely efficient CageFS, with all the system files, resources, etc. For a cageFS allowed client only safe binaries are available, client will not see any other customers etc are the main benefits of CageFS.

CageFS creates personal namespace for each customer, making it difficult for customers to see each other’s information. These secure information for each customers are created automatically on a folder located at /usr/share/cagefs-skeleton.

Sometimes you need to move this cagefs-skeleton directory from /usr/share to another partition like /home due to low free disk space available in the /usr partition. Following are the steps to do this.

# cagefsctl --disable-cagefs

This command will disable cagefs in the server.

cagefsctl --unmount-all

This command will unmount all mount points created by cagefs.

To make sure all mount points created by cagefs are unmounted successfully use below command.

# cat /proc/mounts | grep cagefs

If you see any cagefs entries, execute “cagefsctl –unmount-all” again and cagefs still exists please issue below command.

# /usr/share/cagefs-plugins/hooks/

This command will move the folder from /usr to /home

# mv /usr/share/cagefs-skeleton /home/cagefs-skeleton

To create a softlink from /usr/share/cagefs-skeleton to /home/cagefs-skeleton where the actual files exits.

# ln -s /home/cagefs-skeleton /usr/share/cagefs-skeleton

This command will enable cagefs in the server.

#cagefsctl --enable-cagefs

If you are doing this in cPanel servers, then in cPanel WHM choose “Server Configuration” and go to “Basic cPanel/WHM Setup”, and change Additional home directories default value to blank not “home”. If you haven’t set this option, then cPanel will create new accounts in incorrect places.

That’s all to do . You also like to know How To Speed Up CPanel To CPanel Migration . Please check my previous article on this and also give your opinion below if you experience any issues or to discuss your ideas and experiences.