*BSD News Article 12174


Return to BSD News archive

Xref: sserve comp.unix.admin:9502 comp.unix.bsd:11608 comp.unix.questions:31841
Newsgroups: comp.unix.admin,comp.unix.bsd,comp.unix.questions
Path: sserve!manuel.anu.edu.au!munnari.oz.au!constellation!osuunx.ucc.okstate.edu!moe.ksu.ksu.edu!crcnis1.unl.edu!wupost!cs.utexas.edu!swrinde!gatech!concert!sas!mozart.unx.sas.com!sherman
From: sherman@unx.sas.com (Chris Sherman)
Subject: Re: help!! tar misuse ate my harddisc??
Sender: news@unx.sas.com (Noter of Newsworthy Events)
Message-ID: <sherman.731218117@bat>
Date: Thu, 4 Mar 1993 04:08:37 GMT
References: <1993Mar2.225448.143@ohsu.edu> <1993Mar3.041124.9340@decuac.dec.com>
Nntp-Posting-Host: bat.unx.sas.com
Organization: SAS Institute Inc.
Lines: 40

In <1993Mar3.041124.9340@decuac.dec.com> darryl@sousa (Darryl Wagoner) writes:

>Milton Hill (hillm@ohsu.edu) wrote:
>: WHAT I DID-
>: I wanted to backup my directory onto another local drive (/dev/sd3c).
>: I issued the command - rainbow# tar -cvf /dev/sd3c /home/rainbow/milt.
>: I remembered that I had a linked directory from dev/sd3c back to 
>: /home/rainbow/milt. (@$%@$#%!!!)

>Oh boy!!!!!!!!!!  tar -cvf /dev/sd3c anything will write a tar file
>all over the hard disk in question!  Not good! Negative Out Come!!!

To the Unix Novices:                            ^^^^^^^^^^^^^^^^^^
                                                This is called an 
						'understatement'.


>: WHAT I WOULD LIKE TO KNOW-
>: 1. Can I salvage the data on the disc?

>Not likely!  
>Some or all of the data will have been wiped out by tar.  
>Never every tar to a disk device!  

Actually, you can tar to a disk, because unix will treat the disk just like
a tape.  You can then walk your disk over to another machine and tar right
back off of it.  In fact, it is probably more efficient because you won't
have the overhead of a 'unix file system' on the disk, so you will be able
to fit more stuff.

But like a tape, when you start writing directly to the disk device, what
ever was there before is _gone_.  Have you ever been able to get stuff
off of the end of a tape when you have smashed the beginning?  It isn't 
easy.

--
     ____/     /     /     __  /    _  _/    ____/
    /         /     /     /   /      /     /          Chris Sherman
   /         ___   /        _/      /          /
 _____/   __/   __/   __/ _\    _____/   _____/           sherman@unx.sas.com