[comp.unix.questions] How to put several files on 1 tape

rds95@leah.Albany.Edu (Robert Seals) (07/09/88)

Hi gang,

Here's one... either I'm being real stupid (probably) or something
is strangly missing in Unix tape facilites (gosh).

I want to put several files on a tape, each separated with file marks.

--------------------------------------------------------
|BOT|  file1    |FM|  file2    |FM| .....       |EOT|
---------------------------------------------------------

How?

rob

gwyn@brl-smoke.ARPA (Doug Gwyn ) (07/09/88)

In article <755@leah.Albany.Edu> rds95@leah.Albany.Edu (Robert Seals) writes:
>I want to put several files on a tape, each separated with file marks.

Use the non-rewinding minor device for all but the last file.
E.g.	dd if=file1 of=/dev/rmt12 bs=2k
	dd if=file2 of=/dev/rmt12 bs=2k
...	dd if=fileN of=/dev/rmt8 bs=2k
The exact names for the device depend on your system.

larry@sgistl.SGI.COM (Larry Autry) (07/10/88)

In article <755@leah.Albany.Edu>, rds95@leah.Albany.Edu (Robert Seals) writes:
> 
> Here's one... either I'm being real stupid (probably) or something
> is strangly missing in Unix tape facilites (gosh).
> I want to put several files on a tape, each separated with file marks.
> --------------------------------------------------------
> |BOT|  file1    |FM|  file2    |FM| .....       |EOT|
> ---------------------------------------------------------
> How?
> rob

Using tar, use the norewind tape device driver.  Same with cpio.

tar example
		mt rew
		tar cv2 file.ext
		tar cv2 file2.ext
		tar cv2 file3.ext
		mt rew

To access these files use 'mt fsf n' where 'n' = file number minus one.

cpio example
		mt rew
		cpio -ovh2 file.ext
		cpio -ovh2 file2.ext
		cpio -ovh2 file3.ext
		mt rew

To position these files use 'mt fsf n' where 'n' = file number minus one.
If 'mt' is not available on your system.  Read over the file not needed
with the 't' option instead of the 'x' in 'tar' or the 'i' in 'cpio'.
example		tar tv2
		  or
		cpio ivht2

Then to read the files:	tar xv2
			  or
			cpio -ivhmud2


-- 
					Larry Autry
larry@sgistl.sgi.com
       or
{ucbvax,sun,ames,pyramid,decwrl}!sgi!sgistl!larry

jfh@rpp386.UUCP (John F. Haugh II) (07/10/88)

In article <755@leah.Albany.Edu> rds95@leah.Albany.Edu (Robert Seals) writes:
>Here's one... either I'm being real stupid (probably) or something
>is strangly missing in Unix tape facilites (gosh).
>
>I want to put several files on a tape, each separated with file marks.
>
>--------------------------------------------------------
>|BOT|  file1    |FM|  file2    |FM| .....       |EOT|
>---------------------------------------------------------

you need to use the no-rewind on close device.  you create the first
file using whatever, cp or cat works just fine.  then, after you have
copied the first file, then the tape is closed, you will have a file
with a EOT mark after it.  opening the tape again and copying another
file, without rewind the tape first, should produce a tape with two
files separated by a file mark and ending with an EOT mark.

file marks and EOT marks are just collections of tape marks.  one tape
mark separates a block from the next one.  two tape marks, which produces
a zero lenght block, and in the unix idiom the eof of file, is a file
mark.  three tape marks gives you the EOT mark.

- john.
-- 
John F. Haugh II                 +--------- Cute Chocolate Quote ---------
HASA, "S" Division               | "USENET should not be confused with
UUCP:   killer!rpp386!jfh        |  something that matters, like CHOCOLATE"
DOMAIN: jfh@rpp386.uucp          |             -- with my apologizes