Recovering disk space at 10.2

Prepared by Peggy Bruehl
Q. After upgrading to HP-UX 10.20 we find ourselves very short on space on the internal (root) HD. I have gone through it and deleted all of the old .Z files, source code that was lying around unused, and old image files, but I am still a little short and am not sure that I'll be able to apply any future patches. Do you know of anything I can get rid of to buy us a little more space?

A. If you need to install patches or software, the swinstall program will tell you exactly how much space you'll need. If you pass it's disk space test, then you can safely install the patches or software.

However installing patches and software, combined with the natural growth of log files and the /tmp and /usr/tmp directories will likely put you near 100%. I recommend looking for some more free space.

There are a number of things you can do. Here are some suggestions:

  1. Use du to look through all the directories on your root file system for directories starting with the symbol #. For example #system. These are old 9.X directories that were moved out of the way during the upgrade process but never deleted. You can delete the contents of all of these directories.

    However, you must be very careful when you cd to these directories. If you type cd /#system you will end up in the / directory. If you cd to any directory that is preceded by the # symbol, you'll end up in the / directory. If you then type rm -rf *, you'll be in very big trouble because you will have deleted your entire root file system including the kernel. So, instead, use double quotes to cd into any directory preceded by #. For example cd "/#system". Then, always check to be sure that you are in the directory you think you are by running the pwd command.

  2. Use /usr/sbin/swremove to look for file sets to remove. Change the software view so that you see each bundle. Then go hunting for foreign language man pages, or old VUE software, or the MS-DOS utilities, or the auditing software, or the disk quota software, etc. Anything you don't use doesn't have to be on your system.

  3. Use SAM->Routine Tasks to trim out log files, search for big files, search for core files, etc. There is also a special function in SAM for checking your system for software that is installed but never used. This is only useful if you've been running 10.2 for a while. For example, after running 10.20 for a few months, I ran the Find and remove unused filesets program from SAM and it found lots of software that I never used. I carefully went through the things marked for removal and added back a lot of man pages and other software I knew I wanted. But the rest (including some very deeply hidden Japanese documentation) I removed. I got back about 100MB!

  4. Consider moving /users (or /home) to an external disk and then linking back to your internal disk. This will free up all the space used by your users. Tar up everything under /users/ and untar it on one of your external drives. Then (when you're sure everything untarred properly) remove everything under /users and make a link to the external disk. For example, if you put the users tar file on /usr1/users:
    
      % ln /usr1/users /users
    
    
  5. HP-UX 10.2 has a utility called cleanup. This is the HP-PATCH disk space recovery tool. It will automatically recover disk space that is being used for the backup of original files that have been patched. You can choose to remove the backups for all or some of the patches that you've applied to your system. If you remove these backup files, you will not be able to back out of (un-install) any patches. Normally, the only reason you would want to back out of a patch is because it breaks more things on your system than it fixes. If you are concerned about this, you can make a tape backup of your root filesystem.

    To run cleanup and remove the backups for all patches installed on your system, as root run the following command:

    
         # /usr/sbin/cleanup -F
    
    
    
  6. Check the document Help my filesystem is full (10.X version) on the Transition to 10.X home page. There are additional ideas and suggestions in there.