• Aucun résultat trouvé

Resolving disk space problems

Dans le document Solving HP-UX Problems (Page 133-136)

There are a number of methods available for handling shortages of disk space.

Which methode s) you choose depends on your particular situation.

7 Removing files

Often, when file systems fill up, there are a number of files that are no longer needed. They might include old "test" programs, old data files, backup copies of files made "just in case a change to the real one goofs up something", etc.

Locate and remove these files (using the rm command) if you are sure that they are no longer needed. All users of that file system should do the same.

When programs fail, they sometimes "core dump." As the name implies, a file named core is dumped onto the disk (usually in the working directory of the user executing the program). Files named core are therefore candidates for removal. Just be sure they don't contain important data and that someone isn't planning to use them for debugging with the cdb and adb debuggers.

7 -6 Disk Space Problems

Moving files

If you have file systems that are at or near capacity and others with plenty of space available, you might be able to move files or directories out of the full file system into the lesser used file system. This will even out your disk usage and in some cases might even improve system throughput.

Be careful when moving files to new locations. There are certain files that must reside in a particular place because HP -UX or other software expects them to be there. Most of those files that HP- UX is looking for will reside in one of the directories on the root file system. Your applications might not have requirements for the location of certain files. You should check the documentation for those products for more detail before moving files they may use.

There is a way to physically move a file without logically moving it. See the section later in this chapter on creating symbolic links.

Archiving files

A combination of the above two methods is to archive files to external media (such as tape or disk pack) that you would like to keep around but will not need to access immediately. This will free up space on your disk for your more immediate needs.

There are several utilities for archiving files to tape and, of course, retrieving

them from tape. Among them are fbackup/frecover, epio and tcio, 7 dump/restore, dd, and tar. Several of these can also be used for moving

files/ data between disk drives. For information on how to archive files, see the chapter called "Backing Up and Restoring Your Data" in the System Administration Tasks manual.

Creating symbolic links

As mentioned above, it is possible to physically move a file without logically moving it. This is done through a process called "linking." Links are essentially pointers from the place where the file's name resides to the place where its data resides (under a different name). There are several types of links, but the type we're interested in using here is the symbolic link. This

Disk Space Problems 7-7

7

is because symbolic links are the only type that can reference data across file system boundaries.

The file's data can be physically moved to another disk or file system while its name remains where it used to be. The file can then he referenced using the original name by creating a symbolic link to the new location of the data.

There are drawbacks to using symbolic links that you should know about.

By creating the link, you are creating a dependency that the file system and file that the link is pointing to will be mounted and available when you need to access the file. Someone might remove, move, or alter the file containing the data without realizing that the link exists. You might end up with a link pointing to nowhere. When using symbolic links, remember that you've created the links and protect the file containing the data accordingly.

For more information on creating symbolic links, consult the manual reference page cp(1) (see the -s option on the In command).

Shortening files that grow without bound

There are several files on the system that grow without bound. It is necessary to keep an eye on these and regularly clean them up to prevent them from consuming valuable disk space. The following files are of this type:

• /etc/wtmp

• /etc/btmp

• /etc/utmp

• Some processes use log files to record their activities. Many of the files in the directory /usr / adm are log files and these can potentially grow very large.

Other processes can use the directory /tmp for this purpose.

Note If your computer is part of an HP-UX cluster, the files wtmp, btmp and utmp (listed above) are context-dependent files

(CDFs). Each cnode in the cluster has its own copies of these files.

7 -8 Disk Space Problems

Using Logical Volumes

If you are using a Series 800 computer, you have a new way to handle disk space problems, the "Logical Volume Manager (LVM)." The Logical Volume Manager allows you a lot of flexibility in how you divide up you disk space. For complete information about the Logical Volume Manager, see the references listed at the end of this chapter, in the section called "Where to go for more information" .

Adding new disks

It might turn out that your needs for immediate access to online information require you to add additional disk drives to your system (or upgrade to larger capacity drives). Of course you can select this option, but you should try the other things mentioned in this section first.

Dans le document Solving HP-UX Problems (Page 133-136)