Quantcast
Channel: VMware ESXi – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 250

Keeping your root visorfs clean: point the path to your own binaries stored on a vmfs volume

$
0
0

Some interesting commands derived from [WayBackESXi/ESX error: No free space left on device (1007638) | VMware KB:

  • finding large files:
    find / -path "/vmfs" -prune -o -type f -size +50000k -exec ls -lh '{}' \;
  • finding space on the root file system (which is not listed in df -h):
    stat -f /

This was in the process of trying to keep my local binaries out of [WayBackVisorFS: A Special-purpose File System for Efficient Handling of System Images – VMware Labs as it is inherently small in size (both total size and number of inodes) as it is a RAM disk based file system.

Based on that, at [WayBackTrouble shooting – esx.problem.visorfs.ramdisk.full – DefinIT I found this even more useful statement vdf -h | grep "%\|Ramdisk" which shows the exact usage of what’s in this filesystem. Example output on one of my systems:

# vdf -h | grep "%\|Ramdisk"
Ramdisk                   Size      Used Available Use% Mounted on
root                       32M        1M       30M   6% --
etc                        28M      184K       27M   0% --
opt                        32M        0B       32M   0% --
var                        48M      352K       47M   0% --
tmp                       256M        4K      255M   0% --
iofilters                  32M        0B       32M   0% --
hostdstats                678M        4M      673M   0% --

The easiest is not to store them in the root file system at all, but then you need to alter the default path:

# echo $PATH
/bin:/sbin

Since my local binaries are at /vmfs/volumes/Samsung512NVME/local-bin/, I wanted to persist this path change:

export PATH=$PATH:/vmfs/volumes/Samsung512NVME/local-bin/

Basically you can do this with any current directory on your system: export PATH=$PATH:`pwd`

The easiest way to persist that path is to ensure you can shoehorn the effect in a file that gets started during bootup.

The standard – but unsupported – way to do that is shown for instance by:

So, edit vi /etc/rc.local.d/local.sh, then shutdown all your VMs and reboot the system to verify the effects. However inserting that export isn’t enough. This is the line you need to add before the exit 0:

sed -i -e 's!PATH=/bin:/sbin!PATH=/bin:/sbin:/vmfs/volumes/Samsung512NVME/local-bin/!' /etc/profile

–jeroen


Viewing all articles
Browse latest Browse all 250

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>