Backup-With-MSDOS mini-HOWTO <author>Christopher Neufeld, <htmlurl url="mailto:neufeld@physics.utoronto.ca" name="neufeld@physics.utoronto.ca"> <date>Aug 5, 1997 <trans>伊佐冶 哲, <htmlurl url="mailto:isaji@mxu.meshnet.or.jp" name="isaji@mxu.meshnet.or.jp"> <tdate>5 Jan 1998 <abstract> <!-- This HOWTO describes how to use a Linux-compatible tape drive installed on an MS-DOS machine to back up the filesystem of a Linux machine. --> このHOWTOはMS-DOSマシンにインストールされたLinux互換のテープドライブ をLinuxのファイルシステムバックアップに利用する方法について解説しています。 </abstract> <!-- Table of contents --> <toc> <!-- Begin the document --> <sect>序文/イントロダクション <!-- Preface/Introduction --> <p> <!-- Earlier I posed the question on the Net, how does one back up a Linux machine to a Colorado Jumbo 250 tape drive on an MS-DOS machine. From the email I received, it seems that this is a frequently pondered problem. Now that I've figured it out, I'm posting the method. --> 以前ネット上に「MS-DOSマシン上の<tt/Colorado Jumbo 250/テープにLinuxを バックアップする方法は?」という質問を投稿しました。メールの返事から、どうも これはよく考えるべき問題(frequently pondered problem)だとわかってきました。 <!-- If anybody wants to massage this into a HOWTO document, let me know. I should thank Jim Nance (<htmlurl url="mailto:jlnance@isscad.com" name="jlnance@isscad.com">) for pointing out that an MS-DOS machine need not always be an MS-DOS machine. This technique should also work for any other tape drive supported by the ftape module, and for SCSI tape drives with suitable obvious changes (i.e. substituting /dev/st0 for /dev/ftape). --> もしHOWTOドキュメントにメッセージを送りたいなら著者まで知らせて下さい。 またJim Nance氏(<htmlurl url="mailto:jlnance@isscad.com" name="jlnance@isscad.com">)には「MS-DOSマシンは常にMS-DOSマシンである必要は ない」ということを指摘していただきました。ここに感謝いたします。この方法は ftapeモジュール(<em/訳注:/「Ftape-HOWTO」を参照)でサポートされているテープ ドライブや適当に変更したSCSIテープドライブ(例えば<tt>/dev/ftape</tt>の代わり に <tt>/dev/st0</tt> )ならどれでも適用できます。 </p> <p> <!-- The criteria I set were that the resulting setup should be as secure as possible and should be fairly simple, and take up little or no space on the MS-DOS machine's hard drive. It should also be capable of recovering from the worst system corruptions, up to and including the theft of the hard disk, requiring a restore to a bare Linux file system. --> 基準として、できるだけ安全かつシンプルでMS-DOSマシンのハードディスク にスペースがないといったことを考慮します。Linuxファイルシステムをリストア しなければいけないような最悪になったシステムを復旧する(さらにハードディスク を喰わない)ことができるものにすべきです。 <!-- The technique described here uses no hard drive space on the MS-DOS machine, though it requires that that machine be assigned an IP#. You will need three formatted, blank 1.44MB diskettes. --> IP#が振り分けられたマシンが必要です。またここで述べる方法ではMS-DOSマシン のハードディスクは使いません。3枚の空のフロッピーディスク(1.44MB)を 用意しておいて下さい。 </p> <sect>テクニック <!-- The technique --> <p> <!-- Throughout this description I will refer to two machines as ``<tt>msdos</tt>'' and ``<tt>linux</tt>''. ``<tt>msdos</tt>'' is the name of the machine which has the tape drive and is usually running MS-DOS. ``<tt>linux</tt>'' is the Linux machine whose disk you are trying to back up or restore to the tape drive. For simplicity I will refer to the first machine as ``<tt>msdos</tt>'' even when it is booted into and running Linux. Further, all path names in this document should be considered to be relative to the Linux machine with the Search-And-Rescue (SAR) disks mounted somewhere on the system. That means that the file <tt>/etc/passwd</tt> is the password file for your Linux machine's hard drive, while, for instance, <tt>/tape144/etc/passwd</tt> is the corresponding file on the floppy disk. --> この文書中で2台のマシンをそれぞれ``<tt>msdos</tt>''、``<tt>linux</tt>''と 呼びます。``<tt>msdos</tt>''はMS-DOSの走っているテープドライブの接続された マシン名で、``<tt>linux</tt>''はテープドライブにバックアップ/リストアを 行いたい方のマシン名です。簡単にするためにLinuxでブート、稼働させるときでも 1台目のマシンを``<tt>msdos</tt>''と呼びます。さらにこのドキュメント中の パス名もシステムのどこかにマウントされたSearch-And-Rescue (SAR)ディスク とLinuxマシンにつながりがあるように書きます。 例えば、これは<tt>/etc/passwd</tt>はLinuxマシンのハードドライブ用のパスワード ファイルであることを意味します。<tt>/tape144/etc/passwd</tt>はフロッピー ディスク上のものに相当するファイルです。 (<em/訳注:/SARディスクツールについて<p> LSM) <verb> Begin3 Title: SAR: a Search And Rescue set (SAR 検索、レスキューセット) Version: 2.21 Entered-date: 01dec94 Description: (SARはSearch And Rescueフロッピーセットを作るためのスクリプト です。ハードディスクが不幸なクラッシュをしたときに使います。 フロッピーはあなた自身でアップデートされたカーネルと ユーティリティセットが使われます。設定ファイルはSARセットの 生成をカスタマイズします。SARは 1枚か2枚のフロッピーレスキューセット "holecp"ユーティリティによってコピーされたファイル Kiss "simple shell" を含んでいます。広範囲にわたるドキュメントとユーティリティ プログラムがついています)。 Keywords: backup rescue SAR search first-aid Author: Karel Kubat (karel@icce.rug.nl) Maintained-by: see Author Primary-site: ftp.icce.rug.nl:/pub/unix/SAR-X.YY.tar.gz (X.YY is version) Alternate-site: sunsite.unc.edu, tsx-11.mit.edu Original-site: -- Platforms: Linux systems Copying-policy: PostcardWare (if you like it, send me a postcard) MegaHard (who wants a Microsoft) but really: GPL, but inform me if you want to make changes End </verb> <!-- I am using Karel Kubat's backup scripts, version 1.03, available at -->著者はKarel Kubat氏のバックアップスクリプトversion 1.03を使っています。 <tscreen> <url url="ftp://sunsite.enc.edu:/pub/Linux/system/Backup/backup-1.03.tar.gz"> </tscreen> から入手できます。 <!-- Throughout this document I will refer to these simply as ``<tt>the backup scripts</tt>''. You do not have to use these scripts for your own backups to tape. I like these scripts as they use afio to form an uncompressed archive of compressed files, rather than a compressed archive of uncompressed files. The former is much safer if there is a media read error during the restore. I understand that Karel is no longer supporting backup, and now has produced 'tob', or tape oriented backup. While I haven't tried the new package myself, it cannot make a significant difference to the procedure outlined here. --> 以下このドキュメントで<tt/backup-1.03.tar.gz/中のスクリプトを単に ``<tt>バックアップスクリプト</tt>''と呼びます。テープへのバックアップ用に これらのスクリプトを使わないで下さい。 圧縮ファイルからファイルを展開するためのafio(<em/訳注:/アーカイブプログラム) としてつかいます。リストア中メディアの読み込みエラーがあった場合そのほうが 安全です。Karel氏はもう<tt/backup/をサポートしておらず、'tob'(tape oriented backup)を製作されています。著者も新しいパッケージを試していないのでここで 述べる手順との重要な違いについてはコメントできません。 </p> <p> <!-- First of all, obtain the ftape module. It is a part of all modern kernels, but if you are using an older kernel you can find the module at: --> まず始めにftapeモジュールを入手します。これは現在のカーネルの一部となっています が、古いカーネルを使っている場合は <tscreen> <url url="ftp://sunsite.unc.edu/pub/Linux/kernel/tapes/ftape-2.05.tar.gz"> </tscreen> から入手しておいて下さい。 <!-- Next, get a Slackware boot disk (I got the net disk, but it doesn't make much difference) and the <tt>tape144</tt> root disk, and put the images onto 3&dquot;1/2 floppies. --> 次にSlackwareブートディスク(著者はnetディスクを使いますがそれほど違いはあり ません)と<tt>tape144</tt>ルートディスク(を3&dquot;1/2フロッピーにイメージ を書き込んだディスク)を用意します。 </p> <p> <!-- The <tt>ftape</tt> module will only work if it is installed in the kernel which was running when you compiled it. I could not get it to work with the <tt>ftape.o</tt> module on the <tt>tape144</tt> root disk, I think because that module has been stripped of symbols and won't install. So, you now have to make a new kernel with network and ftape support, and if you're running an old kernel, a new <tt>ftape.o</tt>. Read the directions which ship with the <tt>ftape</tt> archive for directions at this stage. Remember that the kernel you compile must support the Ethernet cards on both the Linux machine and the MS-DOS machine. --> <tt>ftape</tt>モジュールは、実行しているカーネルに組み込まれている場合のみ 動作します。<tt>tape144</tt>ルートディスク上で<tt>ftape.o</tt>モジュールと 動作させることはできません。モジュールがシンボルの削除(stripped)をしていて 組み込めないからだと思います。 そこでネットワークとftapeをサポートするカーネルを再構築する必要があります( また古いカーネルを使っている場合は新しい<tt>ftape.o</tt>モジュールを サポートするようにします)。ここで<tt>ftape</tt>アーカイブを作るための文書を 読んでおいて下さい。コンパイルするカーネルはLinux、MS-DOSマシン両方でイーサ ネットカードをサポートすることを忘れないで下さい。 </p> <p> <!-- Copy the newly created kernel image over top of the one on the Net boot disk. Use <tt>/bin/cp</tt>, do not create a boot disk with the ``<tt>dd</tt>'' command as you would to create a bootable kernel image. Write protect the boot disk, and label it: SAR#1. --> 新しいカーネルイメージをnetブートディスクにコピーします。<tt>/bin/cp</tt> コマンドを使って下さい。起動可能なカーネルイメージを作るために``<tt>dd</tt>'' コマンドは使いません。ラベルはSAR#1とします。ブートディスクをライトプロ テクトしておくのを忘れないで下さい。 </p> <p> <!-- Now, mount the <tt>tape144</tt> root disk. I'll assume that the mount point is <tt>/tape144</tt>, to avoid confusion in file names. We need to free some space on it, so delete the following files: --> さて次に<tt>tape144</tt>ルートディスクをマウントします。マウントポイントは ファイル名と混同しないように<tt>/tape144</tt>とします。スペースを空ける 必要があるので以下のファイルを削除します。 <tscreen> <verb> /tape144/bin/dialog /tape144/bin/elvis /tape144/bin/vi /tape144/boot/ftape.o </verb> </tscreen> </p> <p> <!-- Now, create a new file: --> つぎに新しいファイルを作ります。 <tscreen> <verb> /tape144/etc/exports </verb> </tscreen> <!-- which contains the following line: --> このファイルは以下の行を含んでいます。 <tscreen> <verb> /mnt msdos(ro) </verb> </tscreen> <!-- Where ``<tt>msdos</tt>'' should be replaced with the name or IP# of the MS-DOS machine which has the tape drive installed. --> ここで``<tt>msdos</tt>''は、テープドライブがインストールされているMS-DOS マシン名かIP#に置き換えて下さい。 </p> <p> <!-- Next, so that you don't have to rely on a name server, add lines to the file <tt>/tape144/etc/hosts</tt> with the names and IP numbers of the Linux and MS-DOS machines. For instance, mine contains the following two lines: --> (マシン名は)ネームサーバに依存しないようにします。Linux と MS-DOSマシンの 名前とIPアドレスを<tt>/tape144/etc/hosts</tt>に以下のように追加します。 <tscreen> <verb> 128.100.75.114 caliban.physics.utoronto.ca caliban caliban.physics 128.100.75.111 ariel.physics.utoronto.ca ariel ariel.physics </verb> </tscreen> </p> <p> <!-- Now, there's some sort of problem with the inetd configuration. We have to put the full path name of the rsh daemon in it. Change line 19 of <tt>/tape144/etc/inetd.conf</tt> to read: --> inetd設定でちょっと問題があります。rshデーモンのフルパス名を書かなくては なりません。<tt>/tape144/etc/inetd.conf</tt>の19行目を変更します。 (<em/訳注:/コメント文を表示させないでcatするには<tt/grep ^[^#] inetd.conf/ などとして下さい)。 <tscreen> <verb> shell stream tcp nowait root /usr/etc/tcpd /usr/etc/in.rshd </verb> </tscreen> </p> <p> <!-- Add local net routing information to <tt>/tape144/etc/rc.d/rc.inet1</tt> to enable the MS-DOS machine to use the network. The format of this depends on your network configuration, you can just copy the appropriate format out of your Linux <tt>/etc/rc.d/rc.inet1</tt>. For my network, the lines that have to be added are: --> MS-DOSマシンがネットワークを使えるように<tt>/tape144/etc/rc.d/rc.inet1</tt> にローカルネットルーチンの情報を追加します。このフォーマットは各自のネット ワーク設定に依るので、Linuxマシンの<tt>/etc/rc.d/rc.inet1</tt>から適当な フォーマットをコピーします。著者のネットワークでは以下のような行を追加しまし た。 <tscreen> <verb> /etc/ifconfig eth0 128.100.75.111 broadcast 128.100.75.0 netmask 255.255.255.0 /etc/route add -net 128.100.75.0 netmask 255.255.255.0 </verb> </tscreen> <!-- The IP# in the ifconfig entry is that of the MS-DOS machine. --> ifconfigエントリーのIP#は MS-DOSマシンのものにして下さい。 </p> <p> <!-- Now, copy this file into <tt>/tape144/etc/rc.d/rc.inet1-l</tt>, and change the IP# in the new file to reflect that of the Linux machine rather than the MS-DOS machine. --> このファイルを<tt>/tape144/etc/rc.d/rc.inet1-l</tt>にコピーします。 MS-DOSマシンよりもLinuxマシンの設定を反映させるために新しいファイルの IP#を変更します。 </p> <p> <!-- Next, clip out lines 3 to 11 of <tt>/tape144/etc/rc.local</tt>. That's an if statement which executes the <tt>rc.inet*</tt> files. We don't want this to happen during the bootup. --> <tt>/tape144/etc/rc.local</tt>ファイルの3〜11行をコメントアウト(clip out) します。ここは<tt>rc.inet*</tt>ファイルを実行するためのif分岐です。ブート アップ中はこれが起こらないようにします。 </p> <p> <!-- Create a new file: <tt>/tape144/root/.rhosts</tt> containing the line: --> <tt>/tape144/root/.rhosts</tt>ファイルを作ります。 <tscreen> <verb> linux root </verb> </tscreen> <!-- where, again, ``<tt>linux</tt>'' is replaced with the full machine name (including domain) or the IP# of the Linux machine. --> という行が含まれています。ここで``<tt>linux</tt>''はドメイン名も含んだ マシン名かIP#に置き換えておいて下さい。 </p> <p> <!-- Fill in the password field in <tt>/tape144/etc/passwd</tt> for the root login to keep people from logging onto the MS-DOS machine while you're doing the backup. You can do this by copying the corresponding field from your Linux machine's <tt>/etc/passwd file</tt>. --> バックアップを取っている間、MS-DOSマシンにログインする人がいないように rootログイン用の<tt>/tape144/etc/passwd</tt>のパスワードフィールドを 満たしておきます。Linuxマシンの<tt>/etc/passwd file</tt>から適当なフィールド をコピーすればよいです。 </p> <p> <!-- Copy /usr/bin/rsh into /tape144/usr/bin. -->/usr/bin/rshを/tape144/usr/binにコピーします。 </p> <p> <!-- Copy the following files from <tt>/usr/etc</tt> into <tt>/tape144/usr/etc</tt>: --> <tt>/usr/etc</tt>から以下のファイルを<tt>/tape144/usr/etc</tt>にコピーします。 (訳注:<tt>/usr/etc</tt>でなく<tt>/etc</tt>の環境の場合は<tt>/etc</tt>から コピーして下さい) <tscreen> <verb> in.rshd rpc.mountd rpc.nfsd rpc.portmap services tcpd </verb> </tscreen> </p> <p> <!-- Create a new script, <tt>/tape144/bin/tapesetup</tt>, which consists of the following: (change ``<tt>linux</tt>'' to reflect your Linux machine name). --> 新しいスクリプト<tt>/tape144/bin/tapesetup</tt>を作ります。以下の文を そのファイルに書き込んで下さい。 <tscreen> <verb> #! /bin/sh /bin/sh /etc/rc.d/rc.inet1 /bin/sh /etc/rc.d/rc.inet2 /bin/mount linux:/nfs /mnt /bin/insmod /mnt/ftape.o </verb> </tscreen> ここで``<tt>linux</tt>''はLinuxマシン名にします。 <!-- Note that newer kernels will not require the insmod line. --> 新しいカーネルではinsmodの行はいりません。 </p> <p> <!-- Next, create another new script, <tt>/tape144/bin/msdosset</tt>, as follows: (change ``<tt>linux</tt>'' to reflect your Linux machine name). --> 次に以下のようなスクリプト<tt>/tape144/bin/msdosset</tt>も作っておきます。 <tscreen> <verb> #! /bin/sh /bin/sh /etc/rc.d/rc.inet1 /bin/sh /etc/rc.d/rc.inet2 mount linux:/mnt /mnt /bin/insmod /mnt/ftape.o </verb> </tscreen> ここで``<tt>linux</tt>''はLinuxマシン名にします。 <!-- As above, newer kernels will not require the insmod line. --> 同様に新しいカーネルではinsmodの行はいりません。 </p> <p> <!-- Create a readable file, <tt>/tape144/root/notes</tt>, which contains this helpful information for use in full recovery: --> 説明のためのファイル<tt>/tape144/root/notes</tt>も作っておきます。これは 復旧の時の手順情報を書いておきます。<p> --------------------- ここから ----------------------------------- <!-- For a full recovery to a trashed hard disk, boot the Linux machine with the SAR disks #1 and #2 then type the following: /bin/sh /etc/rc.d/rc.inet1-l /bin/sh /etc/rc.d/rc.inet2 /usr/etc/rpc.portmap /usr/etc/rpc.mountd /usr/etc/rpc.nfsd Next, insert SAR disk #3 and type: mount /dev/fd0 /mnt Create a new mount point, with: mkdir /mnt2 and mount your Linux hard disk partition on this point. You may have to reformat the partition first, if so, follow the directions in the Linux Installation HOWTO. The SAR disks contain all the files necessary to do the reformat. Finally, use disks SAR#1 and SAR#2 to boot up the MS-DOS machine and run the /bin/msdosset script on that machine. It will take about a minute to run that script because it is getting an NSF file from a floppy drive, so be patient. Now, recover the tape to /mnt2 on the Linux machine. --> <tscreen> <verb> ハードディスクが壊れた時修復させるために、SAR(Search-And-Rescue、復旧) ディスク#1と#2を使ってLinuxをブートします。そして以下のように実行します。 /bin/sh /etc/rc.d/rc.inet1-l /bin/sh /etc/rc.d/rc.inet2 /usr/etc/rpc.portmap /usr/etc/rpc.mountd /usr/etc/rpc.nfsd つぎにSARディスク#3を入れて、 mount /dev/fd0 /mnt とします。新しいマウントポイントを作ります。 mkdir /mnt2 ここにLinuxハードディスクのパーティションをマウントして下さい。 はじめにパーティションをフォーマットしておかなくてはならないかも しれません。その時はLinux Installation HOWTOを参考にします。 SARディスクは再フォーマットするのに必要な全ファイルがあります。 最後にSAR#1、SAR#2ディスクを使ってMS-DOSマシンをブートアップしこのマシンから /bin/msdossetスクリプトを実行して下さい。フロッピードライブからNFSファイルを getしているので実行には1分位かかるかもしれません。しばらくお待ち下さい。 以上でテープからLinuxマシンの /mnt2 に復旧されました。 </verb> </tscreen> --------------------- ここまで ----------------------------------- </p> <p> <!-- If you are using the backup scripts you will need to copy 'afio' into the <tt>/tape144/local/bin</tt> subdirectory. It is not necessary to have the rest of the backup script files on the recovery disks, an archive can be recovered using only 'afio' and 'gzip'. --> もしバックアップスクリプトを使っているなら'afio'コマンドを <tt>/tape144/local/bin</tt>サブディレクトリにコピーしておきます。 復旧ディスクにバックアップスクリプトの残りを入れておく必要はありません。 アーカイブは'afio'と'gzip'だけで復旧できます。 </p> <p> <!-- I was unable to use the backup scripts as they come shipped. The tape archive appears to build cleanly, but it is unrecoverable. I found that removing the block size and conversion statements fixed it. Here is the patch to the ``<tt>netbackup</tt>'' script. Apply this patch to the Linux machine's hard disk copy of 'netbackup' as well as to the copy on the SAR disks. --> 著者はバックアップスクリプトをそれがちゃんと動作するように使えていません。 テープアーカイブはきれいに作られているように見えるのですが、復旧できません。 ブロックサイズの削除とスクリプト中の書き換えをすることでバグをとりました。 以下その``<tt>netbackup</tt>''スクリプトのパッチを書きました。このパッチを、 SARディスクへのコピーと同様に'netbackup'のLinuxマシンのハードディスクコピー にも当てておきます。 <tscreen> <verb> *** netbackup.orig Mon Jan 9 17:22:32 1995 --- netbackup Mon Jan 9 17:23:25 1995 *************** *** 35,41 **** "'mknod", devname, "p'"); exec ("su -", USERNAME, "-c", "'rsh ", REMOTE_HOST, ! "\"dd", "of=" REMOTE_DEVICE, "obs=20k", "conv=sync\"", "<", devname, "'&ero;" ); --- 35,41 ---- "'mknod", devname, "p'"); exec ("su -", USERNAME, "-c", "'rsh ", REMOTE_HOST, ! "\"dd", "of=" REMOTE_DEVICE, "\"", "<", devname, "'&ero;" ); *************** *** 50,56 **** "'mknod", devname, "p'"); exec ("su", USERNAME, "-c", "'rsh ", REMOTE_HOST, ! "\"dd", "if=" REMOTE_DEVICE, "ibs=20k", "conv=sync\"", ">", devname, "'&ero;" ); --- 50,56 ---- "'mknod", devname, "p'"); exec ("su", USERNAME, "-c", "'rsh ", REMOTE_HOST, ! "\"dd", "if=" REMOTE_DEVICE, "\"", ">", devname, "'&ero;" ); </verb> </tscreen> </p> <p> <!-- You have now finished your SAR disk #2. Write protect it. --> これでSARディスク#2が出来上がりました。ライトプロテクトしておいて下さい。 </p> <p> <!-- Next, mount a clean, formatted disk (create it with <tt>fdformat</tt> and <tt>mkfs</tt>). Copy the <tt>ftape.o</tt> file onto it, and label it SAR#3. For some reason things go badly if you write protect this disk, so leave it write-enabled. --> つぎに空のフォーマットされたディスクをマウントします(フォーマットは <tt>fdformat</tt>、<tt>mkfs</tt>コマンドを使って行って下さい)。 <tt>ftape.o</tt>ファイルをそのディスクにコピーして、ディスクラベルは SAR#3としておきます。いくつか理由があり、このディスクをライトプロテクト すると不都合が生じます。書き込み可能にしておいて下さい。 </p> <p> <!-- On the Linux machine, create a new directory for NFS file serving. I made a directory: --> Linuxマシン上で、NFSファイル保存用ディレクトリを作ります。 <tscreen> <verb> /nfs </verb> </tscreen> <!-- Put the <tt>ftape.o</tt> (unstripped, about 500+ kB) into this subdirectory. Create an entry in your Linux's exports file <tt>/etc/exports</tt>: --> ここに<tt>ftape.o</tt>(unstripped, 500KB強)を置きます。Linuxの <tt>/etc/exports</tt>ファイルに <tscreen> <verb> /nfs msdos(ro) </verb> </tscreen> と書き込みます。 <!-- Note that all files in your NFS directory and it's subdirectories are not secure. Somebody else could boot the MS-DOS machine into Linux with his own boot disks and mount this directory, so be certain that you don't put anything sensitive in your NFS subdirectory. --> NFSディレクトリの全ファイルとそのサブディレクトリは安全ではないことに注意 して下さい。誰かがブートディスクを使ってLinuxからMS-DOSマシンをブート して、このディレクトリをマウントすることができるのです。NFSサブディレクトリに は重要なファイルは置かないようにして下さい。 </p> <p> <!-- Restart your NFS daemons, <tt>rpc.mountd</tt> and <tt>rpc.nfsd</tt>. They don't seem to take kindly to a <tt>SIGHUP</tt> restart, so kill them and reinvoke them. If you're not activating these daemons in your <tt>/etc/rc.d/rc.inet2</tt> you might want to do so now. --> NFSデーモン(<tt>rpc.mountd</tt> と <tt>rpc.nfsd</tt>を使って)を再スタート します。<tt>SIGHUP</tt>で再び開始するのはどうもよくないので、killして再度実行 します。もし<tt>/etc/rc.d/rc.inet2</tt>でこれらのデーモンをアクティブにしてい ないのなら今のうちに設定しておきましょう。 </p> <p> <!-- OK, now we're all set to back up and recover. To make a full backup from the Linux machine, boot the MS-DOS machine with SAR#1. When prompted for the second disk, load SAR#2. Log in as root, and execute the script: <tt>/bin/tapesetup</tt>. Log out of the MS-DOS machine. --> さあ、バックアップと復旧の設定は終りました。Linuxマシンのフルバックアップ をとるために、SAR#1ディスクを使ってMS-DOSマシンをブートします。2枚目の ディスクのプロンプトが出たらrootとしてログインして<tt>/bin/tapesetup</tt> スクリプトを実行します。終ったらMS-DOSマシンからログアウトします。 <!-- If you're using the backup scripts, the netbackup command will now work. You can also use the ``<tt>-f msdos:/dev/ftape</tt>'' switch on GNU <tt>tar</tt>, <tt>cpio</tt>, or <tt>mt</tt>, and make your backup this way. If you have a backup program, which is only capable of writing to a local file, do the following. Assume that the backup program is called ``<tt>localbackup</tt>'' and writes to the file represented by its command line argument: --> もしバックアップスクリプトを使っているなら、ここでnetbackupコマンドが使えます。 またGNU <tt>tar</tt>, <tt>cpio</tt>, <tt>mt</tt>コマンドに ``<tt>-f msdos:/dev/ftape</tt>''スイッチを付けられます。バックアップ プログラムがあるならローカルファイルに書き込むこともできます。それには 以下のようにします。バックアッププログラムを``<tt>localbackup</tt>''とします。 コマンドラインの引数にファイルを書きます。 <tscreen> <verb> mknod /tmp/tapepipe p rsh msdos dd of=/dev/ftape < /tmp/tapepipe &ero; localbackup /tmp/tapepipe </verb> </tscreen> <!-- when it's done, delete <tt>/tmp/tapepipe</tt>. --> 実行したら<tt>/tmp/tapepipe</tt>を削除しておいて下さい。 </p> <p> <!-- Recovering to a live Linux machine: the <tt>netbackup</tt> script, <tt>tar</tt>, <tt>cpio</tt>, and so on will all work without special actions on the part of the operator. If you have a local recovery program which recovers from a file, do this: --> Linuxマシンの復旧:<p> <tt>netbackup</tt>スクリプト、<tt>tar</tt>, <tt>cpio</tt>等は特別な操作を しなくても動作します。もしファイルから復旧するローカルプログラムがあるなら、 <tscreen> <verb> mknod /tmp/tapepipe p rsh -n msdos dd if=/dev/ftape >> /tmp/tapepipe &ero; localrecovery /tmp/tapepipe </verb> </tscreen> とします。 <!-- and delete <tt>/tmp/tapepipe</tt> when you're done. --> 同様に実行したら<tt>/tmp/tapepipe</tt>を削除しておいて下さい。 </p> <p> <!-- Notice that I'm using '<tt>rsh</tt>' to the root user on the MS-DOS machine. This works with a correct <tt>.rhosts</tt> entry. The configuration on the '<tt>tape144</tt>' disk allows <tt>rsh</tt> to root, but does not allow <tt>telnet</tt> or <tt>rlogin</tt> to root, logins are restricted to the console. This is good for security. --> 著者はMS-DOSマシンへのrootログインに '<tt>rsh</tt>'を使っています。 これは正確な<tt>.rhosts</tt>エントリーが必要です。'<tt>tape144</tt>'ディスク の設定はrootで<tt>rsh</tt>を使えるようにしますが、<tt>telnet</tt>や <tt>rlogin</tt>はrootで使えません。またログインはコンソールにのみ制限されます が、これはセキュリティ上良いことです。 </p> <p> <!-- If you are worried about a root <tt>.rhost</tt> file, you can create a new user on SAR#2, ``<tt>tapeuser</tt>'', with permissions to operate the tape drive but not the disks (create a new group and put tapeuser in that group, then <tt>chown</tt> and <tt>chmod</tt> the files <tt>/dev/rft*</tt> and <tt>/dev/nrft*</tt>). --> root <tt>.rhost</tt> ファイルについて心配だったら、SAR#2の新しいユーザ ``<tt>tapeuser</tt>''を作っておくこともできます。パーミッションはテープ ドライブは操作できてディスク操作はできないといったものにします(新しい グループを作ってそのグループにtapeuserをおきます。そして <tt>chown</tt> と <tt>chmod</tt> コマンドで <tt>/dev/rft*</tt> 、 <tt>/dev/nrft*</tt>ファイルのオーナー、グループを変更しておきます)。 <!-- Your backup program then has to know to <tt>rsh</tt> to that username rather than to root. Of course, now there must be an <tt>.rhosts</tt> file in <tt>˜tapeuser</tt> on SAR#2. For my own use, I have chosen this course, rather than a root <tt>.rhosts</tt>. --> バックプログラムではrootとしてよりもユーザー名で<tt>rsh</tt>を使わなければ なりません。もちろんSAR#2ディスクの<tt>˜tapeuser</tt>に <tt>.rhosts</tt>ファイルを置いています。著者の場合はrootの<tt>.rhosts</tt> よりもこちらを選んでいます。 </p> <p> <!-- Finally, the directions for a complete recovery to a trashed hard disk. This assumes that the Linux partition is completely unrecoverable. If necessary, reformat that partition as described in the Linux Installation HOWTO. Boot the Linux machine from SAR disk #1. When prompted, insert disk #2. Now, follow the directions in the file <tt>/root/notes</tt> (this was <tt>/tape144/root/notes</tt> when it was mounted on your Linux machine). Once both machines have been booted up, run the recovery routine you need. If you are running the backup scripts you can do it as follows: --> 最後にクラッシュしたハードディスクの復旧をしてみます。ここでLinux パーティションは完全に回復できないと仮定しましょう。必要なら 「Linux Installation HOWTO」に従ってパーティションを再フォーマットして おきます。SARディスク#1を使ってLinuxマシンをブートします。プロンプトが 表示されたらSARディスク#2を入れます。ここで<tt>/root/notes</tt>ファイルに 書いたメモに従って作業をすすめて下さい(Linuxマシンにマウントされているなら これは<tt>/tape144/root/notes</tt>です)。いったん両方のマシンがブートされたら 、必要な復旧ルーチンを実行します。バックアップスクリプトを実行するなら以下の ようにすすめていきます。 <enum> <item><!-- change directory to the mount point of the hard disk partition which you will be recovering. -->ディレクトリを復旧したいハードディスクパーティションにマウントする箇所に 変更します。 <item><!-- if any mounted volumes are on the backup, and you want to recover them, create the mount points within the hard disk partition and mount the volumes. -->もしマウントされたボリュームがバックアップ上で、それを復旧したい 場合はハードディスクパーティションにマウントポイントを作りボリュームを そこへマウントします。 <item><!-- Enter the command: --> コマンドの入力: <tscreen> <verb> rsh -n msdos dd if=/dev/ftape | afio -i -v -Z -c 1024 - </verb> </tscreen> あるいは <tscreen> <verb> rsh -n -l tapeuser msdos dd if=/dev/ftape | afio -i -v -Z -c 1024 - </verb> </tscreen> あるいは <tscreen> <verb> mknod /tmp/backpipe p rsh -n msdos dd if=/dev/ftape >> /tmp/backpipe &ero; afio -i -v -Z -c 1024 /tmp/backpipe </verb> </tscreen> </enum> <!-- This reads the tape on the remote machine, writing the result to stdout, where <tt>afio</tt> picks it up. The '<tt>-i</tt>' switch tells it to recover the files relative to the current working directory (which is the root of the hard disk partition). '<tt>-v</tt>' is verbose, listing the files as they are recovered. '<tt>-Z</tt>' tells afio that this is an archive of individually compressed files. '<tt>-c 1024</tt>' tells it to use a 5 MB streaming buffer to avoid a lot of tape rewinding. --> <tt>afio</tt>がピックアップしたリモートマシン上のテープを読み、標準出力へ その結果が表示されます。'<tt>-i</tt>'スイッチを使うとカレントディレクトリ (ハードディスクパーティションのroot)に関係したファイルの復旧について教えて くれます。'<tt>-v</tt>'はverboseで復旧したファイルのリストを表示します。 '<tt>-Z</tt>'はafioにそれぞれ圧縮されたファイルのアーカイブであることを 教えます。'<tt>-c 1024</tt>'は5 MBストリーム(streaming buffer:通信)バッファ をテープの巻き戻しを防ぐために使っています。 </p> <sect>メモ <!-- Notes --> <p> <!-- The commands listed in the <tt>/tape144/root/notes</tt> file could be run from a script. When I tried, I got rpc setup errors. I suspect it was just that the commands were run too quickly, and the portmapper hadn't properly installed itself. I found that typing the sequence in manually worked fine, so I've recommended that. --> <tt>/tape144/root/notes</tt>ファイルにリストしたコマンドはスクリプトから 実行されます。試したところ、rpcセットアップエラーが出ました。コマンドが あまりにも速く実行されたかポートマップがちゃんとインストールされていない ためだと思います。うまく動作するように手動でシーケンスを入力すればよい ことに気づきました。ぜひ試してみて下さい。 </p> <p> <!-- I think this setup is secure. Note that somebody can still get access to all your files if they go to the tape drive and pull the tape out before you get there, then then read the tape themselves. People with very sensitive data might consider encrypting the stream from the archiver. --> ここで述べた設定は安全であると思いますが、もし作業を始める前に誰かが テープやテープドライバそのものを外してしまったら、だれでもあなたのファイルに (テープそのものを読んで)アクセスできてしまいます。機密データを扱う場合には アーカイバから送られる(stream)データを暗号化しておきたいと思うかもしれません。 <!-- Archive to standard output and pipe the output to the encrypter, and redirect the output of the encrypter to append to the named pipe <tt>/tmp/tapepipe</tt> as described above. Note that errors in the recovery process will result in all files after that point being unrecoverable, as the entire archive is now a single DES-encrypted stream. It is possible to use options on afio to send each file in the archive first through gzip, then into an encryption program like des, but note that this compressing first does provide a fair amount of known plaintext for determined code breakers to work with, so a better approach might be to skip the gzip step and simply encrypt it with des, at the expense of significantly more tape area. Needless to say, DES encrypted files don't compress. --> アーカイバから標準出力をデータを送らせ、その出力を暗号化プログラム にパイプで送り、暗号化プログラムの出力を先に説明した名前付きパイプ <tt>/tmp/tapepipe</tt>にリダイレクトで追加します。 <p> アーカイブ全体が<em/DESによって暗号化された一つのデータ/になるので、もし アーカイブからデータを取り出す作業の途中でエラーが生じると、それ以降 の全データが取り出せなくなってしまうので注意してください。 <p> afio のオプション指定によっては、最初にそれぞれのファイルを gzip で アーカイブにして、それから DES のような暗号化プログラムに送ることもでき ます。しかし、最初に圧縮する方法は暗号解読プログラム(code braker=コー ド破り)が動作するのに既知の十分な量のベタテキストを生成してしまう ので、大量のテープを使ってでも gzip での圧縮は飛ばして単に DES で暗 号化する方が良いと思われます。言うまでもありませんが、DES で暗号化 されたファイルは圧縮されていません。 </p> <p> <!-- The <tt>rc.inet1</tt> directions I've included will allow only communication with the local network, not the rest of the world through a gateway. --> <tt>rc.inet1</tt>ではローカルネットワークの通信のみ許可して いてゲートウェイからのものは許可されません。 </p> <p> <!-- During a full recovery to a blank hard disk the SAR disk #3 provides <tt>ftape.o</tt> to the MS-DOS machine through NFS. This is because some old versions of the <tt>ftape</tt> module can't control some tape drives when there is a disk mounted in the floppy drive. With newer kernels, the entire NFS stuff can be omitted. --> ハードディスクを復旧している間、SARディスク#3は NFSを通してMS-DOSマシンに<tt>ftape.o</tt>モジュールを与えます。これは <tt>ftape.o</tt>モジュールの古いバージョンではフロッピードライブにマウントし たディスクがある場合、テープドライブをコントロールできないものがあるからです。 新しいカーネルではNFSが行うことは全て省略されます。 </p> <p> <bf>これは大変重要です</bf>。 <!-- <bf>***TEST***</bf> the SAR recovery procedure. I did, but don't leave anything to chance. Make sure that you can recover at least one file from your tape to the Linux machine using only the SAR disks (i.e. without mounting the hard disk). If you can't reboot the Linux machine without inconveniencing a lot of users, change the setup information on the SAR disks to assign the ``<tt>linux</tt>'' identity to another MS-DOS machine and then boot the two MS-DOS machines into Linux to make sure everything works. Then, change the ``<tt>linux</tt>'' identity back again so that you have usable SAR disks. --> SAR復旧の手順は必ず<bf>***テストして下さい***</bf>。ここでは復旧はしましたが 必ずしもできるとは限りません。SARディスクを使ってテープから少なくとも1ファイ ルの修復がLinuxマシンでできることを確認しておいて下さい(ただしハードディスク のマウントはしないで)。もし適当なユーザーからLinuxマシンをリブートできない 場合はSARディスクのセットアップ情報を変更します。まず``<tt>linux</tt>'' アイデンティティの箇所を何か他のMS-DOSマシンに指定して、Linuxで全てが動作する ことを確認するためにMS-DOSマシンをブートします。最後に``<tt>linux</tt>'' アイデンティティをもとに戻してやればSARディスクが使えるようになります。 </p> <sect>著作権 <!-- Copyright --> <p> Copyright Jan 10, 1995 by Christopher Neufeld (<htmlurl url="mailto:neufeld@physics.utoronto.ca" name="neufeld@physics.utoronto.ca">) </p> <p> Modified Feb 6, 1996. </p> <p> Modified Aug 5, 1997. <hrule> [(日本語訳) 伊佐治 哲, <tt/isaji@mxu.meshnet.or.jp/<p> (校正) 藤原 輝嘉さん , <tt/fujiwara@linux.or.jp/ ] </article>