Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [118]

By Root 3086 0
quite possible for a restore to fail because the filesystem has been filled up with ghost files.10

10.5 DUMPING AND RESTORING FOR UPGRADES


When you perform an OS upgrade, you must back up all filesystems with a level 0 dump and, possibly, restore them. The restore is needed only if the new OS uses a different filesystem format or if you change the partitioning of your disks. However, you must do backups as insurance against any problems that might occur during the upgrade. A complete set of backups also gives you the option of reinstalling the old OS if the new version does not prove satisfactory.

Be sure to back up and restore any system-specific files that are in / or /usr, such as /etc/passwd, /etc/shadow, or /usr/local. UNIX’s brain-dead directory organization mixes local files with vendor-distributed files, making it quite difficult to pick out your local customizations.

You should do a complete set of level 0 dumps immediately after an upgrade, too. Most vendors’ upgrade procedures set the modification dates of system files to the time when they were mastered rather than to the current time. Ergo, incremental dumps made relative to the pre-upgrade level 0 will not be sufficient to restore your system to its post-upgrade state in the event of a crash.

10.6 USING OTHER ARCHIVING PROGRAMS


dump is not the only program you can use to archive files to tapes; however, it is usually the most efficient way to back up an entire system. tar, cpio, and dd can also move files from one medium to another.

tar: package files


tar reads multiple files or directories and packages them into one file, often a tape file. tar is a useful way to back up any files whose near-term recovery you anticipate. For instance, if a user is leaving for six months and the system is short of disk space, you can use tar to put the user’s files on a tape and then remove them from the disk.

tar is also very useful for moving directory trees from place to place, especially if your system’s cp does not support recursive copying or you are copying files as root (tar preserves ownership information). For example, the command

tar cf - fromdir | ( cd todir ; tar xfp - )

creates a copy of the directory tree fromdir in todir. Avoid using “..” in the todir argument, since symbolic links and automounters can make it mean something different from what you expect. We’ve been bitten several times.

Most versions of tar do not follow symbolic links by default, but they can be told to do so. Consult your tar manual for the correct flag; it varies from system to system.

The biggest drawback of tar is that most versions do not allow multiple tape volumes. If the data you want to archive will not fit on one tape, you cannot use tar. If your tar does claim to support multiple volumes, be very skeptical. Most multivolume implementations of tar are broken.

Another problem with many versions of tar is that pathnames are limited to 100 characters. This limitation prevents tar from being used to archive deep hierarchies. If your version of tar supports an option to use longer pathnames (as does GNU’s tar) and you use that option, remember that people with the standard tar may not be able to read the tapes you write.11

tar’s b option lets you specify a “blocking factor” to use when writing a tape. The blocking factor is specified in 512-byte blocks; it determines how much data tar buffers internally before performing a write operation. Some DAT devices do not work correctly unless the blocking factor is set to a special value, but other drives do not require this setting.

On some systems, certain blocking factors may yield better performance than others. The optimal blocking factor varies widely, depending on the computer and tape drive. In many cases, you will not notice any difference in speed. When in doubt, try a blocking factor of 20.

tar expands holes in files and is intolerant of tape errors.12

cpio: SysV-ish archiving


cpio is similar to tar in functionality. It dates from the beginning of time and is rarely used today.

Return Main Page Previous Page Next Page

®Online Book Reader