# FreeBSD kernel and HDD/CF error detection



## m4rtin (Mar 21, 2012)

As lot of you probably know, Juniper routers use modified _FreeBSD_ kernel. According to one Juniper related book: 


```
The kernel is intelligent enough to recognize storage media problems both with the HDD and compact flash problems.
```

Is such feature built into FreeBSD kernel? While HDD errors can be detected by SMART data, then CF does not support SMART..I mean how does kernel detect such problems? I guess those are detected if write or read errors to/from certain cluster occur? :OOO


----------



## SirDice (Mar 21, 2012)

m4rtin said:
			
		

> I guess those are detected if write or read errors to/from certain cluster occur? :OOO


Yes. SMART data is not used. You need to install sysutils/smartmontools if you want those.


----------



## m4rtin (Mar 22, 2012)

SirDice said:
			
		

> Yes. SMART data is not used. You need to install sysutils/smartmontools if you want those.



*O*k, so this means that in rare cases the problem might be with the file system (UFS) not with the physical media itself? And does the FreeBSD kernel write to /var/log/messages file if a read/write error to the file system cluster occurs (correct me if I'm wrong, but technically this should mean if open]/man] system call fails)? :OOO(2)


----------



## SirDice (Mar 22, 2012)

Physical errors (bad sectors for example) would show up like in [thread=21973]this thread[/thread]. SMART reads the drive's parameters and can inform you the drive is likely to fail in the near future.


----------



## m4rtin (Mar 22, 2012)

SirDice said:
			
		

> Physical errors (bad sectors for example) would show up like in [thread=21973]this thread[/thread]. SMART reads the drive's parameters and can inform you the drive is likely to fail in the near future.



*O*k  So probably there is something listening 
	
	



```
"FAILURE - READ_DMA"
```
 and 
	
	



```
"FAILURE - WRITE_DMA"
```
 errors by kernel.


----------

