# New way of doing fsck on bootup in FreeBSD 9?



## rusma (Jul 18, 2012)

Hello. 

What is the new way of doing a (forced non-background) fsck on bootup? 

In FreeBSD 8 I had these lines in my /etc/rc.conf:
	
	



```
fsck_y_enable="YES"
background_fsck="NO"
force_fsck="YES"
force_fsck_list="/"
```
In FreeBSD 9 the bootup process seems to skip these. I am asking because I am running FreeBSD/arm on the Marvell Sheevaplug (SHEEVAPLUG).


----------



## wblock@ (Jul 18, 2012)

That's not different, but UFS in FreeBSD 9 has soft updates journaling, which can make fsck(8) go very quickly.  Check the output of
`% dmesg -a`


----------



## rusma (Jul 19, 2012)

I checked `# dmesg -a`just now:

```
da0: 40.000MB/s transfers
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: <WDC WD16 00AAJB-00J3A0 > Fixed Direct Access SCSI-2 device 
da0: 40.000MB/s transfers
da0: 152627MB (312581808 512 byte sectors: 255H 63S/T 19457C)
Trying to mount root from ufs:/dev/ufs/kirkwoodroot
Setting hostuuid: a4f4a19f-d127-11e1-bd90-025043b66e4f.
Setting hostid: 0x2dd4dc6a.
Entropy harvesting:
 interrupts
 ethernet
 point_to_point
 kickstart
.
Starting file system checks:
Mounting local file systems:
.
Adding /usr/swap0 as additional swap
Setting hostname: frodo.flat.home
.
```
Also, I'm getting all kinds of strange compile time errors after upgrading to RELENG_9 and this old IDE HDD; error code 1 when building ports (e.g. www/nginx), and complex errors when building world. I'm not sure if this is the disk or, 9, or bad luck. I'll make a new thread on this.


----------



## wblock@ (Jul 19, 2012)

The freebsd-arm mailing list is a good resource.


----------



## mworld (Aug 9, 2012)

Here's my solution for FreeBSD 9 to force fsck at boot.


```
--- /etc/rc.d/fsck.orig 2012-08-09 15:44:34.000000000 +1000
+++ /etc/rc.d/fsck      2012-08-09 15:38:54.000000000 +1000
@@ -27,7 +27,15 @@
                if checkyesno background_fsck; then
                        fsck -F -p
                else
-                       fsck -p
+                       if checkyesno force_fsck; then
+                               if checkyesno fsck_y_enable; then
+                                       fsck -Ff -y ${fsck_y_flags}
+                               else
+                                       fsck -Ff
+                               fi
+                       else
+                               fsck -p
+                       fi
                fi

                case $? in
```

and in /etc/rc.conf


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


----------

