Bug 246962 - fsck_ffs frequently requires multiple runs
Summary: fsck_ffs frequently requires multiple runs
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-03 16:54 UTC by Mark Johnston
Modified: 2020-10-29 08:15 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer 2020-06-03 16:54:39 UTC
I use a FreeBSD HEAD VM for development, with SU (no journaling) on the root FS.  It panics frequently, and often drops me off in single user mode after fsck_ffs returns a non-zero exit status:

--
Starting file system checks:
/dev/gpt/rootfs: INCORRECT BLOCK COUNT I=330657 (8 should be 0) (CORRECTED)            
/dev/gpt/rootfs: INCORRECT BLOCK COUNT I=330658 (8 should be 0) (CORRECTED)            
/dev/gpt/rootfs: INCORRECT BLOCK COUNT I=330660 (8 should be 0) (CORRECTED)            
/dev/gpt/rootfs: INCORRECT BLOCK COUNT I=330661 (8 should be 0) (CORRECTED)
/dev/gpt/rootfs: INCORRECT BLOCK COUNT I=330665 (8 should be 0) (CORRECTED)                                                                                                   
/dev/gpt/rootfs: INCORRECT BLOCK COUNT I=330666 (16 should be 0) (CORRECTED)
...
/dev/gpt/rootfs: ZERO LENGTH DIR I=727410  OWNER=root MODE=41777                       
/dev/gpt/rootfs: SIZE=0 MTIME=Jun  3 11:00 2020                                        
 (CLEARED)                                                                                                                                                                    
/dev/gpt/rootfs: FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)                                                                                                               
/dev/gpt/rootfs: SUMMARY INFORMATION BAD (SALVAGED)                                    
/dev/gpt/rootfs: BLK(S) MISSING IN BIT MAPS (SALVAGED)                                 
/dev/gpt/rootfs: 51340 files, 1475643 used, 3343995 free (5475 frags, 417315 blocks, 0.1% fragmentation)
                                                                                       
***** PLEASE RERUN FSCK *****                                                          
WARNING: /: reload pending error: blocks 184 files 8                                   
Automatic file system check failed; help!                                              
ERROR: ABORTING BOOT (sending SIGTERM to parent)!                                      
2020-06-03T08:15:42.153887-04:00  init 1 - - /bin/sh on /etc/rc terminated abnormally, going to single user mode
--

Then, running fsck_ffs again returns with no errors:

--
root@:/ # fsck_ffs -y /                                                                                                                                                       
** /dev/gpt/rootfs                                                                     
** Last Mounted on /                                                                   
** Root file system                                                                    
** Phase 1 - Check Blocks and Sizes                                                    
** Phase 2 - Check Pathnames                                                           
** Phase 3 - Check Connectivity                                                        
** Phase 4 - Check Reference Counts                                                    
** Phase 5 - Check Cyl groups                                                          
51340 files, 1475643 used, 3343995 free (5475 frags, 417315 blocks, 0.1% fragmentation)
                                                                                       
***** FILE SYSTEM MARKED CLEAN *****                                           
<boot continues>
--

Why does fsck_ffs require a restart here?  I know that there is some rc.conf variable I can set to work around this, but it looks like it shouldn't be necessary to begin with.