Knowledgebase

How do I move /usr/share/cagefs-skeleton to other place because of low disk space

Moving the /usr/share/cagefs-skeleton directory requires careful handling, as it's an integral part of CageFS. If you're experiencing low disk space issues, consider these steps:

  1. Backup the CageFS Skeleton:

    Before making any changes, it's crucial to create a backup of the /usr/share/cagefs-skeleton directory. This ensures that you have a copy in case anything goes wrong.

    bash

 

  • sudo cp -r /usr/share/cagefs-skeleton /path/to/backup/location

    Replace /path/to/backup/location with the actual path where you want to store the backup.

  • Unmount CageFS (Optional):

    If CageFS is currently mounted, you may need to unmount it before making changes. Use the following command:

    bash
  • cagefsctl --unmount-all
  • Move the CageFS Skeleton:

    Use the mv command to move the CageFS skeleton to the new location:

    bash
  • sudo mv /usr/share/cagefs-skeleton /new/path/

    Replace /new/path/ with the desired location where you want to move the directory.

  • Update CageFS Configuration:

    Next, you'll need to inform CageFS of the new location. Open the CageFS configuration file for editing:

    bash
  • sudo nano /etc/cagefs/cagefs.mp

    Find the line that refers to /usr/share/cagefs-skeleton and update it to the new path.

  • Rebuild CageFS:

    After making changes to the CageFS configuration, you need to rebuild CageFS for the changes to take effect:

    bash

 

  1. cagefsctl --remount-all
  2. Verify CageFS Functionality:

    Ensure that CageFS is still working as expected. Test it by creating a new user and confirming that they are properly isolated within their CageFS environment.

  3. Check for Disk Space Usage:

    Verify that moving the /usr/share/cagefs-skeleton directory has successfully freed up the desired amount of disk space.

  4. Monitor System Performance:

    Keep an eye on the system's performance to ensure that the move doesn't adversely affect any services or applications.

Please be cautious when moving system directories, especially ones as critical as CageFS. If in doubt, consider seeking advice from your hosting provider or system administrator. Additionally, always have backups available before making significant modifications to your server configuration.

 
 
 
  • 0 Users Found This Useful
Was this answer helpful?