How to write a tar *file* onto (end of)

How to write a tar *file* onto (end of)

Post by David Com » Mon, 22 Jul 2002 17:50:55



====== FIXME: AT LEAST ONCE, do "abbpnews": long-ver WITH CMNTS, ARGS-DOC, ...
====== FIXME: BODY GOES HERE ================

a mag-tape just after
doing a bunch of ufsdumps?

   (No, has *not* yet been rewound -- write-point
   is presumably at the thus-far logical-EOT.

   And "mt ... status" also believes the above to
   be the case.)

(Obviously, *without* harming any the ufsdump-things
that just got written to the tape.)

Thanks,

David

 
 
 

How to write a tar *file* onto (end of)

Post by Mike Delane » Mon, 22 Jul 2002 18:59:11




:  a mag-tape just after
:  doing a bunch of ufsdumps?
:  
:     (No, has *not* yet been rewound -- write-point
:     is presumably at the thus-far logical-EOT.
:    
:     And "mt ... status" also believes the above to
:     be the case.)

The same way you'd write a tar archive to a tape that hasn't just been
used for a ufsdump.  As far as either program is concerned, a tape is
a tape.  Just make sure the tape really is wound to where you think it
is.

--

"...Microsoft follows standards.  In much the same manner that fish follow
migrating caribou." "Now I have this image in my mind of a fish embracing and
extending a caribou." -- Paul Tomblin and Christian Bauernfeind in the SDM

 
 
 

How to write a tar *file* onto (end of)

Post by David Com » Mon, 12 Aug 2002 10:35:28






>:  a mag-tape just after
>:  doing a bunch of ufsdumps?
>:  
>:     (No, has *not* yet been rewound -- write-point
>:     is presumably at the thus-far logical-EOT.
>:    
>:     And "mt ... status" also believes the above to
>:     be the case.)

>The same way you'd write a tar archive to a tape that hasn't just been
>used for a ufsdump.  As far as either program is concerned, a tape is
>a tape.  Just make sure the tape really is wound to where you think it
>is.

OK, thanks.

So, how to *write* something to the tape?

cat foo.gz bar.gz bletch.txt > correctly-positioned-norewind-tape-drive-device ?

(Yes, I know it's a really ignorant question, but
that's how it is at this 1-man shop.)

Thanks,

David

 
 
 

How to write a tar *file* onto (end of)

Post by Dan » Mon, 12 Aug 2002 23:19:32







> >:  a mag-tape just after
> >:  doing a bunch of ufsdumps?
> >:
> >:     (No, has *not* yet been rewound -- write-point
> >:     is presumably at the thus-far logical-EOT.
> >:
> >:     And "mt ... status" also believes the above to
> >:     be the case.)

> >The same way you'd write a tar archive to a tape that hasn't just been
> >used for a ufsdump.  As far as either program is concerned, a tape is
> >a tape.  Just make sure the tape really is wound to where you think it
> >is.

> OK, thanks.

> So, how to *write* something to the tape?

> cat foo.gz bar.gz bletch.txt >

correctly-positioned-norewind-tape-drive-device ?
tar cvf /dev/rmt/0n  foo.gz bar.gz bletch.txt

I don't know version of Solaris you are using, so the device could be wrong
in many ways.

BTW Typically you don't send a file at a time to a tape.  Tapes do NOT have
any direcory structure and so you would have to keep your own list of what
order you put the files to it and then do lots of tape posititoning commands
to get to the "spot" you wanted.

- Show quoted text -

Quote:

> (Yes, I know it's a really ignorant question, but
> that's how it is at this 1-man shop.)

> Thanks,

> David

 
 
 

How to write a tar *file* onto (end of)

Post by Darren Dunha » Wed, 14 Aug 2002 01:04:11



>>The same way you'd write a tar archive to a tape that hasn't just been
>>used for a ufsdump.  As far as either program is concerned, a tape is
>>a tape.  Just make sure the tape really is wound to where you think it
>>is.
> OK, thanks.
> So, how to *write* something to the tape?
> cat foo.gz bar.gz bletch.txt > correctly-positioned-norewind-tape-drive-device ?

Basically.. but..  :-)

Unlike files, tapes tend to be "block-oriented".  They don't properly
handle requests for reads and writes less than the size of a block.
Further, they tend to be much faster at larger sizes.  So you probably
want to "block" the file before writing.  The 'cat' command will likely
write in some block size, but you can't control it.

Also, you can write multiple files to the tape, but how are you going to
retreive them?

cat foo.gz bar.gz bletch.txt > /tmp/tempfile

Now, how do you get the 3 files back?  Generally, you don't.  You'd use
'tar' or 'zip' instead.

Once you just have one file, you can use 'dd' to block it onto the tape,
or if you're using tar, use it instead.

dd if=/my/file of=/dev/rmt/0n bs=64k

I pulled the 64k out of thin air.  You'd want to use the same blocking
figure both on input and output.  

read from tape:
dd if=/dev/rmt/0n of=/tmp/tapefile bs=64k

In general, though, you'd use tar.

tar cbf 128 /dev/rmt/0n foo.gz bar.gz bletch.txt

to read...

cd /tmp; tar xbf 128 /dev/rmt/0n

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

 
 
 

How to write a tar *file* onto (end of)

Post by David Com » Mon, 19 Aug 2002 06:06:07





>>>The same way you'd write a tar archive to a tape that hasn't just been
>>>used for a ufsdump.  As far as either program is concerned, a tape is
>>>a tape.  Just make sure the tape really is wound to where you think it
>>>is.

>> OK, thanks.

>> So, how to *write* something to the tape?

>> cat foo.gz bar.gz bletch.txt > correctly-positioned-norewind-tape-drive-device ?

>Basically.. but..  :-)

