# Preventative Maintenance



## jugganaut (Jul 26, 2010)

Hi,

Just got finished recovering a RAID5 setup running 6.2.  After the RAID was back online, I had quite a bit of bad blocks and missing files and other things going on within the file system.

I'm wondering if there are some things that I can do on a weekly or monthly basis to keep the file system in good health.  I'm a newcomer to FreeBSD, so go easy on me.  I'm learning as I go and am planning on building another RAID for backup.  Any pointers are much appreciated!

J


----------



## SirDice (Jul 26, 2010)

If you have bad blocks on disk it would be time to replace the drive. 

If you mean the bad blocks fsck finds those are usually caused by not shutting down cleanly (power failure e.g.). Unless of course you do have physical bad blocks. Normally these shouldn't occur. 

But it probably won't be a bad idea to shutdown the system every now and then. To run a full fsck in single user mode. Unfortunately if you have a lot of storage this can take a _very_ long time.


----------



## DutchDaemon (Jul 26, 2010)

Running sysutils/smartmontools might alert you about impending doom.


----------



## jugganaut (Jul 26, 2010)

Yes, had to replace a drive in the RAID, but it was the bad blocks and missing files and whatnot that fsck found.  RAID is about 4.7TB, so it does take a while for it to scan the whole thing.  A weekly restart would be a good place to start then?

Will checkout smartmontools as well.

Thanks!


----------



## gilinko (Jul 26, 2010)

jugganaut said:
			
		

> Yes, had to replace a drive in the RAID, but it was the bad blocks and missing files and whatnot that fsck found.  RAID is about 4.7TB, so it does take a while for it to scan the whole thing.  A weekly restart would be a good place to start then?
> 
> Will checkout smartmontools as well.
> 
> Thanks!



With that large of a "drive", I would strongly have a look at tools like smartmontools and anything else that either exists in the ports tree or 3rd party tools from the manufacturer. Also check your services for systems that don't play nice with your storage system using samba/nfs et. al.

So go from "preventive maintenance" to "monitored maintenance", as fsck should be used only when the errors are "massive" and not on a regular basis.


----------



## jugganaut (Jul 26, 2010)

Ok, installed Smartmontools, but having a hard time setting up the configuration file.  Is anyone well versed at this program and could lend a helping hand?


----------



## DutchDaemon (Jul 26, 2010)

Have you tried using the default and just having it autoscan? Usually works fine.


----------



## jem (Jul 27, 2010)

Be aware that hard disk vendors are using SMART attributes for completely non-standard purposes these days.  This can cause SMART to give you a false indication that the hard disk is on its way out.

I just installed it on my new box only to find that the heads on these brand new hard disks have been flying for about 2 billion years already.


----------

