[comp.unix.microport] How to recover programs from install disks

david@monymsys.uucp (David Kozinn) (05/31/90)

While playing around with the accounting facilities on my Sys V/386 system, I
managed to clobber /usr/lib/acct/acctcon2, one of the programs used to
process accounting records. While I've backed up any useful data on the
system, I never did a full system backup because I figured that I could always
recover any clobbered programs from the installation disks. Well, I tried to
do that today and I just can't figure out how. Obviously, I don't want to
re-install the entire system, so pkginstall isn't going to work. I haven't
been able to find anything in the manual that explains how to do this, and a
cpio on the disks just seems to show a file called "diskdata" that apparently
contains the name of the disk. Does anyone out there know of any way to
recover this one file? Thanks.
-- 
David Kozinn                     | UUCP:   pyrnj!bartal!monymsys!david
MONY Financial Services MD 75-14 | Domain: monymsys!david@bartal.crlabs.com
Glenpointe Centre West           | GEnie:  D.KOZINN 
Teaneck, NJ 07666-6888           | Phone:  +1-201-907-6990

rock@rancho.uucp (Rock Kent) (06/01/90)

>>>>> On 31 May 90 15:33:01 GMT, david@monymsys.uucp (David Kozinn) said:
David> While playing around with the accounting facilities on my Sys
David> V/386 system, I managed to clobber /usr/lib/acct/acctcon2, one
                         [stuff left out]
David> manual that explains how to do this, and a cpio on the disks
David> just seems to show a file called "diskdata" that apparently
David> contains the name of the disk.

It sounds like you used the commad: cpio -i[vldm] < /dev/rdsk/f0q15dt

You need to use the command:        cpio -i[vldm] < /dev/rdsk/f0q15d

The f0q15dt device refers to the entire floppy including the boot
track.  The f0q15d device does not include that track.  Microport used
this trick to put an index(??) on each disk in the boot track,
"diskdata", in addition to the "real" cpio file.

***************************************************************************
*Rock Kent    rock@rancho.uucp        POB 8964, Rancho Sante Fe, CA. 92067*
***************************************************************************

randy@rls.UUCP (Randall L. Smith) (06/01/90)

In article <1990May31.153301.2562@monymsys.uucp>, david@monymsys.uucp (David Kozinn) writes:
> cpio on the disks just seems to show a file called "diskdata" that apparently
> contains the name of the disk. Does anyone out there know of any way to
> recover this one file? Thanks.

You're just using the wrong device.  Probably some command like;

cpio -ivt < /dev/rdsk/0s25

Right?  Well, you're only off by a smidgen.  Try;

cpio -ivt < /dev/rdsk/0s24

which will list the contents of the floppy.  All other applicable commands
for cpio will work dandy with /dev/rdsk/0s24.

Cheers!

- randy

Usenet: randy@rls.uucp 
Bangpath: ...<backbone>!osu-cis!rls!randy
Internet: rls!randy@tut.cis.ohio-state.edu

john@wa3wbu.UUCP (John Gayman) (06/01/90)

In article <1990May31.153301.2562@monymsys.uucp>, david@monymsys.uucp (David Kozinn) writes:
> While playing around with the accounting facilities on my Sys V/386 system, I
> managed to clobber /usr/lib/acct/acctcon2, one of the programs used to
> process accounting records. While I've backed up any useful data on the
> system, I never did a full system backup because I figured that I could always
> recover any clobbered programs from the installation disks. Well, I tried to
> do that today and I just can't figure out how. Obviously, I don't want to


   When you execute pkginstall, it actually just goes and runs a shell
 script called /etc/installit. Looking at this script you can see there
 are several forms of cpio it will use depending on what you were doing.
 Mostly they are pretty similar and will serve your purpose. Here they are
 from installit:


     cpio -iu </dev/rdsk/f0q15dt 2>/dev/null

     cpio -icBdmu $1 </dev/rdsk/f0q15d 2>/dev/null

     cpio -icBdmu </dev/rdsk/f0q15d

   
   As you can see the key is using /dev/rdsk/f0q15d. I have selectively
 restored many files from the distribution disks this way and it works
 great. Good luck.


						John


-- 
John Gayman, WA3WBU              |           UUCP: uunet!wa3wbu!john
1869 Valley Rd.                  |           ARPA: john@wa3wbu.uu.net 
Marysville, PA 17053             |           Packet: WA3WBU @ WB3EAH 

david@monymsys.uucp (David Kozinn) (06/01/90)

In article <1990May31.153301.2562@monymsys.uucp> david@monymsys.UUCP (David Kozinn) writes:
>While playing around with the accounting facilities on my Sys V/386 system, I
>managed to clobber /usr/lib/acct/acctcon2 ...
>Does anyone out there know of any way to
>recover this one file [from the install disks]? Thanks.

Thanks to Eric Schnoebelen (eric@cirr.com) for providing the a pointer in the
right direction. The install disks have two sets of files on them, the
"diskdata" file that I referred to in my original posting and a second set of
files, a cpio archive, which you get to by specifying the disk device that
excludes the boot tracks. To recover the file, I then used:
	cpio -idu < /dev/dsk/f0q15d "*acctcon2*"
which recovered the file in a subtree under the current directory. That was
the easy part. The hard part was going through all the disks to find which one
to insert for the cpio command (it was something like the 5th or 7th disk).
-- 
David Kozinn                     | UUCP:   pyrnj!bartal!monymsys!david
MONY Financial Services MD 75-14 | Domain: monymsys!david@bartal.crlabs.com
Glenpointe Centre West           | GEnie:  D.KOZINN 
Teaneck, NJ 07666-6888           | Phone:  +1-201-907-6990

det@hawkmoon.MN.ORG (Derek E. Terveer) (06/02/90)

In article <1990May31.153301.2562@monymsys.uucp> david@monymsys.uucp (David Kozinn) writes:
> While playing around with the accounting facilities on my Sys V/386 system, I
> managed to clobber /usr/lib/acct/acctcon2, [....]  and a
> cpio on the disks just seems to show a file called "diskdata" that apparently
> contains the name of the disk. Does anyone out there know of any way to
> recover this one file? Thanks.

The floppies are broken up into, essentially, two sections:  a label track and
the data tracks (note plural vs. singular).  The first track on the install
disks is used as a label and is accessed by the device /dev/rdsk/f0q15dt, where
the trailing 't' indicates the entire disk "total?".  To access the data after
the first track (i.e., tracks 1..79), use the device /dev/rdsk/f0q15d.

Since the first track is also generally used as the boot track on floppies
capable of booting, i frequently create the following links in /dev/rdsk and
/dev/dsk/:

ln f0q15dt f0		#default format for floppy drive 0 is 1.2MB
ln f0q15d  f0-boot	#1.2MB drive "minus" the boot track

derek


-- 
Derek Terveer		det@hawkmoon.MN.ORG