# Single user mode fsck not working



## cArleone (Oct 17, 2019)

FSCK mode is not working.
1- When we run single user mode, am i fsck run?
2 - When os starting with single user mode am i run auto shell script?
3 - I want when os starting run disk repair mode.
Thank you, best!
rc.conf : 

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


----------



## SirDice (Oct 18, 2019)

Do you actually use UFS? If you use ZFS then you cannot use fsck(8) on it, it has its own cleanup and filesystem checks.


----------



## cArleone (Oct 19, 2019)

yes I use ufs format

we create script if disk fails automaticly run script

script.sh file in codes : 
fsck -y -f /dev/ada0s1a 

can I do this ? 

because freebsd dont cleanup filesystem checks automaticly


----------



## gpw928 (Oct 21, 2019)

cArleone said:


> can I do this ?


There's not enough context to be sure of what you intend, but I expect that the answer is no. 
Ufs file systems are marked dirty when they are mounted, and marked clean when they are unmounted (so a crash will leave the dirty flag set).
During boot, the rc script (/etc/rc.d/fsck) does a quick check of each file system, and won't allow a multi-user boot if any file system has anything more than trivial fixable damage.
Trying to force a full fsck when a file system is mounted is not going to work because repairing a seriously damaged file system requires that file system to be unmounted.
FreeBSD manages file system integrity quite well, all by itself.  It does not normally need any additional help.  I suspect that your premise is unfounded.
[I can't find any evidence that `force_fsck="YES"` in /etc/rc.conf will do anything at all.]


----------

