Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Oct 1997 15:15:07 -0800 (PST)
From:      Julian Elischer <julian@whistle.com>
To:        Alfred Perlstein <perlsta@cs.sunyit.edu>
Cc:        Gopakumar H Pillai <gopu@global.com>, hackers@FreeBSD.ORG
Subject:   Re: Help in data recovery
Message-ID:  <Pine.BSF.3.95.971029145727.9219D-100000@current1.whistle.com>
In-Reply-To: <Pine.BSF.3.96.971029173051.6333A-100000@server.local.sunyit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
if it's only 20k then you MAY have some success.
here's what I would do..

dd the entire drive as it stands now, onto a backup medium.
possibly the following might work:
dd if=/dev/rsd0 | gzip |dd of=/dev/rst0

THEN:
try format the drive in exactly the same way you did the first time 
(did you do it after or during install?)
(how long ago?)
(do you rememeber how you did it and what you copied on first?)
did you use "dangerously dedicated mode?" if not then you will probably
recover ALL info.

dd the first 32 K of that to a file somewhere.

restore the saved copy of the original mess, 
(dd if=/dev/nrst0 |gunzip|dd of=/dev/rsd0)
try doing the following:

dd if=[saved 32k] of=/dev/rsd0 count=1

see what that does.

if that works you must have not had 'dangerously dedicated mode'
and you were saved by the fact that there are 63 blocks of unused space
between block 0 and the disklabel.

if you DID use 'dangerously dedicated mode'
then increase the number of blocks you are writing back to 16

this will write on a 'plausible' disklabel.  use fsck -b 32 /dev/rsd1a to
try get a backup superblock.  if that doesn't work, you may need to find
where the next one is.  (you should have gotten a list when you 'newfs'd
the drive in thes earlier step). 

keep increasing the number of blocks by 1 to see if that helps,
and run fsck..

after each iteration restore the image from the tape.

best I can suggest for now..

(alternatively,
you could try:
fdisk -iu /dev/nrst0
and use the figures that are given by fdisk for your other  drive.
that might fix it in one ht (if you didn't do 'dangerously dedicated)


the most important bit is:
MAKE A BACKUP OF YOUR SMASHED DISK IMAGE!
(as shown above)
julian

On Wed, 29 Oct 1997, Alfred Perlstein wrote:

> this doesn't seem trivial because you have overwritten the partition
> imformation on the drive, the only solution i see is if you can find a
> utility for scanning a disk for what could possibly be the begging of a
> partition... i don't know of such a util though...
> 
> anyone?
> 
> 
> On Wed, 29 Oct 1997, Gopakumar H Pillai wrote:
> 
> > I am a sysadmin, fairly new to the job. The OS is FreeBSD 2.2.2. I had a
> > disk sd0s1e of 2GB and sd1s1e of 1GB. In the process of finding out the
> > device name of the tape drive I did a "tar cvf rsd0 /tmp". The amount of
> > data I have written over the raw disk is about 20K. This disk has /usr.
> > I need to retrieve /usr, mainly my mails in /usr/home. How should I go
> > about it?
> > 
> > I retrieved sd1s1e, i.e. /var and got the /var/mail.
> > 
> > I cannot mount or fsck this device since it complains, improper
> > superblock. I have another machine with similar partitioning, would that
> > help?
> > 
> > Also how can I make an exact image of the ruined disk on another one of
> > the same hardware configuration?
> > 
> > -- 
> > --Gopu (gopu@global.com)
> > 
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.971029145727.9219D-100000>