SUMMARY: Reading SUNOS Boot tape

From: kwongj@water.ca.gov
Date: Tue Jul 14 1992 - 01:07:12 CDT


My original message:
>> One simple question:
>> -Is it possible to get just one program off the
>> Sun 4.1 SUNOS tape? If so, how (or should I ask
>> how easy is it to do)?
>> This tape is in a boot format
>>

Yes, it is possible to read just one program or file off the
boot tape. Depending on the OS level of the tape, the files on the
tape could be in a slightly different form, but basically the
tape format is the same. There's a boot volume at the beginning, a Table
of Content and then the multiple files come after. You have to skip pass
the boot volume with the mt command to fast forward one file marker.
Afterward, you get the Table of Content the (TOC file) This file tells
you how the rest of the files are lay out, whether they are image,
tar files or compressed tar files, and which file marker it's located.
To read the TOC file you have to use the /usr/etc/install/xdrtoc since
the file is in XDR format. Once you have the TOC file, you can skip to
the file position you want and tar back the individual program or file
such as './bin/login'.

 
I like to thank the following people:
From: bernards@ECN.NL (Marcel Bernards)
From: Jacques.Beigbeder@dmi.ens.fr (Jacques Beigbeder)
From: evan@fsg.com (Evan L. Marcus [Fusion Systems Group, Ltd.])
From: tkevans@eplrx7.es.duPont.com (Tim Evans)
From: Jeff Bacon <bacon@mtu.edu>
From: sid@ingres.com (Sid Shapiro -- Ingres, an ASK Company)
From: kuhn@math.harvard.edu (Robert M. Kuhn)
From: exudnw@exu.ericsson.se (Dave Williams)
From: baumann@proton.llumc.edu (Michael Baumann)
From: poffen@sj.ate.slb.com (Russ Poffenberger)
From: Joseph C. Konczal <konczal@sunmgr.ncsl.nist.gov>
From: stanonik@nprdc.navy.mil (Ron Stanonik)
From: Kevin Cosgrove <qiclab!solomon!kevinc>
From: tfpoage@ucdavis.edu (Tom Poage)
From: Perry_Hutchison.Portland@xerox.com
From: bws900@cscgpo.anu.edu.au (Bede W P Seymour)
From: geertj@ica.philips.nl (Geert Jan de Groot)
From: IJohnston@cmutual.com.au (Ian Johnston)
From: kalli!kevin@fourx.Aus.Sun.COM (Kevin Sheehan {Consulting Poster Child})
From: M.Lim@anu.edu.au (Mathew Lim)
From: trdlnk!mike@uunet.UU.NET (Michael Sullivan)

============================================================================
>From bernards@ECNSUN.ECN.NL Thu Jul 9 03:21:45 1992

A SunOS boot tape consist of a multiple file tape.

You can lookup in the manual which file on the tape is needed for a part
of the distribution. (i.e. kvm or sys5 ). You mt -f /dev/nrst0 to that file marker
and then do this:

dd if=/dev/nrst0 bs=126b | zcat | tar xvf - <Single filename>

That should do it.

============================================================================
>From Jacques.Beigbeder@dmi.ens.fr Thu Jul 9 04:56:45 1992

A SunOS tape is some special files (boot, copyright, etc.)
and then .tar.Z files. So just try to read file after file
with 'mt -f /dev/nrst0 fsf 1 ' + 'dd | uncompress | tar tf -'.

>From evan@fsg.com Thu Jul 9 05:25:12 1992

In /usr/etc/install, you'll find extract_files. That will do what you
need.

E--

============================================================================
From: tkevans@eplrx7.es.duPont.com (Tim Evans)

/usr/etc/install/add_services allows you to load additional
packages from the tape.

From: Jeff Bacon <bacon@mtu.edu>

sure. the OS is loaded onto the drive in multiple tape files, one for
every package, in compressed tar format.
the table of contents is the second file on the tape, and is stored
in XDR format. to get it off:

