On 2024-05-21, Nick Holland <n...@holland-consulting.net> wrote:
> On 5/20/24 09:37, Jan Stary wrote:
>> On May 20 13:22:26, mikyde...@yahoo.fr wrote:
>>> Hello,
>>> 
>>> I have two use cases and problems with fsck.
>>> 
>>> 1) When my openbsd boots after an outage, the system asks me to fsck /, 
>>> /usr, /var or /home manually.
>>> So I do
>>> fsck /dev/sd0a
>>> And then I'm asked questions and I usually answer F
>>> 
>>> So my question is that I want this process to be done automatically at boot 
>>> time for each partition that has a problem.
>> 
>> The /etc/rc boot script calls fsck -p;
>> if that fails, it means fsck -p was unable to fix a major problem.
>> It is the point that it requires an admin's intervention.
>> 
>> You would have to change the fsck call to fsck -y;
>> but don't do that.

AIUI the rationale for not using -y by default is that fsck may do
further damage to a badly damaged disk. But in practice many people
wouldn't do anything other than hit 'y' lots or 'F' when fsck
complains, in which case patching /etc/rc to run -y by default
isn't going to be any worse... And there are certainly some classes
of system where you don't really care about losing data (i.e. you
can recreate from config management or backups) but you do want to
maximise the chances of being able to connect in remotely, and in
that case -y can definitely help.

> I'd look at why your file systems are always needing these manual
> interventions after a hard shutdown.  I routinely power down my
> personal systems with yanking the power cord if it would take me
> longer "properly" connect a console and properly shut down.

That really depends on what the system is doing.

>>> When I remove that disk the boot sequence stops and asks for a fsck
>>> I would like that this disk is mounted when it's present, but when it's not 
>>> installed I don't want the boot sequence to stop
>> 
>> Make it also "noauto" in fstab and mount it in rc.local.
>
> Last I tried this, it didn't do what I wanted -- "noauto" still expects
> to have the disk there and will fsck it on boot.  Failure to be able to
> do this stops the boot.  It's been a while since I last tried this, so
> perhaps something has changed (including my recollection?)

See fstab(5) about fs_passno.

> And this might be a solution for the OP's problem:
> make /usr and /usr/* "ro" during normal operation

reorder_kernel is run in the background from /etc/rc; for RO /usr
you need to wait for that to finish.

-- 
Please keep replies on the mailing list.

Reply via email to