New

Clearing up files for space reclamation in the /home directory

  • 28 July 2020
  • 0 replies
  • 246 views

Nutanix infrastructure users and customers often encounter an issue with the space usage on one or more CVMs in the /home directory.  The /home directory tends to get filled up with files and before one realises it the /home directory would have crossed the threshold of 75%.  It can be annoying to come upon this issue when you are in the midst of running some applications.

Clearing up space in the /home directory needs to be done meticulously, especially since we have all the Stargate/Disk mounts in the /home directory paths, like:

/dev/sdf1      1075537748 15066144 1049517736   2% /home/nutanix/data/stargate-storage/disks/BTHC712602FJ1P2OGN
/dev/sdd1 1075537748 15112900 1049470980 2% /home/nutanix/data/stargate-storage/disks/BTHC712601QK1P2OGN
/dev/sdb4 1013610372 35333576 967952072 4% /home/nutanix/data/stargate-storage/disks/BTHC709102TH1P2OGN
/dev/sde1 1075537748 15079724 1049504156 2% /home/nutanix/data/stargate-storage/disks/BTHC639207851P2OGN
/dev/sda4 1013610372 14552684 988732964 2% /home/nutanix/data/stargate-storage/disks/BTHC639208FL1P2OGN

The ideal method for checking files in the /home directory is to primarily eliminate doing any search whatsoever in any of the Stargate directories beneath the /home.  Take advantage of the grep command to accomplish this:

find /home -xdev -size +1073741824c 2>&1 | grep -v "Permission denied" | xargs ls -altr | grep -v "/home/nutanix/stargate" | awk '{print  $5" Bytes   " $9}'

Let us decipher the above command:

  1.  Our search is restricted to the /home directory

  2. We are looking for files under /home but not transgressing or trespassing into the stargate directories

  3. We are circumventing encountering the dreaded “Permission denied” that you would often see when you are not the superuser on a Linux machine

  4. The files listed will be in reverse chronological order, essentially displaying the latest files at the bottom of the list

  5. The file sizes are also shown so you know which are the low hanging fruits to get rid of

Use discretion before you delete any of these files.

 

 

You can refer to KB 1540 for guidelines:

https://portal.nutanix.com/page/documents/kbs/details?targetId=kA0600000008dpDCAQ


0 replies

Be the first to reply!

Reply