mt -f /dev/nrst8 fsf
dd if=/dev/nrst8 | /usr/etc/install/xdrtoc > file

(you'll also find various TOCs in the release&install manual, but I've
known them to be wrong - check the tape, it's authoritative.)

that shows you what tape files represent the various packages you load
during suninstall. granted, it's not a listing of every single file that
you can just pick from. but you can make intelligent guesses, e.g. you're
not going to find /usr/ucb/rlogin as part of the OpenWindows Programmers
package. then, to get one off, simply

<fast forward tape>
dd if=/dev/nrst8 | uncompress | tar xf - whatever

play around with it a while, you'll get the hang of it.
good luck.

============================================================================
From: sid@ingres.com

It is pretty easy. You need to know the exact layout of the tape.
generally it continas some boot cood, some images of filesystems, some
tar archives, and a table of contents. The install manual will tell
you the exact layout. If you don't have the manual, then try a couple
of things. THe TOC is either the 1st, 2nd, or 3rd file on the tape -
I forget which.

dd the first 2 files off and examine them with strings. If one of
them contains some text that looks like it might be a bunch of lines
with the word "tar" in it, that that's the one. THer is a command
somewhere - mayge /usr/etc/install, maybe someplace else called xdrtoc
which can read that TOC file and format it so it can be read. Now you
just have to gifure out in which tar archive the file you are REALLY
looking for is in, either by good guessing, or by getting a list from
each archive on the tape. WIth judicious rewind and skipping files,
you ought ot be able to get to the correct archive then use tar to
pull off the file you want. Didn't I say it was simple :-)

============================================================================
From: kuhn@math.harvard.edu (Robert M. Kuhn)

Actually, No, I think only the first few files are in boot format,
most of the tape files are in tar format. You need to know in which
part of the distribution (root, usr, networking, TLI ...) the file
you want is, and what the cwd is for the tar (mostly, things have
pathnames rerlative to /usr, I believe).

Good Luck.

Bob

============================================================================
From: exudnw@exu.ericsson.se (Dave Williams)

try:

mt -f /dev/nrwhatever rew
mt -f /dev/nrwhatever fsf <number of files to skip over>
dd if=/dev/nrwhatever bs <usually 200> of=/destination

This is from the 4.1.1 install manual page 224

============================================================================
From: baumann@proton.llumc.edu (Michael Baumann)

Yes it is possible. the TOC is in the manual and the files are in
compressed tar format. skip forward to the section you want, dd the tape
piping into uncompress piping into tar

Simple :-)

============================================================================
From: poffen@sj.ate.slb.com (Russ Poffenberger)

Only the first file on the tape is boot format. The rest of the files are
in tar or compressed tar format. The best thing to do is to read the table
of contents on the tape. To do this do...

mt -f /dev/rst0 rew
mt -f /dev/nrst0 fsf 1
/usr/etc/install/xdrtoc /dev/rst0

This will list the table of contents. You need to pick which category the
file is in (usr, sys, etc), then use mt commands (with the NO-rewind device!)
to space the tape appropriately, then use tar/uncompress command as necessary
(The last column in the TOC list indicates the format) to get the file off
the tape.

============================================================================
From: Joseph C. Konczal <konczal@sunmgr.ncsl.nist.gov>

There are lists of tape contents in Appendix E of the SunOS 4.1
Release Manual. Read the mt(1), and tar(1) manual pages to find out
how to position the tape and to extract files.

