rebuilding the filesystems - is there an easier way?

Nick Pemberton nick at aimed.uucp
Thu May 9 23:53:57 AEST 1991


The machine: 25Mhz 386, 250MB Priam ESDI drive, cartridge tape, various
             serial and parallel ports

Recently, the disk drive in the machine has been very flaky, often locking
the system up, and often getting read/write errors. This reached a 
threshold level where we decided it was time to rebuild everything. My
goal was to do a low level format of the hard drive, completely clean out
the machine, reseat every board, etc.

Task 1 was to make a backup of the filesystems. We have two, the root system
and a seperate /u partition.

/u was easy:

find /u -print | cpio -oB >/dev/rct0

(well, not quite that easy, it had to be split into two lists, however, it
was not much effort)

for the root partition, I thought I would get clever and try and make bringing
the system back up as painless as possible. So I sync'd up, /etc/haltsys'd, and
booted off the emergancy boot floppy, and mounted /dev/hd0root on /mnt.
Then I did a 

find /mnt -print | cpio -oB >/dev/rct0

Again, everything seemed to go smoothly.

I checked all tapes, with 

cpio -it </dev/rct0

just to be safe.

Then I did the low-level format and surface analysis, which ran over night.
Since this went fine, I booted xenix off the N1 floppy, and went through the
basic install (to the point of just having the run time system installed).

Then I sync'd up, /etc/haltsys'd and booted the emerg floppy again.

Mounted /hd0root on /mnt, and went exploring - It looked fine, so I decided
to try and bring the rest of it back with a

cpio -idum </dev/rct0

Got a wierd reaction: It couldn't create any directories, it kept
giving error messages indicating errno: 2 and plowing on. The result was
that it restored very little of what was on the tape. I spent about 2 hours
mucking around trying to figure out why from the shell prompt I could create
directories but cpio couldn't. I still don't know the answer

To get everything back, I had to boot the system from the hardrive, create
the /u partition from scratch, using

/etc/mkfs /dev/u 149663:65000

and then mount that partition as /mnt, restore the original root partition
to that partition, then do a

chroot /mnt /bin/sh

to make that partion look like the root partition, and then cut a new tape
so that the pathnames were correct.

I then exit'd back to the normal root partition and did a cpio from the
new root tape to bring everything back

Naturally the /u partition was no problem to bring back.

What I'm wondering is, how could I have convinced cpio, when running on the
emerg floppy, to do the job for me - It was an enourmous pain in the ass to
recut tapes.

Or is there a more conventional way of doing this?

Nick
-- 
Nick Pemberton  		 uucp: !{lsuc, uunet!mnetor}!aimed!nick
AIM, Inc			  bus: (416) 429-1085
Toronto, Ontario, Canada         Home: (416) 690-0647



More information about the Comp.unix.xenix.sco mailing list