NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Check if file system is clean



Jose Luis Rodriguez Garcia <joseyluis%gmail.com@localhost> writes:

> On Mon, Sep 15, 2025 at 1:36 PM Benny Siegert <bsiegert%gmail.com@localhost> wrote:
>>
>> I would like to run a command to check if a file system is clean,
>> WITHOUT also running fsck on it. Is there a way to do this?

> You can check if it was unmounted cleanly the filesystem: with dumpfs
> and looking for the flag clean.

I read the fsck man page to try to answer and concluded it couldn't be
done, but dumpfs sounds like a great way to chcek.

> But if you want to check if it is clean or consistent you must do a fsck.

Indeed.  For consistent one must run fsck.  And enhance fsck to detect
the kinds of inconsistencies that it might not...

Not that these terms are super well defined, but I think that fsck uses
"clean" to mean "was properly unmounted", such that "fsck -p" will skip
it.

It would be a nice addition to fsck to have a "check if the fs is marked
clean, and quietly return 0 if so and print a message and return 1 if
not".


Home | Main Index | Thread Index | Old Index