# Running fsck automatically



## balanga (May 18, 2019)

Should fsck run automatically on boot if the filesystem is marked dirty?

I have the following, which I copied from an old guide, in /etc/rc.conf


```
fsck_y_enable="YES"
background_fsck="NO"
force_fsck="YES"
force_fsck_list="/"
```

but it doesn't seem to work. This is on FreeBSD 11.1-RELEASE armv5.


----------



## Martin Paredes (May 24, 2019)

If your file system is UFS, yes.

check `grep fsck /etc/defaults/rc.conf`



balanga said:


> but it doesn't seem to work.



What is happening and what do you expect to happen with your modifications?


----------



## balanga (May 24, 2019)

I'm running a home built FreeBSD 11.1 on ARM and followed some of the instructions here 

eg *Configure some niceties*


```
echo 'fsck_y_enable="YES"' >> $DESTDIR/etc/rc.conf
echo 'background_fsck="NO"' >> $DESTDIR/etc/rc.conf
echo 'force_fsck="YES"' >> $DESTDIR/etc/rc.conf
echo 'force_fsck_list="/"' >> $DESTDIR/etc/rc.conf
```

I was not aware of the the fsck section in /etc/defaults/rc.conf which also exists in my system.

What happens is that I have to manually run `fsck -y /dev/da0s2a` whenever the the disk is not marked clean.

I'll take out my changes and see if it makes a difference.


----------

