# FreeBSD 6.4 restarting while booting [or after that]



## poni1111 (Jan 9, 2011)

Hello,

I have a box running FreeBSD 6.4. Since 2 months I noticed that it restarts while booting. It restarts usually first 3-4 times I start it [but it is random]. It can be while loading the packages [after initiating the Linux support], or after displaying the "login:" message.

After some tries, I can login and use it, but the problem is that I get HDD errors + I have to wait.

What can I do in order to log+see the error?
Other ideas?

Thank you in advance.


----------



## da1 (Jan 9, 2011)

Some things you can do:

1) Try booting in single user mode
2) Boot the normal install CD and go to rescue mode, mount the partition and read your logs
3) Move the hdd to another FreeBSD machine, boot that machine, and mount the slices from your buggy hdd


----------



## wblock@ (Jan 9, 2011)

A 6.4 machine that is obviously having hard drive problems, maybe memory or power supply problems, or all three...

It's trying to subtly tell you it's about to fail completely.

If there is any data you want to keep, connect the drive to a different machine and back it up.  Use dump(8) if the drive is okay, use dd(1) with conv=noerror,sync if it isn't.  See Backup Options For FreeBSD for some options.


----------



## poni1111 (Jan 9, 2011)

As I understand, it is very probably that it will fail completely.

What are the utilities to check the HDD on FreeBSD?

Thank you very much.


----------



## wblock@ (Jan 9, 2011)

Well, there's fsck(8) and you may have sysutils/smartmontools installed.  But there's not really much useful they can do.  If the hard drive has errors, any further writing or even reading is, at best, not going to make it any worse.  At worst, it might trigger the final failure of the drive.  Swapping the drive to a known-good system would at least make sure RAM and power supply aren't a problem and give you a chance to back it up.  Once you've got everything possible backed up, then you can experiment.  You may find the drive is fine but the power supply was going bad.


----------



## Beastie (Jan 9, 2011)

poni1111 said:
			
		

> utilities to check the HDD on FreeBSD?


You could start by checking SMART attributes using sysutils/smartmontools, especially the reallocated sectors, pending sectors and offline uncorrectable errors.
For the memory, use sysutils/memtest86+. It's available as a kernel-like loadable module and, if I'm not mistaken, as a bootable disc too.


----------