>Unlike files, tapes tend to be "block-oriented".  They don't properly
>handle requests for reads and writes less than the size of a block.
>Further, they tend to be much faster at larger sizes.  So you probably
>want to "block" the file before writing.  The 'cat' command will likely
>write in some block size, but you can't control it.

>Also, you can write multiple files to the tape, but how are you going to
>retreive them?

>cat foo.gz bar.gz bletch.txt > /tmp/tempfile

>Now, how do you get the 3 files back?  Generally, you don't.  You'd use
>'tar' or 'zip' instead.

>Once you just have one file, you can use 'dd' to block it onto the tape,
>or if you're using tar, use it instead.

>dd if=/my/file of=/dev/rmt/0n bs=64k

>I pulled the 64k out of thin air.  You'd want to use the same blocking
>figure both on input and output.  

>read from tape:
>dd if=/dev/rmt/0n of=/tmp/tapefile bs=64k

>In general, though, you'd use tar.

>tar cbf 128 /dev/rmt/0n foo.gz bar.gz bletch.txt

>to read...

>cd /tmp; tar xbf 128 /dev/rmt/0n

Thanks!  Good explanations.

So, suppose I want to write a tar tape
to the tape (stuff *about* about a dump
I'm about to do), then I do a bunch of
ufsdumps, then append *another* tar tape
(full of stuff about the dump I actually
accomplished).

So, there's two ways "files" got written
to the tape: however the two tar-files
got written to the tape (via tar itself --
that'd be your advice, I guess), and
the 2nd method is via ufsdump.

So, to get the stuff *off* the tape, I'd
have to *invert* that process, by *remembering*
the order in which I did things to get that
stuff onto the tape, then doing the inverse
thing according to how a given "file" got
there.

Without having those details written-down,
I guess you're lost, no?

---

Just asking hopefully-obvious questions to
make sure that I really do now understand it.

Thanks!

David

 
 
 

How to write a tar *file* onto (end of)

Post by Darren Dunha » Wed, 21 Aug 2002 02:05:36



> So, suppose I want to write a tar tape
> to the tape (stuff *about* about a dump
> I'm about to do), then I do a bunch of
> ufsdumps, then append *another* tar tape
> (full of stuff about the dump I actually
> accomplished).
> So, there's two ways "files" got written
> to the tape: however the two tar-files
> got written to the tape (via tar itself --
> that'd be your advice, I guess), and
> the 2nd method is via ufsdump.
> So, to get the stuff *off* the tape, I'd
> have to *invert* that process, by *remembering*
> the order in which I did things to get that
> stuff onto the tape, then doing the inverse
> thing according to how a given "file" got
> there.
> Without having those details written-down,
> I guess you're lost, no?

Well, you can find the last file on tape without it being written down,
but yes it's more difficult.

That's why all "large" backup solutions include a indexing/cataloging
scheme and some other method of keeping the indexes safe.

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

 
 
 

1. Write End Of File in current file?

If you have a file descriptoryou are lseeking / reading / writing to,
how can you make the current seek point the end of file.  I.E. move the
end of file bak from where it may be (say 10k) down to your current
seek point (say 5k) with another open() and copy etc...

Also, I want to cause my process to re-schedule without a long delay that
sleep(1) would incurr to allow another task tht may be freeing resources that
I need, (the inetd demon).  I.E. what system call, would cause a momentary
block, allowing other tasks on the ready-to-run queue to run??

cs

2. Solution: Using NT 4.0 bootmanager & LILO

3. How to add files onto the end of a tape.

4. How do I get my NIC's driver to load automatically?

5. File locking and data written to the end of a file

6. Dialin agetty

7. writing system boot message onto (test) wtmpx file using perl

8. Ramdisk kernel message

9. How to write image files onto cd-r?

10. How, in sh, to write a file onto tape-drive?

11. How to Install with file ending *.tar

12. Problem with mksysb:tar:Reached end-of-file before expected.

13. tar-question: reached end-of-file before expected ???