LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Crash after power failure (https://www.linuxquestions.org/questions/%2Absd-17/crash-after-power-failure-76589/)

deesto 07-28-2003 09:12 AM

Crash after power failure
 
I have a FreeBSD 5.0-RELEASE machine that was running 24/7 for about a month, hosting my web server. Unfortunately, yesterday our area experiences a series of power outages, one apparently long enough to have drained my UPS, and the BSD machine crashed as a result.
When trying to bring the machine back up, it complained about slices on the primary slave hard drive (which the BIOS detected just fine) as being unavailable or not existing. I booted and logged in as root using the default shell, and 'mount -a' and 'fsck' both complained in the same manner about the drive.
I then rebooted and was presented with the same problems (prompted for default shell, same hard drive unavailable).
What do I need to do in order to recover from the crash?
Thanks,
John

david_ross 07-28-2003 01:23 PM

You could try using "dd" to copy the data onto another drive and accessing the data from there.

I would also reccomend installing some sort of autoshutdown software that will power down your server if this happens again.

jvds 07-28-2003 05:02 PM

Do you the BIOS can't see that hard disk or just FBSD? Does fdisk -l /dev/ad0 show anything?

Rus

deesto 07-28-2003 09:36 PM

Hmm... funny you should ask, because "fdisk -l /dev/ad0" uses an illegal option "l"... if I remember correctly, that stands for "list" in Linux, but does not work in BSD.
At any rate, I fired up the machine to try your suggestion, and I suppose the fourth or fifth time is the 'charm' in my case, because it booted straight into the login prompt--of course, there are a slew of errors reported during the boot, and there's a painfully long delay between when I enter my user name/password and the system moving on to the next step, and it looks like some files may have been damaged in the crash. But I hope these are things I can hack through as I continue to recover the system.
Any suggestions aside from 'fsck -y' are helpful and greatly appreciated.
Thanks!

david_ross 07-29-2003 12:17 PM

To reply to your mail - ti is a while snce I used dd to copy a drive but this should work assuming hda is dead and hdb is the destination:
dd if=/dev/hda of=/dev/hdb

Make sure you unmount any used partitions first.

To make your PC shutdown you will need software that can communicate with your UPS. If it is an apc device then look at:
http://www.apc.com/tools/download/

jvds 07-29-2003 12:40 PM

TBH sounds like the drive is dying...I would put in another and copy of what you can

Rus

deesto 07-29-2003 12:56 PM

Thanks for the advice. I've backed up everything on that drive (which was pretty easy as it's just server data). I thought at first the drive was on the outs as well... but it now seems fine, no more disk errors being reported, the web pages are being served as normal, no signs of ill doing... almost as if the file system was healing itself! What's going on, and how do I learn more about it?

jvds 07-29-2003 12:57 PM

If it was hitting a dogey part of the disk then it could be the disk is on the way ut. Anything in dmesg?

Rus

deesto 07-29-2003 01:11 PM

No, I don't think so, just a message that the filesystems were not properly dismounted (I assume that was during the last boot?), and the following error messages, which are repeated multiple times and which I assume have nothing to do with the hard drive:

dc0: failed to force tx and rx to idle state
psmintr: delay too long; resetting byte count


All times are GMT -5. The time now is 06:16 AM.