Solved Just to Inform: FILE SYSTEM IS LEFT MARKED AS DIRTY (in a loop after fsck again and again) in FreeBSD 13.2, Fixed with fsck in 14.1

==> This problem is solved as the title reports <==



I have a filesystem that has been corrupted (more details on the end), but I keep running fsck -y in 13.2 but always reports
***** FILE SYSTEM STILL DIRTY *****

***** PLEASE RERUN FSCK *****


This is an iscsi disk. I have tried this on
13.2-RELEASE-p1
(I keep running fsck in a loop nothing happened. The same "Please rerun")

I then attached this to
14.1-RELEASE-p3 FreeBSD 14.1-RELEASE-p3 GENERIC amd64
and an fsck fixed the problem.




on FreeBSD 13.2 I show the fsck:


#fsck_ffs -y /dev/da0p1
** /dev/da0p1
** SU+J Recovering /dev/da0p1
Journal timestamp does not match fs mount time
Skipping journal, falling through to full fsck
** Last Mounted on /zstorage/archive
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
4239 files, 34764423 used, 485250915 free (523 frags, 60656299 blocks, 0.0% fragmentation)

***** FILE SYSTEM STILL DIRTY *****

***** PLEASE RERUN FSCK *****


==> I execute it again with -d (debugging) for more info. Nothing problematic is printed.


# fsck_ffs -d -y /dev/da0p1
** /dev/da0p1
dev_bsize 4096
** SU+J Recovering /dev/da0p1
Journal timestamp does not match fs mount time
Skipping journal, falling through to full fsck
** Last Mounted on /zstorage/archive
** Phase 1 - Check Blocks and Sizes
Pass1: I/O statistics
Running time: 9.898 sec
buffer reads by type:
Cylinder Group: 3355 28.6% 2.484 sec 26.1%
Single Level Indirect: 4886 41.7% 3.164 sec 33.3%
Double Level Indirect: 93 0.7% 0.060 sec 0.6%
Inode Block: 3372 28.8% 3.779 sec 39.8%
Directory Contents: 1 0.0% 0.000 sec 0.0%

** Phase 2 - Check Pathnames
Pass2: I/O statistics
Running time: 0.016 sec
buffer reads by type:
Directory Contents: 59 100.0% 0.016 sec 100.0%

** Phase 3 - Check Connectivity
Pass3: no I/O

** Phase 4 - Check Reference Counts
Pass4: no I/O

** Phase 5 - Check Cyl groups
Pass5: no I/O

4239 files, 34764423 used, 485250915 free (523 frags, 60656299 blocks, 0.0% fragmentation)
cache with 100 buffers missed 5040 of 9407 (53%)
Flush Cylinder groups
Flush indirect, directory, external attribute, and data blocks
Flush inode blocks
Flush the superblock

***** FILE SYSTEM STILL DIRTY *****
Final I/O statistics
Running time: 12.843 sec
buffer reads by type:
Cylinder Group: 3355 28.5% 2.484 sec 26.1%
Single Level Indirect: 4886 41.5% 3.164 sec 33.2%
Double Level Indirect: 93 0.7% 0.060 sec 0.6%
Inode Block: 3372 28.6% 3.779 sec 39.7%
Directory Contents: 60 0.5% 0.017 sec 0.1%


***** PLEASE RERUN FSCK *****

I keep running fsck without any progress.




but on FreeBSD 14.1

Filesystem is not clean - run fsck. Forced mount will invalidate journal contents: Operation not permitted
** /dev/da0p1
** SU+J Recovering /dev/da0p1
Journal timestamp does not match fs mount time
Skipping journal, falling through to full fsck
** Last Mounted on /zstorage/archive
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
4239 files, 34764423 used, 485250915 free (523 frags, 60656299 blocks, 0.0% fragmentation)

***** FILE SYSTEM MARKED CLEAN *****




Concerning the corruption. This is an iscsi disk and I had a script that forcibly detached the disk and killed the iscsi daemon while the disk was in heavy I/O. Some scripts may go rogue and cause chaos...You know when you have hundreths of scripts in crontab, some commands in one script may cause unexpected actions on others.




So my problem was solved by using the latest FreeBSD version.
 
Interesting, thanks.

No mention of a related fix in release notes for 14.0 or 14.1.

Generally, it seems that fsck_ffs-related fixes (a substantial number, since the April 2023 release of 13.2) are not noted.

No I/O, is that normal for those parts of a debug run?
 
I am not familiar with debug mode in fsck, so this can be replied by somebody else. The iscsi disc has many files. Perhaps No I/O means no 'Local I/O' and network iscsi I/O is not counted (?).

Now, I removed also the soft updates in order to simplify the fsck in the future in case anything similar happens again (iscsi forced disconnection).
 
Back
Top