Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jan 2002 09:00:36 -0500
From:      Brian T.Schellenberger <bts@babbleon.org>
To:        "Allen May" <allen@daytondigital.net>, <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Hard Drive Crash.. HELP
Message-ID:  <20020128140036.D67DD402A@i8k.babbleon.org>
In-Reply-To: <03d901c1a7f0$ae72e700$0401a8c0@Hewey>
References:  <03a201c1a7bb$50c75c10$0401a8c0@Hewey> <20020128053010.9E446401E@i8k.babbleon.org> <03d901c1a7f0$ae72e700$0401a8c0@Hewey>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 28 January 2002 06:41 am, Allen May wrote:
> Thanks for the good news Brian.

Glad to provide it . . . based on the other question would I be right in 
guessing that whoever initially set you up with FreeBSD is no longer with the 
company?  You probably want to read up on some of this stuff in the handbook 
and what-not besides just following the mailing-list advice.  If I were 
running a company which depended on using FreeBSD I'd want to ensure that I 
had significant in-house expertise . . . of course you are acquiring some now 
in a "trial by fire" way!

> How do you boot into single user mode?

boot -s

at startup time.  Then you can mount all your partitions read-only

(mount -a -o ro)

and from there you should be able to copy the files to someplace safe.

> If I take the hard drive and put it into another machine, whats the syntax
> for mounting an unknown drive?

Well, the device name of the drive will be in the startup messges.  It'll be 
something like at ata3 or sda3 or something like that, and the "rest" of it 
will be the same as it is in the current machine, so you'd mount it like, say,

# mkdir /recover
# mkdir /recover/usr
# mount /dev/ata5s2b /recover/usr

The exact details of course depend on what type of disk, how it's 
partitioned, and all that.

> If I can get the data off the box, how do I rebuild the box with a new hard
> drive? Do I just copy the entire contents of the bad drive to the new drive
> the remove the bad drive?

Well, that depends on how you backed it up and all that.  When I did this, I 
used pax to copy all of the non-system files (the ones that I altered); then 
I did a regular FreeBSD install, and then I copied my files back.

It's also possible to use dd to just pull the bits off of the drive and then 
use dd to make an exact image, but this will only work if you replace it with 
an identical drive and of course in this case you must put the drive in 
another system since you won't have an O/S to do the copy until after you've 
done the copy, if you see what I mean.

If this works, this approach is the fastest & easiest, but speaking 
personally it makes me nervous.  Also, if there is any read error while 
making the disk image, you are dead.

So the safer approach is what I did, which is to just back up the files (that 
you mess with [or just all the files other than /var and /tmp if you want), 
install FreeBSD on the new disk, and then restore the files from backup, just 
like you would for any other system failure.

And of course please remember that it's only PROBABLY good news: it's quite 
possible that once you get it mounted read/only you'll find that the disk is 
having some read failures as well.  But let's hope for the best instead.


>
> Thanks for your help.

You're welcome.  Good luck.

>
> -Allen
>
> ----- Original Message -----
> From: "Brian T.Schellenberger" <bts@babbleon.org>
> To: "Allen May" <allen@daytondigital.net>; <freebsd-questions@FreeBSD.ORG>
> Sent: Monday, January 28, 2002 12:30 AM
> Subject: Re: Hard Drive Crash.. HELP
>
> > On Monday 28 January 2002 12:19 am, Allen May wrote:
> > > One of our mail servers just went belly up.
> > > The hard drive crashed. It's a FreeBSD 4.4 machine.
> > >
> > > We can boot to the install floppies and see that the partition table is
> > > still intact. It won't boot (see console errors below).
> > >
> > > Is there any way we can recover this drive's data?
> >
> > You are in luck, most likely: these are all *write* errors.  I had a
> > drive
>

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?20020128140036.D67DD402A>