On 2018/01/18 13:30, Artturi Alm wrote:
> On Thu, Jan 18, 2018 at 12:13:54PM +0100, Otto Moerbeek wrote:
> > On Thu, Jan 18, 2018 at 12:12:39PM +0200, Artturi Alm wrote:
> > 
> > > Hi,
> > > 
> > > i think i've never answered "n" to fsck, so to me the lack of -y does
> > > mean unnecessary work/boards/VMs left waiting for the F..
> > > 
> > > i would use something like this if it was there:
> > > 
> > > diff --git a/etc/rc b/etc/rc
> > > index c88e13ce7ab..e3a269be818 100644
> > > --- a/etc/rc
> > > +++ b/etc/rc
> > > @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
> > >   echo "Fast boot: skipping disk checks."
> > >  elif [[ $1 == autoboot ]]; then
> > >   echo "Automatic boot in progress: starting file system checks."
> > > - do_fsck
> > > + if [[ -e /failboot ]]; then
> > > +         do_fsck
> > > + else
> > > +         do_fsck -y
> > > + fi
> > >  fi
> > >  
> > >  # From now on, allow user to interrupt (^C) the boot process.
> > > 
> > > 
> > > but the one below is what i believe should fit&go w/modern sane defaults
> > > (think terabytes).
> > > no man page diffs, as i guess this won't fly (w/o bikeshedding atleast).
> > > -Artturi
> > > 
> > > 
> > > diff --git a/etc/rc b/etc/rc
> > > index c88e13ce7ab..e3a269be818 100644
> > > --- a/etc/rc
> > > +++ b/etc/rc
> > > @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
> > >   echo "Fast boot: skipping disk checks."
> > >  elif [[ $1 == autoboot ]]; then
> > >   echo "Automatic boot in progress: starting file system checks."
> > > - do_fsck
> > > + if [[ -e /failboot ]]; then
> > > +         do_fsck
> > > + else
> > > +         do_fsck -y
> > > + fi
> > >  fi
> > >  
> > >  # From now on, allow user to interrupt (^C) the boot process.
> > 
> > This has come up before and is not ok.
> > It is dangerous becuase it might make things worse.
> > 
> > I want to have a chanche to e.g. save an image or chack cabling.
> > 
> > Again, no.
> > 
> >     -Otto
> 
> Ok, anyway the first diff was supposed to be this:
> 
> diff --git a/etc/rc b/etc/rc
> index c88e13ce7ab..c8a25da7b42 100644
> --- a/etc/rc
> +++ b/etc/rc
> @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
>       echo "Fast boot: skipping disk checks."
>  elif [[ $1 == autoboot ]]; then
>       echo "Automatic boot in progress: starting file system checks."
> -     do_fsck
> +     if [[ -e /forceboot ]]; then
> +             do_fsck -y
> +     else
> +             do_fsck
> +     fi
>  fi
>  
>  # From now on, allow user to interrupt (^C) the boot process.
> 
> 
> so only giving user the choice of not editing /etc/rc.
> fwiw. i heard FreeBSD has variable named "fsck_y_enable",
> but i'm useless w/shell scripts, so i chose above..
> -Artturi
> 

A flag (fsck_flags) would be a better idea than a file, and more
flexible (users with many disks and low RAM could use the same
mechanism to force "-l 1" for example).

But the number of times fsck -y has come up and been rejected
already, I don't think anything making it easier is likely to be
accepted.

On those machines without out-of-band console where I want the
"I don't care if this system shoots itself in the foot because I'll
have to drive to fix it whichever way it fails" mode, I just edit
/etc/rc...

Reply via email to