home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LINUX / HOWTO / mini / backdos.txt < prev    next >
Text File  |  1997-07-07  |  16KB  |  362 lines

  1. Backup-With-MSDOS mini-HOWTO
  2.  
  3.    Earlier I posed the question on the Net, how does one back up a Linux
  4. machine to a Colorado Jumbo 250 tape drive on an MS-DOS machine. From the
  5. email I received, it seems that this is a frequently pondered problem.
  6. Now that I've figured it out, I'm posting the method. If anybody wants to
  7. massage this into a HOWTO document, let me know. I should thank Jim Nance
  8. (jlnance@isscad.com) for pointing out that an MS-DOS machine need not
  9. always be an MS-DOS machine. This technique should also work for any
  10. other tape drive supported by the ftape module.
  11.    The criteria I set were that the resulting setup should be as secure
  12. as possible and should be fairly simple, and take up little or no space
  13. on the MS-DOS machine's hard drive. It should also be capable of
  14. recovering from the worst system corruptions, up to and including the
  15. theft of the hard disk, requiring a restore to a bare Linux file system.
  16. The technique described here uses no hard drive space on the MS-DOS
  17. machine, though it requires that that machine be assigned an IP#. You
  18. will need three formatted, blank 1.44MB diskettes.
  19.    Throughout this description I will refer to two machines as "msdos"
  20. and "linux". "msdos" is the name of the machine which has the tape drive
  21. and is usually running MS-DOS. "linux" is the Linux machine whose disk
  22. you are trying to back up or restore to the tape drive. For simplicity I
  23. will refer to the first machine as "msdos" even when it is booted into
  24. and running Linux. Further, all path names in this document should be
  25. considered to be relative to the Linux machine with the Search-And-Rescue
  26. (SAR) disks mounted somewhere on the system. That means that the file
  27. /etc/passwd is the password file for your Linux machine's hard drive,
  28. while, for instance, /tape144/etc/passwd is the corresponding file on the
  29. floppy disk.
  30.    I am using Karel Kubat's backup scripts, version 1.03, available at
  31. ftp://sunsite.enc.edu:/pub/Linux/system/Backup/backup-1.03.tar.gz.
  32. Throughout this document I will refer to these simply as "the backup
  33. scripts". You do not have to use these scripts for your own backups to
  34. tape. I like these scripts as they use afio to form an uncompressed
  35. archive of compressed files, rather than a compressed archive of
  36. uncompressed files. The former is much safer if there is a media read
  37. error during the restore. I understand that Karel is no longer supporting
  38. backup, and now has produced 'tob', or tape oriented backup. While I
  39. haven't tried the new package myself, it cannot make a significant
  40. difference to the procedure outlined here.
  41.  
  42.    First of all, obtain the ftape module. It is available at:
  43. ftp://sunsite.unc.edu/pub/Linux/kernel/tapes/ftape-2.05.tar.gz
  44. Next, get a Slackware boot disk (I got the net disk, but it doesn't make
  45. much difference) and the tape144 root disk, and put the images onto 3"1/2
  46. floppies.
  47.    The ftape module will only work if it is installed in the kernel which
  48. was running when you compiled it. I could not get it to work with the
  49. ftape.o module on the tape144 root disk, I think because that module has
  50. been stripped of symbols and won't install. So, you now have to make a
  51. new kernel with network and ftape support (if applicable, recent versions
  52. of ftape do not need kernel support, and recent kernels do not offer the
  53. option), and then a new ftape.o. Read the directions which ship with the
  54. ftape archive for directions at this stage. Remember that the kernel you
  55. compile must support the Ethernet cards on both the Linux machine and the
  56. MS-DOS machine.
  57.    Copy the newly created kernel image over top of the one on the Net
  58. boot disk. Use /bin/cp, do not create a boot disk with the "dd" command
  59. as you would to create a bootable kernel image. Write protect the boot
  60. disk, and label it: SAR#1.
  61.  
  62.    Now, mount the tape144 root disk. I'll assume that the mount point is
  63. /tape144, to avoid confusion in file names. We need to free some space
  64. on it, so delete the following files:
  65. /tape144/bin/dialog
  66. /tape144/bin/elvis
  67. /tape144/bin/vi
  68. /tape144/boot/ftape.o
  69.  
  70.    Now, create a new file:
  71. /tape144/etc/exports
  72. which contains the following line:
  73. /mnt    msdos(ro)
  74. Where "msdos" should be replaced with the name or IP# of the MS-DOS
  75. machine which has the tape drive installed.
  76.  
  77.    Next, so that you don't have to rely on a name server, add lines to
  78. the file /tape144/etc/hosts with the names and IP numbers of the Linux
  79. and MS-DOS machines. For instance, mine contains the following two lines:
  80. 128.100.75.114  caliban.physics.utoronto.ca caliban caliban.physics
  81. 128.100.75.111  ariel.physics.utoronto.ca ariel ariel.physics
  82.  
  83.    Now, there's some sort of problem with the inetd configuration. We
  84. have to put the full path name of the rsh daemon in it. Change line 19
  85. of /tape144/etc/inetd.conf to read:
  86. shell   stream  tcp     nowait  root    /usr/etc/tcpd   /usr/etc/in.rshd
  87.  
  88.    Add local net routing information to /tape144/etc/rc.d/rc.inet1 to
  89. enable the MS-DOS machine to use the network. The format of this depends
  90. on your network configuration, you can just copy the appropriate format
  91. out of your Linux /etc/rc.d/rc.inet1. For my network, the lines that
  92. have to be added are:
  93. /etc/ifconfig eth0 128.100.75.111 broadcast 128.100.75.0 netmask 255.255.255.0
  94. /etc/route add -net 128.100.75.0 netmask 255.255.255.0
  95. The IP# in the ifconfig entry is that of the MS-DOS machine.
  96.    Now, copy this file into /tape144/etc/rc.d/rc.inet1-l, and change the
  97. IP# in the new file to reflect that of the Linux machine rather than the
  98. MS-DOS machine.
  99.    Next, clip out lines 3 to 11 of /tape144/etc/rc.local. That's an if
  100. statement which executes the rc.inet* files. We don't want this to
  101. happen during the bootup.
  102.    Create a new file: /tape144/root/.rhosts containing the line:
  103. linux root
  104. where, again, "linux" is replaced with the full machine name (including
  105. domain) or the IP# of the Linux machine.
  106.    Fill in the password field in /tape144/etc/passwd for the root login
  107. to keep people from logging onto the MS-DOS machine while you're doing
  108. the backup. You can do this by copying the corresponding field from your
  109. Linux machine's /etc/passwd file.
  110.    Copy /usr/bin/rsh into /tape144/usr/bin.
  111.    Copy the following files from /usr/etc into /tape144/usr/etc:
  112. in.rshd
  113. rpc.mountd
  114. rpc.nfsd
  115. rpc.portmap
  116. services
  117. tcpd
  118.    Create a new script, /tape144/bin/tapesetup, which consists of the
  119. following: (change "linux" to reflect your Linux machine name).
  120.  
  121. === BEGIN /tape144/bin/tapesetup ===
  122. #! /bin/sh
  123.  
  124. /bin/sh /etc/rc.d/rc.inet1
  125. /bin/sh /etc/rc.d/rc.inet2
  126.  
  127. /bin/mount linux:/nfs /mnt
  128. /bin/insmod /mnt/ftape.o
  129. === END /tape144/bin/tapesetup ===
  130.  
  131.    Next, create another new script, /tape144/bin/msdosset, as follows:
  132. (change "linux" to reflect your Linux machine name).
  133.  
  134. === BEGIN /tape144/bin/msdosset ===
  135. #! /bin/sh 
  136.  
  137. /bin/sh /etc/rc.d/rc.inet1
  138. /bin/sh /etc/rc.d/rc.inet2
  139.  
  140. mount linux:/mnt /mnt
  141. /bin/insmod /mnt/ftape.o
  142. === END /tape144/bin/msdosset ===
  143.  
  144.    Create a readable file, /tape144/root/notes which contains this
  145. helpful information for use in full recovery:
  146.  
  147. === BEGIN /tape144/root/notes ===
  148. For a full recovery to a trashed hard disk, boot the Linux machine with
  149. the SAR disks #1 and #2 then type the following:
  150.  
  151. /bin/sh /etc/rc.d/rc.inet1-l
  152. /bin/sh /etc/rc.d/rc.inet2
  153.  
  154. /usr/etc/rpc.portmap
  155. /usr/etc/rpc.mountd
  156. /usr/etc/rpc.nfsd
  157.  
  158. Next, insert SAR disk #3 and type:
  159.  
  160. mount /dev/fd0 /mnt
  161.  
  162. Create a new mount point, with:
  163. mkdir /mnt2
  164. and mount your Linux hard disk partition on this point. You may have to
  165. reformat the partition first, if so, follow the directions in the Linux
  166. Installation HOWTO. The SAR disks contain all the files necessary to do
  167. the reformat.
  168.  
  169. Finally, use disks SAR#1 and SAR#2 to boot up the MS-DOS machine and run
  170. the /bin/msdosset script on that machine. It will take about a minute to
  171. run that script because it is getting an NSF file from a floppy drive, so
  172. be patient. Now, recover the tape to /mnt2 on the Linux machine.
  173. === END /tape144/root/notes ===
  174.  
  175.    If you are using the backup scripts you will need to copy 'afio' into
  176. the /tape144/local/bin subdirectory. It is not necessary to have the rest
  177. of the backup script files on the recovery disks, an archive can be
  178. recovered using on