Hi All, For what its worth.. if they are devices that are regularly rebooted without proper shutdown,( you may be better off avoiding the situation where FSCK has to run)
I have found As Otto has pointed out fsck and <y> all the way doesn't work so well in some cases. The most risk adverse way I have found for Routers / firewalls in the field was to use mfs memory backed file systems where there are regular changes (/var /tmp) and use default ffs (with noatime mount option ) for everything else, it reduces the probability of FSCK having to run due to a write / incomplete write during loss of power ... in the event of some other issue (hardware failure) well MFS wont help in that case, I hope this helps Peace out Tom Smyth On 18 January 2018 at 11:30, Artturi Alm <[email protected]> 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 >
