XENIX /bin/cpio uses /bin/mkdir

Warren Tucker wht at tridom.uucp
Wed Aug 9 10:13:57 AEST 1989


XENIX /bin/cpio uses /bin/mkdir to create directories when it is
invokes with the -id switches.  This statement may hold true for
Real(TM) S5R2 and other derivatives which lack mkdir(S) (mkdir(2)).

I wanted to use cpio rather than tar to backup/mkfs/restore my root
filesystem (under SCO XENIX/386 on a Compaq with 1.2 Mb floppy and
mini cartridge tape).  Cpio, unlike tar, will save/restore special
files (which are rather important to a self-respecting root partition
:-)).

I copied cpio onto the "emergency boot floppy" (the basic version of
which *AIN'T* equipped for too much of an emergency).  I made the tape
backup.  I even remembered to put /etc/mkfs on the floppy.  Then, I
booted the floppy and made sure cpio -iBtv would read the tape.

/etc/mkfs /dev/hd0root 81000:10000 1 306
mkfs: /dev/hd0root contains data. Overwrite? (y/n): y
Gulp ... hold breath ... well, lets see if the rust stayed on the tape.

Imagine my surprise when cpio reported something like
"cannot create bin directory: error 2" when told to please -iB.

Fortunately I had done
       find . -print | sort | cpio -oB > /dev/rctmini
                       ^^^
and "bin" is near the top of the alphabet and a 
       mount /dev/hd0root /mnt; cd /mnt
       cpio -irB < /dev/rctmini
              ^
didn't require TOO many carriage returns before cpio asked
Rename <bin/mkdir>?
whereupon, I answered
       mkdir
and cpio plopped mkdir right into the / directory of the root partition.
I interrupted tar, copied mkdir to /bin on the floppy and then did
the full bore restore again, this time successfully.  ("Hi Ho" -- Kurt
Vonnegut).


-- 
-------------------------------------------------------------------
Warren Tucker, Tridom Corporation       ...!gatech!emory!tridom!wht 
"Might as well be frank, monsieur.  It would take a miracle to get
you out of Casablanca and the Germans have outlawed miracles."



More information about the Comp.unix.xenix mailing list