# How do I deal with frequent unclean shutdowns?



## fiftyone (Aug 31, 2009)

Hello. This is my problem. 
I have FreeBSD 7 on a 5 year old laptop. It actually works pretty well but it has no battery and occasionally for whatever reason it shuts itself down. Just out of the blue like someone pulled the plug. It's obviously some hardware malfunction.

Since I installed FreeBSD a few weeks ago the computer has crashed on me at least a dozen times. Usually init runs and fixes whatever went wrong but the last 2 or 3 times I has complete OS failure where the OS wouldn't even boot and I had to completely re-install. I can deal with the frequent crashes but I am hoping that there is a way I can protect my OS from being destroyed.

To give you an example of what I am hoping to accomplish here... When I was running an XP box I had a program called "Deep Freeze" no matter what you did to the OS while it was running, install 1,000 viruses, delete system files, whatever as soon as you reboot everything goes back to the "frozen" state. 

So, basically, I would like to set my system up so that in the event that one of these random shutdowns destroys some vital part of my OS I can rescue it somehow with (hopefully) minimal effort. 

Thanks a lot !


----------



## caesius (Aug 31, 2009)

I doubt the complete reinstallations where needed. You probably could have run 
	
	



```
fsck
```
 and you would have been able to boot cleanly.


----------



## fiftyone (Aug 31, 2009)

actually, i tried. I booted from the install CD into an emergency shell and i couldn't even locate the partitions. I also loaded up knoppix and again all of my partitions were gone. Completely wiped out. All I was left with was a 100gb unallocated gray space. never happened to me before, but like I said the hardware is defective and its old.


----------



## caesius (Aug 31, 2009)

fiftyone said:
			
		

> actually, i tried. I booted from the install CD into an emergency shell and i couldn't even locate the partitions. I also loaded up knoppix and again all of my partitions were gone. Completely wiped out. All I was left with was a 100gb unallocated gray space. never happened to me before, but like I said the hardware is defective and its old.



The gray space you were talking about probably still had all of your data, just that the disk software didn't understand seeing a ufs partition.

Did you try booting in single user mode? What happened after you ran fsck manually?


----------

