Tuesday, July 02, 2024

Re: fsck similar to boot

On 7/2/24 06:15, 04-psyche.totter@icloud.com wrote:
> Hi all,
> I have removed my second drive away from /etc/fstab and I am now manually mounting it as neede
> I believe this means there is no automatic fsck check ran, and that feels like a bad thing.
> I was thinking I should run the same fsck check when I manually mount my drive.
> How can I manually run a fast fsck check, equal to what is performed at boot time?
> I tried fsck -n and fsck -p but both of these are way too long, whereas the boot check is fast.
> Thanks!
The boot check is fast if the filesystem is marked clean.
This is only true if it has been unmounted in normal operation
or at an orderly shutdown.
A filesystem mounted read-only is normally marked clean.
A filesystem mounted read/write will always need fsck
after a system crash.
fsck can only mark a filesystem clean when it is run on a
filesystem which is not mounted.

I have multi-terabyte filesystems holding music, video, or images which
only change once a month or less.
Those are marked read-only in /etc/fstab.
I mount -u -o rw when needed, then mount -u -o ro when I am done.

This does not work for /usr, /var, /home etc.

Geoff Steckel

No comments:

Post a Comment