Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jan 2002 00:18:55 -0500
From:      Brian T.Schellenberger <bts@babbleon.org>
To:        "Christopher J. Umina" <FJU@Fritzilldo.com>, <questions@FreeBSD.ORG>
Subject:   Re: NewFS
Message-ID:  <01b892219051012FE4@mail4.nc.rr.com>
In-Reply-To: <009801c19e48$560f9420$0301a8c0@uminafamily.com>
References:  <009801c19e48$560f9420$0301a8c0@uminafamily.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 15 January 2002 11:43 pm, Christopher J. Umina wrote:
> Hey guys,
>
>     I just ran newfs on two mounted drives by mistake (ad0 and ad1 instead
> of da0 and da1) and I can't use the data on the disks anymore.  The return
> of the df command shows that the space on those drives is taken up the same
> as before, but when I try to use it it says bad file descriptor.  I ran
> fsck and fsck -y on one of them but they didn't seem to do anything.  I
> also ran disklabel on the same one that I ran the fscks on and I cannot use
> the data still.  The one I used the fscks on I can cd into and I can see
> the directores that were originally in there, but I can't cd to them.  Is
> there any way in the world to fix this?  I really would love that data
> back.

No, that's a pretty deadly thing to do, I fear.  Though I thought that newfs 
complained about mounted systems - ?  If it doesn't, it most certainly ought 
to.  (But I don't feel like trying it to find out!)

Hope you have recent backups.

The glimmerings of "stuff" that you see is just from commands that have 
cached the previous state of the disk parition into memory, most likely.  
What's out there now won't be likely to have recoverable data.  That said, 
newfs doesn't actually wipe every byte of data so you could get some bits 
back, but it pretty much destroys every last piece of file system information.
* (Unless you were somehow lucky enough to use different superblock offsets 
for the two filesystems.  In that case it might be possible to recover a bit 
more.)

My advice: never use newfs directly except under really unusual 
circumstances.  If you need to do it with any regularity it's best to create 
an alias / shell script / op command to do it in the correct way so you 
aren't subject the effects of disastrous typos like this.

Hope somebody else with serious wizardy knowledge has some better news for 
you.



>
> Christopher J. Umina

-- 
Brian T. Schellenberger . . . . . . .   bts@wnt.sas.com (work)
Brian, the man from Babble-On . . . .   bts@babbleon.org (personal)
                                        http://www.babbleon.org

-------> Free Dmitry Sklyarov!  (let him go home)  <-----------

http://www.eff.org                 http://www.programming-freedom.org 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01b892219051012FE4>