# fsck during FreeBSD startup



## ccc (Jan 26, 2011)

hi

Is it possible to configure FreeBSD to do fsck during startup automatically? For example if filesystem is not clean after crash? It is a bit laborious to do it manually in a "single-user" mode with other keyboard settings using fsck command:


```
fsck -f -y /dev/ad0s1d
```

BTW on linux is really easy:


```
# shutdown -F -r now
```


----------



## SirDice (Jan 26, 2011)

ccc said:
			
		

> Is it possible to configure freeBSD to do fsck during startup automatically?
> For example if Filesystem is not clean after crash?


It will always do a fsck after a crash. When a crash happens (or it gets turned off) the filesystems are marked "dirty". When the system boots it will always fsck dirty filesystems.



> BTW on linux is really easy:
> 
> 
> 
> ...



And the difference is?

`# shutdown -r now`
Or
`# reboot`


----------



## DutchDaemon (Jan 26, 2011)

Set 
	
	



```
fsck_y_enable="YES"
```
 in /etc/rc.conf. By default it's set to "NO", which means you'll have to run it manually when the automatic fsck fails.


----------



## ccc (Jan 26, 2011)

dutchdaemon said:
			
		

> set
> 
> 
> 
> ...



thx


----------



## olegrpg (Feb 1, 2011)

i use 

```
fsck_y_enable="YES"
background_fsck="NO"
```


----------

