home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / ultrix / 8161 < prev    next >
Encoding:
Text File  |  1992-11-08  |  5.7 KB  |  135 lines

  1. Newsgroups: comp.unix.ultrix
  2. Path: sparky!uunet!haven.umd.edu!decuac!hussar.dco.dec.com!mjr
  3. From: mjr@hussar.dco.dec.com (Marcus J. Ranum)
  4. Subject: Re: Ultrix 4.2a crashed, PLEASE HELP!!!
  5. Message-ID: <1992Nov8.013153.27119@decuac.dec.com>
  6. Sender: news@decuac.dec.com (USENET News System)
  7. Nntp-Posting-Host: hussar.dco.dec.com
  8. Organization: Digital Equipment Corporation, Washington ULTRIX Resource Center
  9. References: <1992Nov8.005234.837@u.washington.edu>
  10. Date: Sun, 8 Nov 1992 01:31:53 GMT
  11. Lines: 122
  12.  
  13. [No offense, but the title is a bit misleading. ULTRIX didn't crash. You
  14. crashed it.]
  15.  
  16. >      (cd $1; tar cf - .) | (cd $2; tar xvf - )
  17. >
  18. >while in the root directory, I typed 'cpdir' without giving any
  19. >parameters and the nightmare starts. After running the above
  20. >command, the messages showed on the screen say something like
  21. >...
  22. >...
  23. >bin/ls size changed
  24. >bin/mkdir size changed
  25. >bin/cp size changed
  26. >...
  27. >...
  28. >
  29. >I used 'CTRL c' to quit the shell script as soon as I can once I saw
  30. >this happended, but the system was damaged. Afterwards, whenever I use
  31. >those commands (i.e. ls, mkdir, cp...), I got a 'segment fault' and then
  32. >'core dumped'. I 'shutdown' and turned off the machine and the system
  33. >can not be rebooted since then.
  34.  
  35.     Right, what you did was truncate all those files. They're
  36. zapped and that's all there is to it. Fixing the machine (especially
  37. if you have valuable files) is gonna be a trick. There are 2 ways you
  38. can proceed - I'll tell you the one I think is hardest first and then
  39. I'll describe the one I suggest trying.
  40.  
  41.     I'm going by memory here and this should be *about* right.
  42. You may need to read a few manual pages here and there if the
  43. exact commands I list don't work - but the gist of them is correct,
  44. I assure you. If worst comes to worst, keep the machine DOWN and
  45. email me monday and I'll give you my office phone #.
  46.  
  47.     The *hard* way is to get another DECstation with ULTRIX on an
  48. external disk, and plug it onto your SCSI chain, boot off it, then
  49. mount the filesystem you trashed and try to replace the binaries
  50. by running a find to see what files changed on those filesystems.
  51. Build a list of all the things that changed since that day and assume
  52. that those are zapped files, then write a script to copy new copies
  53. of things like /bin/ls and so on from the "good" hard disk to the
  54. "dead" one.
  55.  
  56.     If you have a working system on another disk, just boot
  57. off it (as suggested above) and make tape copies of the files you
  58. want to save, then re-install. If you don't have a working system,
  59. that you can pirate a disk from, then you need to proceed as follows,
  60. which requires only a tape drive.
  61.  
  62.     The *easy* way, and the one I suggest, is to boot from
  63. tape (or whatever your installation media is) and select the
  64. "systems management" option. This will drop you into a completely
  65. minimal shell in an in-memory filesystem. Remember that in the
  66. minimal filesystem there arent a lot of programs and there is no
  67. PATH set to search /bin and /etc. You may need to type complete
  68. pathnames for commands (as I do in my examples below) and you
  69. may beed to use "echo" instead of "ls" to see what is in the
  70. directories! Don't panic, though - the bare minimum of what you
  71. need *IS* there.
  72.  
  73. Then you need to
  74. cd to /dev and make a device node for the trashed disk. Suppose
  75. your filesystems were on scsi disk 0, you would:
  76.  
  77. # cd /dev
  78. # MAKEDEV rz0
  79.  
  80.     Here we're assuming that *ALL* we're trying to do is save your
  81. valuable data. You're going to need to re-install the operating system
  82. from scratch, but we'll try to save your files. Let's pretend they're
  83. user files in /usr/users or something like that. Let's pretend that
  84. /usr/users was on /dev/rz0g. If you can't remember what was on where,
  85. then you need to mount the *root* filesystem of the original disk
  86. and see if you can read the /etc/fstab, or just follow the
  87. procedure outlined below for each partition on the disk, to see which
  88. is the one you want.
  89.  
  90. # fsck /dev/rz0g
  91.   (here it should *say* where it was last mounted, so you'll know if
  92.     you have the right partition. if not, just try fscking another.)
  93. # /bin/mount /dev/rz0g /mnt
  94.  
  95.     At this point you can cd to /mnt and look around and see if the
  96. files you need are there.
  97.  
  98.     Now you have a couple of options. If you've got an existing
  99. ULTRIX machine that is up and running, I suggest you get a copy of
  100. "tar" from it. I don't *THINK* the standalone system has "tar". 
  101. (the standalone system is all a root filesystem in a RAM disk, and
  102. has not got a lot of room to waste). The way to do that is to just
  103. get onto a working machine, mount a tape, and use dd to copy the
  104. executable to tape, then copy it back onto the system you're
  105. trying to repair.
  106.  
  107. on some other machine:
  108. otherbox# dd if=/bin/tar of=/dev/rmt0h
  109.  
  110. mount the tape in the hosed machine and:
  111. # cd /dev
  112. # MAKEDEV tz<scsinumber>  (if you have a TK50 as SCSI ID 5, it would be tz5)
  113. # cd /bin
  114. # dd if=/dev/rmt0h of=tar
  115. # chmod 755 tar
  116.  
  117.     Now you have a tape archiver, and you're in good shape. Figure
  118. out what files you want to save and just use tar to copy them to tape.
  119. If you don't even have another machine running ULTRIX then, well,
  120. you're going to need to look in /bin and /etc on the in-memory disk
  121. and see if there is a copy of "dump". I know there is a copy of
  122. restore, but I can't recall if ther's a copy of "dump" or "tar"
  123. on the in-memory system. If there isn't, then you've got one last resort,
  124. and that is to find and mount (as above) the old / partition
  125. from the trashed disk, and *pray* that /bin/tar or /bin/dump are
  126. still there and intact.
  127.  
  128.     Assuming you can get a copy of tar or dump by any of these
  129. means, save your user files, save /etc and /usr/spool/mail and so on,
  130. then re-install ULTRIX and reload your user files. Also, don't
  131. ever write programs (even shell scripts) that don't check for valid
  132. parameters.
  133.  
  134. mjr.
  135.