Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Absolute BSD - The Ultimate Guide To FreeBSD (2002).pdf
Скачиваний:
25
Добавлен:
17.08.2013
Размер:
8.15 Mб
Скачать

restore > ls

 

 

 

 

.:

 

 

 

 

.cshrc

compat@

kernel.GENERIC

modules.good/

sys@

.profile

dev/

kernel.good

modules.old/

tmp@

COPYRIGHT

dist/

kernel.old

proc/

usr/

bin/

etc/

laptop−kernel

root/

var/

boot/

home@

mnt/

sbin/

 

cdrom/

kernel

modules/

stand/

 

restore >

...............................................................................................

Once you've opened the dump file, as shown in the listing, you can maneuver through it using ls(1) to list the contents of a directory, and cd(1) to change directories.

Once you have found the file you want to restore, you need to actually restore it. The interactive version of restore keeps a list of files that need to be extracted from the dump. When using restore, you add each file you want to restore to the list, and then tell restore to pull the files from the dump. You can add a file to this list by entering add and the filename. For example, to restore /etc/master.passwd and /etc/passwd from the interactive dump shown in the earlier example, enter the following commands:

...............................................................................................

restore > cd etc

restore > add master.passwd restore > add passwd restore > extract

You have not read any tapes yet.

Unless you know which volume your file(s) are on you should start with the last volume and work towards the first. Specify next volume #: 1

set owner/mode for '.'? [yn] y restore > quit

...............................................................................................

The "volume #" referred to in the preceding listing is the number of the tape you have placed in the machine. Many dumps require several tapes, and each gets a volume number during the dump. If you're restoring from a file, the volume number is 1. If you were able to fit your entire dump onto a single tape, the volume number is 1 as well.

Note Whenever you perform a full disk restore, run another level 0 dump before another incremental dump. Restore rearranges data on the disk, so further incremental backups won't be useful without a new level 0 backup. And have I mentioned how much easier your life is when you always run full backups?

Recording What Happened

Script(1) is one of those rarely mentioned but quite useful tools every systems administrator should know. It records everything you type, as well as everything that appears on the screen, in a file called typescript. You can then use this type−script file to record errors or long output to be dissected or analyzed later. Script continues recording until you type exit.

60