E.g., to get /usr/ucb/biff off the Sun4 1/4 inch tape, insert the tape
in the tape drive (check the tape to be sure it is write protected so
you can't possibly destroy it), and type something like:

  Using the Borne Shell, /bin/sh: Don't type these comments, of course.
        $ TAPE=/dev/nrst0 # Use non-rewinding device, see st(4).
        $ export TAPE # mt and tar both use TAPE.
        $ mt fsf 7 # Skip to file 7, which contains usr.
        $ cd /usr # Determine where file will be placed.
        $ tar xv ./ucb/biff # Extract the file.

  Using the C Shell, /bin/csh:
        % setenv TAPE /dev/nrst0
        % mt fsf 7
        % cd /usr
        % tar xv ./ucb/biff

If you are not sure of the exact path and filename, you can use the t
option to tar, instead of x, to list the table of contents, reposition
the tape at the beginning of the file, cd to the appropriate
directory, and run tar again with x to extract the file.

Tape drives are very slow, it may take a few minutes to complete each
operation.

--
Joe Konczal

============================================================================ From: stanonik@nprdc.navy.mil (Ron Stanonik)

The tape consists of several tape files, each file being a tar of some group of software. So, yes you could mt fsf to the appropriate tape file, then tar x the files you need. But if you need something from the tape because you didn't load a group of software (eg, text), then you can easily load that group by using /usr/etc/install/add_services. If you really want to load just a few files, then first you need to know which file corresponds to which group of software. The second tape file should be a table of contents, but xdr'ed, so you need to pipe it through /usr/etc/install/xdrtec. For example

SunOS 4.1.1 700-2721-10 of Sun Oct 14 16:10:40 PDT 1990 from Sun Release Engineering ARCH sun4 VOLUME 1 Vol File Name Size Type 1 0 boot 49152 image 1 1 XDRTOC 4096 toc 1 2 munix 1065472 image 1 3 munixfs.tape 2150400 image 1 4 mini-root 7168000 image 1 5 root 74349 tarZ 1 6 usr 11460323 tarZ 1 7 Kvm 2816745 tarZ 1 8 Install 459811 tarZ 1 9 Networking 464767 tarZ 1 10 System_V 1895569 tarZ 1 11 Sys 2335322 tarZ 1 12 SunView_Users 1159077 tarZ 1 13 SunView_Demo 196691 tarZ 1 14 Text 348197 tarZ 1 15 Demo 2176733 tarZ 1 16 OpenWindows_Users 11597973 tarZ 1 17 OpenWindows_Demo 2365555 tarZ 1 18 OpenWindows_Fonts 7180689 tarZ 1 19 User_Diag 1606913 tarZ 1 20 Manual 2653983 tarZ 1 21 TLI 22350 tarZ 1 22 RFS 399001 tarZ 1 23 Copyright 1536 image 2 0 XDRTOC 4096 toc 2 1 XDRTOC 4096 toc 2 2 Debugging 1575640 tarZ 2 3 SunView_Programmers 862513 tarZ 2 4 Shlib_Custom 787145 tarZ 2 5 Graphics 837449 tarZ 2 6 uucp 286761 tarZ 2 7 Games 1787801 tarZ 2 8 Versatec 2398103 tarZ 2 9 Security 247665 tarZ 2 10 OpenWindows_Programmers 4684115 tarZ 2 11 Patch_IPC 139264 tarZ 2 12 Patch_C++_2.0 2953216 tarZ 2 13 Patch_TAAC 20480 tarZ 2 14 Copyright 1536 image

What I do then is run a little script to tar t each tape file, so I have a list of everything. For example:

#!/bin/csh -f mt -f /dev/rst0 rew mt -f /dev/nrst0 fsf 5 foreach name (root usr kvm install network sysv sys sv_user sv_demo\ text demo ow_user ow_demo ow_font diag man tli rfs) dd if=/dev/nrst0 bs=126b | uncompress | tar tf - >& tape1/${name}.tar-t end mt -f /dev/rst0 rew

Note, that starting around 4.1.1 the tape files were no longer simply tars, but were also compressed.

Good luck,

Ron Stanonik stanonik@nprdc.navy.mil

============================================================================ From: Kevin Cosgrove <qiclab!solomon!kevinc>

James,

/usr/etc/install/add_services can be used for this purpose.

I've done it; it's easy.

Cheers!

Kevin Cosgrove kevinc@solomon.UUCP

============================================================================ From: tfpoage@ucdavis.edu (Tom Poage)

If the SunOS 4.1 tapes are anything like 3.5, 4.0, etc., you'll find that the tapes have multiple files, something like:

boot executable Table of Contents text copy executable mini-root dd disk image? munix executable ....

Put the write protect on your tapes before you start.

If you

mt -f /dev/nrst8 fsf 1 # forward space file, no rewind. dd if=/dev/rst8 of=./TOC bs=4k # get table of contents

I think you can look directly at the file. However, it may be in XDR format, in which case /usr/etc/install/xdrtoc might be needed.

>From the table of contents, you will then need the installation docs to determine in which of the 15 or so tar archives you file resides, unless you can make an educated guess about where it is.

>From that point, use mt to forward space to the file you want and either pull the tar archive onto the disk with dd or run tar directly off the tape.

Hope this helps.

Tom.

============================================================================ From: Perry_Hutchison.Portland@xerox.com

No problem.

% set fn={tape file number containing the desired program(s)} % set prog=(prog1 prog2 ...) % mt -f /dev/nrst8 asf $fn % dd if=/dev/nrst8 bs=126b | zcat | tar xvfp - $prog

The nuisance is figuring out which tape file contains the desired program(s), and exactly what their tarfile member names are. I have constructed indices of the 4.1.1b tapes which I can send you (193Kb, compressed), or I could look up something in them.

============================================================================ From: bws900@cscgpo.anu.edu.au (Bede W P Seymour)

I'm not sure if extract_files was in sunos4.1, but it is in 4.1.2.

From: geertj@ica.philips.nl (Geert Jan de Groot)

The first few files are boot files, the rest is TAR format, so mt -f /dev/nrst8 fsf 1 tar tvfb /dev/nrst8 20b

should get you going..

Geert Jan

============================================================================ From: IJohnston@cmutual.com.au

Yep it can be done. All the files on the tape are in TAR format except for the boot image (tape file 1) and the table of contents (tape file 2). What you basically have to do is to extract the table of contents using dd into a file. Then use a program called xdrtoc to convert the file into a readable ascii. This will show all the tape files and what they are. The use mt to go to the tape file you want but be sure to use a non-rewinding device name. The use tar to extract the file you want. If you are not sure of the path use the tv options of tar to list the files.

Hope this helps. if you want more specific instructions drop me a line.

Ian Johnston email: IJohnston@cmutual.com.au

============================================================================ From: kalli!kevin@fourx.Aus.Sun.COM (Kevin Sheehan {Consulting Poster Child})

Which includes a couple of speciality files and then some straight tar files. Look at the Table of Contents (you might have to use xdrtoc to get them readable these days) and you'll see what I mean. First file on tape is a copyright, second file is an XDR TOC.

l & h, kev

============================================================================ From: M.Lim@anu.edu.au

Yes there is, It's been a while since I did SunOS 4.1 stuff but from memory, the various modules are stored as a series of tar files on the distribution tapes. So to find a particular file, you have to figure out which module (/, /usr, SunView, etc.) it's in, then find the location of the tar file on the tapes, skip to it using mt and untar it. The layout of the tapes is given in the Installation notes (Appendix ?). There is also a table of contents on the 2 file (I think) of each tape. To read this, you have to skip to it, then run the special program /usr/etc/xdrtoc. This will tell you the exact layout of the tape.

Good luck

Mathew Lim, Unix Systems Programmer, ANU Supercomputer Facility,

============================================================================ From: trdlnk!mike@uunet.UU.NET (Michael Sullivan)

First use /usr/etc/install/xdrtoc to examine the tape's table of contents (I think the table of contents is the first file on the tape, but it's been a long time since I dealt with boot tapes, it might be preceded by a file containing a copyright message, if so skip over the copyright file with mt). Determine from the table of contents which tape file contains the program you need and position the tape to that file with the mt command. Then just extract the desired program from the tape with tar.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:44 CDT