ps -ef and ps -auxwww

I just wanted to write this quick blog post as a reminder to myself and to possibly help anyone who reads this.

A colleague of mine had a problem recently with a locked file in ESX 3.5 Update 2. Basically one of the datastores which contained a couple of virtual machines (with snapshots) had ran out of disk space.  After freeing some space and deleting some snapshots one of the virtual machines refused to power on and vCenter reported a locked file error. Now  if your from a Unix or Linux background you instantly think of the command ‘ps’ to return running processes, particuarly ‘ps -ef’ to return all processes with full formatting. In this situation this wasn’t particularly helpful, as with ‘ps -ef’ the output does not wrap on screen causing the cmd text for long processes to be missing.

So when looking for all running processes related to virtual machines, one of the following commands should be used:

ps -auxwww

or

ps -ef | fold

Conversely if you know the name of the vmx file for the virtual machine you are interested in, you can combine ‘ps -ef’ or ‘ps -auxwww’ with the ‘grep’ command to return only the lines you require. For example:

ps -ef | grep -i xxx.vmx

Note: when combining ‘ps -ef’ with ‘grep’ you don’t need the ‘fold’ command as the output is automatically wrapped.

Leave a Reply