By W. Curtis Preston
Book Price: $49.99 USD
£35.50 GBP
PDF Price: $39.99
Cover | Table of Contents | Colophon
newfs your database’s raw device or delete a user’s document folder? These restores need to go really fast, because they’re your fault. As far as protecting yourself from this type of error, the same is true here as for user errors: either typical nightly backups or snapshots can protect you from this . dump gives a whole bunch of messages that I couldn’t care less about, Pass
I, Pass
II, %
done, and so on. When I’m monitoring the dump backups of hundreds of drives or filesystems, most of that is so much noise. What I really want to see is what got dumped, where it went, when it went, what level it was, and the ever-popular DUMP
IS
DONE message. To get a summary of just these lines, the first thing I do is use grep
-v to exclude the phrases I don’t want, leaving only a few lines. This is much easier to review. This technique can also be applied to other Unix, Linux, and Mac OS backup commands.grep for those. Another way is to use grep
-v to remove all lines you’re expecting and see what’s left. If there’s nothing, great! If there are lines left over, they are probably errors. You may see lines such as I/O
error, Write
error, or something else you don’t like to see in your backups.grep and other shell commands on a Windows system.http://www.backupcentral.com. tar). None of these tools have any built-in scheduling abilities, nor can they make a catalog to keep track of the backups that you make with them. If you want to perform these tasks, you’ll need some type of wrapper and scheduling application. This could be a simple batch script and a scheduled task on a Windows system, a shell script and cron entry on a Unix or Mac OS system, or one of the sophisticated open-source utilities covered later in this book.
dump, cpio, tar, and dd for Unix systems, ntbackup and System Restore for Windows systems, ditto for Mac OS systems, and the GNU versions of tar, cpio, and rsync that are available for all these platforms. Whether you’re just starting out in the backup world or you’re an experienced systems administrator, you need to be familiar with these utilities.ntbackup is the only native choice for a traditional backup application, although you should also be familiar with System Restore. Mac OS X users running a version greater than 10.4 have a number of Unix-based backup tools available to them, including cpio, tar, rsync, and ditto. For commercial Unix systems, dump and restore are quite popular, but they’re not considered a viable option on Linux. dump is available on Mac OS, but it doesn’t support HFS+. After dump and restore, the native backup utility with the most features is cpio, but it is less user friendly than its cousin tar. tar is incredibly easy to use and is more portable than either dump or cpio. The GNU versions of tar and cpio have much more functionality than either of the native versions. If you have to back up raw devices or perform remote backups with tar or cpio, dd will be your new best friend. Finally, ntbackup is the only native choice for a traditional backup application, although you should also be familiar with System Restore. Mac OS X users running a version greater than 10.4 have a number of Unix-based backup tools available to them, including cpio, tar, rsync, and ditto. For commercial Unix systems, dump and restore are quite popular, but they’re not considered a viable option on Linux. dump is available on Mac OS, but it doesn’t support HFS+. After dump and restore, the native backup utility with the most features is cpio, but it is less user friendly than its cousin tar. tar is incredibly easy to use and is more portable than either dump or cpio. The GNU versions of tar and cpio have much more functionality than either of the native versions. If you have to back up raw devices or perform remote backups with tar or cpio, dd will be your new best friend. Finally, rsync can be used to copy data between filesystems on Windows, Mac OS, Linux, and Unix.tar, cpio, and dump.ntbackup command
activates the ntbackup GUI and, unlike with all other commands covered in this chapter, you cannot select what to back up with the ntbackup command itself. You have to select that from the GUI; however, you can run the GUI once, select what files to back up, and save that to a .bks file you specify on the command line later.ntbackup. It has many other options not covered here.ntbackup GUI and saved as part of a .bks file. However, since you have to run the ntbackup GUI to create an ntbackup setup, we won’t cover the command-line switches in detail. Instead, we’ll show you how to get Windows to automatically create the command you need to run.ntbackup, you need to create a backup options file using the ntbackup GUI, save it, then specify that options file when performing an ntbackup backup. Start the ntbackup GUI by typing ntbackup at the command prompt or by selecting Start→All Programs→Accessories→System Tools→Backup. From the Backup tab, select drives or directories to back up. Please note that you can back up the System
State as well.
dump may be all you need
to ensure good-quality backups. There’s a lot of controversy surrounding dump, though, stemming from the fact that it doesn’t access the data through the filesystem the way most other backup utilities do. dump accesses the filesystem device directly. This is why it can back up files without changing their access times. However, it’s also why the manpages for dump have always said to unmount filesystems prior to backing them up. Of course, no one ever does that, hence the controversy.dump and restore for regular system backups, you need to understand the following:dump to back up a filesystem (with the appropriate options)restore utility. You need to become very familiar with the various ways in which you can use restore to retrieve data from a backup created with dump. If you are in the midst of a critical restore as you read this, don’t worry: this section is organized with that scenario in mind and includes every trick available in restore.dump and that you know its block size. If you do not have this information, see the section “How Do I Read This Volume?” in Chapter 23.dump:$ restore tbfy block_size device-name
dump tape (made with a blocking factor of 32) on /dev/rmt/0cbn, issue the following command:$ restore tbfy 32 /dev/rmt/0cbndump can write in a blocking factor that restore cannot read. This problem is usually very simple to get around. Once again, you need the block size in which the volume was written. Determine the volume’s block size as discussed in Chapter 23. Let’s assume that the block size of the volume is 65536. Use dd to read the volume, and pipe the output of dd to dump, giving “-” as the file argument. This tells restore to read its data from standard input.# dd if=device-name bs=64k|restore tfy -restore command needs to understand the blocking format to be able to read the volume. However, if you use dd to read the data from the volume, the data is put into a pipe. The dump and restore have many capabilities. A good shell script can automate their use and can provide a very good safety net for that time when your disk goes south. However, these utilities do have their limitations:
dump to get a consistent picture of an entire filesystem at any given moment in time.dump command is sometimes silent about open files and other problems, although it complains with a “bread error” if things get really confused.restore can actually make you think they are on the volume.dump, and scripts can have errors.dump, not all of which play well with one another.dump and tar lack online indexes like those available with commercial utilities. (Solaris’s version of dump does have an a option that performs some level of indexing, but it definitely isn’t the same as what you’d get with a commercial product.)dump and restore and avoid spending anything extra for commercial software. Have fun!