FreeBSD - メンテナンス・トラブルシュート - システムバックアップ - リストア
- 1. リストア
- 2. 部分的にリストア
1. リストア
あらかじめバックアップ元に
/usr/restore
というディレクトリを作成します。
cd /usr/restore/
mount 192.168.0.y:/usr/backup /mnt/windows ← バックアップ先が他マシンだからですよ
restore -rf /mnt/windows/root.dmp
これで「/usr/restore/」に ファイルが作成されます。
2. 部分的にリストア
前項は、バックアップをまるまる全部、リストアしますが・・・。
そうそう、全部欲しいわけでもないので・・・。
マシン内に「/usr/backup/root.dmp」のまるまる全部のバックアップがあるとして・・・。
特定のディレクトリ配下だけ欲しいとしますわな・・・。
これ実際にやりましたのでね。
1回目は失敗。
$ restore -v -f /usr/backup/root.dmp -x /usr/local/パス
Verify tape and initialize maps
Tape block size is 32
Dump date: Mon Mar 11 18:46:34 2019
Dumped from: the epoch
Level 0 dump of / on ns.sing.ne.jp:/dev/ada0p2
Label: none
Extract directories from tape
Initialize symbol table.
warning: ./usr: File exists
warning: ./usr/local: File exists
warning: ./usr/local/パス: File exists
Make node ./usr/local/パス/08
・・・ 略 ・・・
Make node ./usr/local/パス/08/03/08
Extract requested files
You have not read any tapes yet.
If you are extracting just a few files, start with the last volume
and work towards the first; restore can quickly skip tapes that
have no further files to extract. Otherwise, begin with volume 1.
Specify next volume #: ^Crestore interrupted, continue? [yn] n
これで n しちゃったもんだから止まっちゃいました。
あんど、先にディレクトリがあると上書になるようですんで、ないところで・・・
$ mkdir /tmp/dump02
$ cd /tmp/dump02
$ restore -v -f /usr/backup/root.dmp -x /usr/local/パス/
Verify tape and initialize maps
Tape block size is 32
Dump date: Mon Mar 11 18:46:34 2019
Dumped from: the epoch
Level 0 dump of / on ns.sing.ne.jp:/dev/ada0p2
Label: none
Extract directories from tape
Initialize symbol table.
Make node ./usr
Make node ./usr/local
Make node ./usr/local/パス
Make node ./usr/local/パス/08
・・・ 略 ・・・
Make node ./usr/local/パス/08/03/08
Extract requested files
You have not read any tapes yet.
If you are extracting just a few files, start with the last volume
and work towards the first; restore can quickly skip tapes that
have no further files to extract. Otherwise, begin with volume 1.
Specify next volume #: 1
extract file ./usr/local/パス/08/03/01.png
extract file ./usr/local/パス/08/03/02.png
・・・ 略 ・・・
extract file ./usr/local/パス/08/03/08/01.png
extract file ./usr/local/パス/08/03/08/02.png
extract file ./usr/local/パス/08/03/08/03.png
Add links
Set directory mode, owner, and times.
set owner/mode for '.'? [yn] y
「-v」オプションつけると不安がなくていいですね。
2回、入力が必要なのですが・・・。
実は、よく理解しておりません。
1回目は、ボリュームを指定せぇちゅうことのようで、1 にしなさいというから 1 にしたら、うまくいったようです。
2回目は、「.」に owner/mode を付けますか?ちゅうことかいな?
ようわからんのですが、「y」でなんとか展開されました。
これでカレントディレクトリに「usr/local/パス」以下が、展開されます。
|
|