This guide provides detailed steps on moving the CageFS skeleton directory in CloudLinux to free up space on `/usr/share/cagefs-skeleton/` by moving it to another partition (e.g., `/home`). Here’s a simplified and structured approach :
Case 1: If CageFS Skeleton Doesn’t Exist Yet
If /usr/share/cagefs-skeleton is not created yet ( cagefsctl –init wasn’t executed), then execute:
mkdir /home/cagefs-skeleton ln -s /home/cagefs-skeleton /usr/share/cagefs-skeleton cagefsctl --init
Case 2: If CageFS Skeleton Already Exists
The CageFS skeleton can take quite a lot of space; that’s why some users prefer moving it somewhere else. In the following example, we’ll move it to /home/cagefs-skeleton.
Disable CageFS and Unmount Everything
cagefsctl --disable-cagefs cagefsctl --unmount-all
Verify that no mounts remain:
cat /proc/mounts | grep cagefs-skeleton
If this outputs nothing: proceed with Backup and Move the Skeleton
Backup and Move the Skeleton
Check if a backup already exists:
ls -d /usr/share/cagefs-skeleton.bak
If it exists, rename it:
mv /usr/share/cagefs-skeleton.bak /usr/share/cagefs-skeleton.old
Move the skeleton:
mv /usr/share/cagefs-skeleton /usr/share/cagefs-skeleton.bak
Create the New Directory and Link It
mkdir -m 0755 /home/cagefs-skeleton ln -s /home/cagefs-skeleton /usr/share/cagefs-skeleton
Reinitialize and Enable CageFS
cagefsctl --init cagefsctl --enable-cagefs cagefsctl --remount-all
Verify again:
cat /proc/mounts | grep cagefs-skeleton.bak
If nothing appears, it’s safe to remove the backup:
rm -rf /usr/share/cagefs-skeleton.bak
⚠️ A common “Device or resource busy” error
Sometimes after disabling CageFS, some of the mounts may still be mounted. In that case, you’ll see the output similar to the one below:
mv /usr/share/cagefs-skeleton /usr/share/cagefs-skeleton.bak
mv: cannot move ‘/usr/share/cagefs-skeleton’ to ‘/usr/share/cagefs-skeleton.bak’: Device or resource busy
Solution:
Check what’s still mounted:
grep cagefs-skeleton /proc/mounts
And if the output contains some existing mounts like:
/dev/sda2 /home/cagefs-skeleton/opt/cpanel/ea-php72/root/usr/bin ext4 ro,nosuid,relatime,errors=remount-
Unmount any remaining mounts:
umount /home/cagefs-skeleton/opt/cpanel/ea-php72/root/usr/bin
All done! Try moving the skeleton again.
Kill/terminate running processes:
If the issue persists, find processes still using CageFS:
grep -rl cagefs-skeleton /proc/*/mounts | cut -d"/" -f3
Example output:
ps u 8917 9
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 9 0.0 0.0 0 0 ? S Aug08 18:12 [rcu_sched]
root 8917 0.2 0.6 1385176 12252 ? Ssl
Check process details:
ps u 8917
If it’s safe to terminate, kill the process:
kill -9 8917
It may not be safe to kill the processes right away. But if you are sure that it’s nothing important, kill them and try moving the CageFS skeleton again:
📌 Important Notes for cPanel Users
If you move the skeleton to `/home` on a cPanel server, update the WHM settings:
1. Go to: WHM → Server Configuration → Basic cPanel/WHM Setup → Basic Config
2. Find: Additional home directories
3. Set the value to blank (instead of `”Home”`).
4. Save & apply changes.
✅ Summary
– Move CageFS skeleton before `cagefsctl –init` if possible.
– If already created, disable CageFS , move it, and re-enable it.
– Fix “Device busy” errors by unmounting files & killing processes.
– cPanel users must adjust settings to avoid issues with new accounts.