interrupt or cancel file system check at boot, occasionally only

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

interrupt or cancel file system check at boot, occasionally only

Istvan Gabor-2
Hello:

I have openSUSE 11.2 with several partitions.
At every Nth mount fsck checks a given partition, which takes
a long time. Sometimes I do need the computer quickly and don't want
to wait until fsck finishes. Is there an option that makes possible
to interrupt or cancel file system checking during boot so that the checking
would be completed at the next boot? I don't want to disable it or
change the max count, I just want occasionally bypass checking at
boot. I tried to interrupt fsck by pressing ctrl+c but it
resulted in a not normal boot, many partitions were not mounted.

I also googled but did not find anything helpful.

Thanks,

Istvan



--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

zGreenfelder
On Tue, Dec 20, 2011 at 1:59 PM, Istvan Gabor <[hidden email]> wrote:

> Hello:
>
> I have openSUSE 11.2 with several partitions.
> At every Nth mount fsck checks a given partition, which takes
> a long time. Sometimes I do need the computer quickly and don't want
> to wait until fsck finishes. Is there an option that makes possible
> to interrupt or cancel file system checking during boot so that the checking
> would be completed at the next boot? I don't want to disable it or
> change the max count, I just want occasionally bypass checking at
> boot. I tried to interrupt fsck by pressing ctrl+c but it
> resulted in a not normal boot, many partitions were not mounted.
>
> I also googled but did not find anything helpful.
>
> Thanks,
>
> Istvan

I can't think of a reasonable way to interrupt the fsck, but you could
try tune2fs to change the number of times the FS is mounted before
requiring a check (see tune2fs man page or google around)

all of this should bear the standard caveats; I assume you're using
ext4 and it's going out of standard, etc.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

James Knott
zGreenfelder wrote:
> I can't think of a reasonable way to interrupt the fsck, but you could
> try tune2fs to change the number of times the FS is mounted before
> requiring a check (see tune2fs man page or google around)

I seem to recall reading years ago, that if you have mulitple
partitions, you could use different numbers so that you're less likely
to have them running fsck at the same time.  You could even use prime
numbers to reduce the chances of doing multiple partitions at the same time.

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

Thomas Hertweck
In reply to this post by Istvan Gabor-2


On 20/12/11 18:59, Istvan Gabor wrote:
> I have openSUSE 11.2 with several partitions.
> At every Nth mount fsck checks a given partition, which takes
> a long time. Sometimes I do need the computer quickly and don't want
> to wait until fsck finishes. Is there an option that makes possible
> to interrupt or cancel file system checking during boot so that the checking
> would be completed at the next boot? I don't want to disable it or
> change the max count, I just want occasionally bypass checking at
> boot. I tried to interrupt fsck by pressing ctrl+c but it
> resulted in a not normal boot, many partitions were not mounted.

Append "fastboot" as boot parameter when the grub menu shows up.

Thomas
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

Anton Aylward-2
In reply to this post by Istvan Gabor-2
Istvan Gabor said the following on 12/20/2011 01:59 PM:
> At every Nth mount fsck checks a given partition, which takes
> a long time.

fsck is &not* linear with the size of a file system but a function of
the power (square) or the size.

So a 4G FS will take longer to process than two 2G FS.
Also the 2 file systems will be able to the fsck'd in parallel :-)
You might also consider a setup where the 2 FS are _not_  fsck'd
together: both have the same N but are spaced apart by M.



--
quidquid latine dictum sit, altum viditur.
(Whatever is said in Latin sounds profound.)
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionallyonly

Istvan Gabor-2
2011. december 20. 21:46 napon Anton Aylward <[hidden email]> írta:

> Istvan Gabor said the following on 12/20/2011 01:59 PM:
> > At every Nth mount fsck checks a given partition, which takes
> > a long time.
>
> fsck is &not* linear with the size of a file system but a function of
> the power (square) or the size.
>
> So a 4G FS will take longer to process than two 2G FS.
> Also the 2 file systems will be able to the fsck'd in parallel :-)
> You might also consider a setup where the 2 FS are _not_  fsck'd
> together: both have the same N but are spaced apart by M.

Thank you all for your responses.

From the answers it seems I haven't explained clearly
what I wanted. I don't have any problem with file system
checking at boot, I think it is good. Therefore I don't
want to change the change max-mount-counts (number).

My problem is that occasionally I do not have the time
to wait until fsck stops checking even one partition
(eg is takes 5 minutes but I need to use the system within
a minute). As I am not following the partitions' mount counts
I don't know in advance whether a partition will be checked
or not, when I start the system. When I see that
fsck already started to check the filesystem I'd like to press
a button (eg escape) which signals to the system that I want to
cancel or interrupt checking and continue with the next step in the
boot process. Is it possible? If not, it should be implemented.

Thomas, is the 'fastboot' option you mentioned related to
the "doing fast boot"  message shown at the beginning of boot?

Thanks,

Istvan


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionallyonly

James Knott
Istvan Gabor wrote:
> My problem is that occasionally I do not have the time
> to wait until fsck stops checking even one partition
> (eg is takes 5 minutes but I need to use the system within
> a minute).

What file system are you using?  IIRC, with journaled file systems, fsck
doesn't scan a disc, unless there's a problem.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionallyonly

Thomas Hertweck
In reply to this post by Istvan Gabor-2


On 20/12/11 21:51, Istvan Gabor wrote:
> Thomas, is the 'fastboot' option you mentioned related to
> the "doing fast boot"  message shown at the beginning of boot?

Please check /etc/init.d/boot and /etc/init.d/boot.rootfsck or
/etc/init.d/boot.localfs, respectively, if you are interested in the
details. These are the names of the files on my 11.4 but 11.2 will
probably be identical.

----> /etc/init.d/boot
[...]
DO_FASTBOOT=no
[...]
if rc_cmdline fastboot > /dev/null  || test -e /fastboot  ; then
    DO_FASTBOOT=yes
fi
[...]

This means, if the kernel command line contains a "fastboot" parameter or
if there exists a file /fastboot in the root filesystem, then no regular
filesystem check will be performed for this particular system startup as
you can see in the other two boot scripts. The file /fastboot will be
removed by boot.localfs, i.e. the fsck will only be skipped for the
current startup:

[...]
        #
        # clean up
        #
        rm -f /etc/nologin /nologin /fastboot /forcefsck /succes
[...]

You can check the used kernel command line via "cat /proc/cmdline" once
the system is up. As far as I can see, this is exactly the feature you
were looking for. Just add "fastboot" to the kernel command line when you
need it and regular filesystem checks will be skipped.

Thomas
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

Carlos E. R.-2
In reply to this post by Istvan Gabor-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2011-12-20 19:59, Istvan Gabor wrote:

> change the max count, I just want occasionally bypass checking at
> boot. I tried to interrupt fsck by pressing ctrl+c but it
> resulted in a not normal boot, many partitions were not mounted.

An interesting feature to request for 12.2  :-)

- --
Cheers / Saludos,

                Carlos E. R.
                (from 11.4 x86_64 "Celadon" at Telcontar)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iEYEARECAAYFAk7xGqkACgkQtTMYHG2NR9VvdQCgjekxQZZa6uPEC2m6CvoP9QLx
RDoAmwYlqR8xssNapjVLvwgM7d45eHky
=u/QO
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionallyonly

Brian K. White
In reply to this post by Istvan Gabor-2
On 12/20/2011 4:51 PM, Istvan Gabor wrote:

> 2011. december 20. 21:46 napon Anton Aylward<[hidden email]>  írta:
>
>> Istvan Gabor said the following on 12/20/2011 01:59 PM:
>>> At every Nth mount fsck checks a given partition, which takes
>>> a long time.
>>
>> fsck is&not* linear with the size of a file system but a function of
>> the power (square) or the size.
>>
>> So a 4G FS will take longer to process than two 2G FS.
>> Also the 2 file systems will be able to the fsck'd in parallel :-)
>> You might also consider a setup where the 2 FS are _not_  fsck'd
>> together: both have the same N but are spaced apart by M.
>
> Thank you all for your responses.
>
>  From the answers it seems I haven't explained clearly
> what I wanted. I don't have any problem with file system
> checking at boot, I think it is good. Therefore I don't
> want to change the change max-mount-counts (number).
>
> My problem is that occasionally I do not have the time
> to wait until fsck stops checking even one partition
> (eg is takes 5 minutes but I need to use the system within
> a minute). As I am not following the partitions' mount counts
> I don't know in advance whether a partition will be checked
> or not, when I start the system. When I see that
> fsck already started to check the filesystem I'd like to press
> a button (eg escape) which signals to the system that I want to
> cancel or interrupt checking and continue with the next step in the
> boot process. Is it possible? If not, it should be implemented.
>
> Thomas, is the 'fastboot' option you mentioned related to
> the "doing fast boot"  message shown at the beginning of boot?
>
> Thanks,
>
> Istvan


I think your best option is to:

* make sure all large fs's are journaling (reiserfs, ext4, etc)

* drastically increase or disable altogether the periodic boot time
scanning (not disabling the fsk if the fs is found to be dirty at boot)

* manually fsck once in a while if you like.

Because you can't predict when you will want to boot and run as fast as
possible, and those times are _exactly_ the times you _don't_ want to
have to futz with special boot prompt parameters.

You could also make a menu.lst stanza that just has fastboot added to it.

That way you could boot up fast without having to stop and enter special
boot prompt options. Just select the fastboot entry instead of the
regular entry.

fsck does process interrupt signals gracefully. You could possibly
modify the initrc or other boot script to allow a break signal (ctrl-c)
to reach the fsck process (it's probably trapped by a trap command
before fsck runs normally, but you could edit the script with another
trap command that releases that trap just before fsck). And aborting a
read-only checkup fsck should always be safe.

But aborting fsck at all is just a really unwise habit to give yourself.

So I would do one of the other things that avoids running fsck in the
first place.

--
bkw
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

Felix Miata-3
In reply to this post by Thomas Hertweck
On 2011/12/20 19:26 (GMT) Thomas Hertweck composed:

> On 20/12/11 18:59, Istvan Gabor wrote:

>>  I have openSUSE 11.2 with several partitions.
>>  At every Nth mount fsck checks a given partition, which takes
>>  a long time. Sometimes I do need the computer quickly and don't want
>>  to wait until fsck finishes. Is there an option that makes possible
>>  to interrupt or cancel file system checking during boot so that the checking
>>  would be completed at the next boot? I don't want to disable it or
>>  change the max count, I just want occasionally bypass checking at
>>  boot. I tried to interrupt fsck by pressing ctrl+c but it
>>  resulted in a not normal boot, many partitions were not mounted.

> Append "fastboot" as boot parameter when the grub menu shows up.

I take the question to mean interruption of the fsck process, not knowing in
advance that this would be the time of an auto fsck that would delay a
required otherwise normal speed boot, and only realizing during boot fastboot
would have avoided the delay. Hindsight is 20/20. Appending fastboot wouldn't
be applicable for such a situation.

I set all my partitions to either 12m or 0 time count, and 0 mount count,
with tune2fs, and either let the init mount process decide if and when a
filesystem needs to be repaired before mounting, or delay automatic fsck at
least a year.
--
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

  Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

scott-268
In reply to this post by Istvan Gabor-2
On Tuesday, December 20, 2011 12:59:53 Istvan Gabor wrote:

> Hello:

> I have openSUSE 11.2 with several partitions.
> At every Nth mount fsck checks a given partition, which takes
> a long time. Sometimes I do need the computer quickly and
> don't want to wait until fsck finishes. Is there an option
> that makes possible to interrupt or cancel file system
> checking during boot so that the checking would be completed
> at the next boot? I don't want to disable it or change the
> max count, I just want occasionally bypass checking at boot.
> I tried to interrupt fsck by pressing ctrl+c but it resulted
> in a not normal boot, many partitions were not mounted.

> I also googled but did not find anything helpful.

all it takes is a little attention -- if, for you, as it does
for me now, fsck starts a 60 day timer when it performs its
chore, all that is required of you is to pay attention to when
that chore is performed, make a log entry, and use a script to
remind you when the next 60 day fsck is drawing near

you can force an fsck before the 60 day trigger with the
/forcefsck trick, thus avoiding any time crunch emergencies

i always log my fscks, i always force one before the next one
delays my next cold boot -- why would anyone do less?

just pay attention

sc
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

David Haller-4
In reply to this post by Felix Miata-3
Hello,

On Tue, 20 Dec 2011, Felix Miata wrote:

>On 2011/12/20 19:26 (GMT) Thomas Hertweck composed:
>>On 20/12/11 18:59, Istvan Gabor wrote:
>>> At every Nth mount fsck checks a given partition, which takes
>>> a long time. Sometimes I do need the computer quickly and don't want
>>> to wait until fsck finishes. Is there an option that makes possible
>>> to interrupt or cancel file system checking during boot so that the checking
>>> would be completed at the next boot? I don't want to disable it or
>>> change the max count, I just want occasionally bypass checking at
>>> boot. I tried to interrupt fsck by pressing ctrl+c but it
>>> resulted in a not normal boot, many partitions were not mounted.
>
>>Append "fastboot" as boot parameter when the grub menu shows up.
[..]
>I set all my partitions to either 12m or 0 time count, and 0 mount
>count, with tune2fs, and either let the init mount process decide if
>and when a filesystem needs to be repaired before mounting, or delay
>automatic fsck at least a year.

I set all partitions but the /-partition to "not check" in fstab (0 in
last column), and have varying max mount counts. As I have no splash,
I see that a FS should be checked (at least ext3 tells you so:
[  232.782545] EXT3-fs (sda2): warning: maximal mount count reached, running e2fsck is recommended
), and I also have a script to check:

,----[ /root/bin/check_mountcount.sh ]
| #!/bin/sh
| printf "%-10s %4s %4s %s\n" "device" "max" "cur" "mounted on"
| echo "---------- ---- ---- ----------···"
|
| grep 'ext[234]' /proc/mounts | while read device mntpt rest
| do
|   tune2fs -l "$device" 2>/dev/null | \
|       awk '/^Mount count/ { cur=$3; }
|            /^Max.*mount count/{ max=$4; }
|            END { printf "%-10s %4s %4s %s\n", dev, max, cur, mnt; }' \
|            dev="$device" mnt="$mntpt" -
| done
`----

and if I don't need a partition a while (and little disk anyway), I
unmount that partition and run fsck on it.

HTH,
-dnh

--
That's O'Neill with two L's, the other one has no sense of humor.
                                  -- Col. Jack O'Neill, Stargate
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

John Andersen-2
In reply to this post by scott-268
On 12/20/2011 8:43 PM, sc wrote:
> all it takes is a little attention -- if, for you, as it does
> for me now, fsck starts a 60 day timer when it performs its
> chore,

Does it not also count boot ups?  It used to do that as well,
but maybe it has dropped that behavior in recent years, I haven't
been paying attention.

The OP is shutting down and rebooting every day, not suspend to
ram, but a full windows user style reboot every morning.

--
_____________________________________
---This space for rent---
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionally only

David Haller-4
Hello,

On Wed, 21 Dec 2011, John Andersen wrote:

>On 12/20/2011 8:43 PM, sc wrote:
>> all it takes is a little attention -- if, for you, as it does
>> for me now, fsck starts a 60 day timer when it performs its
>> chore,
>
>Does it not also count boot ups?  It used to do that as well,
>but maybe it has dropped that behavior in recent years, I haven't
>been paying attention.
>
>The OP is shutting down and rebooting every day, not suspend to
>ram, but a full windows user style reboot every morning.

# tune2fs -l /dev/root ### [pruned]
Mount count:              1
Maximum mount count:      36
Check interval:           15552000 (6 months)
Next check after:         Mon Jun 18 14:59:25 2012

# tune2fs -l /dev/sdi1 ### [pruned]
Mount count:              854
Maximum mount count:      75
Last checked:             Thu Feb 25 14:42:31 2010
Check interval:           15552000 (6 months)

# ls -l /dev/disk/by-label/OLDHDC
[..] /dev/disk/by-label/OLDHDC -> ../../sdi1

# grep ' / \|hdc' /etc/fstab
LABEL=P_SUSE  /          ext3      [options]    1 1
LABEL=OLDHDC  /mnt/hdc1  ext3,ext2 [options]    0 0

I think I really should check sdi/hdc sometime again, that the 500G
IDE disk out of the old box where it _was_ hdc for years. ;)

# smartctl -A /dev/sdi1 | awk '$1 == 9 { print; }'
  9 Power_On_Hours  [..] 11715

HTH,
-dnh

--
Warning: Pregnancy can cause birth
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionallyonly

Istvan Gabor-2
In reply to this post by Brian K. White
2011. december 21. 0:46 napon "Brian K. White" <[hidden email]> írta:

[snip]

>
> I think your best option is to:
>
> * make sure all large fs's are journaling (reiserfs, ext4, etc)
>
> * drastically increase or disable altogether the periodic boot time
> scanning (not disabling the fsk if the fs is found to be dirty at boot)
>
> * manually fsck once in a while if you like.
>
> Because you can't predict when you will want to boot and run as fast as
> possible, and those times are _exactly_ the times you _don't_ want to
> have to futz with special boot prompt parameters.
>
> You could also make a menu.lst stanza that just has fastboot added to it.
>
> That way you could boot up fast without having to stop and enter special
> boot prompt options. Just select the fastboot entry instead of the
> regular entry.
>
> fsck does process interrupt signals gracefully. You could possibly
> modify the initrc or other boot script to allow a break signal (ctrl-c)
> to reach the fsck process (it's probably trapped by a trap command
> before fsck runs normally, but you could edit the script with another
> trap command that releases that trap just before fsck). And aborting a
> read-only checkup fsck should always be safe.
>
> But aborting fsck at all is just a really unwise habit to give yourself.
>
> So I would do one of the other things that avoids running fsck in the
> first place.

Thank you again.

I guess I should increase max mount count and also make a fastboot entry
in menu.lst. If I know before boot that I need the system urgently I
use fastboot, otherwise the regular boot with increased max mount numbers.

Following the drives' states (actual mount count) is not an option as
I have ~15 partitions, some mounted automatically, some by users if necessary.

Thanks again,

Istvan

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionallyonly

Carlos E. R.-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2011-12-24 00:26, Istvan Gabor wrote:
> Following the drives' states (actual mount count) is not an option as
> I have ~15 partitions, some mounted automatically, some by users if necessary.

It would if you can track the mount count and the maximal count, so as to
predict “next time will fsck one drive”. If this is checked by an script on
boot, it might help.

- --
Cheers / Saludos,

                Carlos E. R.
                (from 11.4 x86_64 "Celadon" at Telcontar)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iEYEARECAAYFAk71HIIACgkQtTMYHG2NR9XxgwCfQd8fm3LDRaVErgje7tBsCrPR
BGwAnjTKHPzmBU68pItuH5gl7t0G2szM
=xR4W
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionallyonly

John Andersen-2
On 12/23/2011 4:27 PM, Carlos E. R. wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2011-12-24 00:26, Istvan Gabor wrote:
>> Following the drives' states (actual mount count) is not an option as
>> I have ~15 partitions, some mounted automatically, some by users if necessary.
>
> It would if you can track the mount count and the maximal count, so as to
> predict “next time will fsck one drive”. If this is checked by an script on
> boot, it might help.

Good idea.

Why not check this on shutdown, and offer the ability to fsck and shutdown
when completed?

After all, you are not planning to use the computer when you tell it to shut down
and you can be safely logged out, the partition dismounted and checked
without inconveniencing the user.


--
_____________________________________
---This space for rent---
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionallyonly

Jon Clausen
On 2011-12-23 18:36:05 (-0800), John Andersen wrote:

> On 12/23/2011 4:27 PM, Carlos E. R. wrote:
> >-----BEGIN PGP SIGNED MESSAGE-----
> >Hash: SHA1
> >
> >On 2011-12-24 00:26, Istvan Gabor wrote:
> >>Following the drives' states (actual mount count) is not an option as
> >>I have ~15 partitions, some mounted automatically, some by users if necessary.
> >
> >It would if you can track the mount count and the maximal count, so as to
> >predict “next time will fsck one drive”. If this is checked by an script on
> >boot, it might help.
>
> Good idea.

s/Good/Great/

> Why not check this on shutdown, and offer the ability to fsck and shutdown
> when completed?

something on the order of this (untested) bit, could go in the logout
'function' (somewhere before interaction with the user is lost):

for FS in $(mount | grep ext | cut -f 1 -d \ ); do
  eval $(tune2fs -l /dev/${FS} | grep -i "mount count" |\
    sed -e 's/ /_/g ;s/:/=/ ; s/=_\+/=/')
  if [ ${Mount_count} -eq ${Maximum_mount_count} ] ; then
    echo "$FS will be fsck'ed at next mount, blablabla, now?"
    read Answer
    if [ "${Answer}" = "y" ] ; then
      FsckNow="$FS ${FsckNow}"
    fi
  fi
done

the challenge is to convey the contents of $FsckNow to something that
happens *after* the filesystems have been unmounted

> After all, you are not planning to use the computer when you tell it to shut down
> and you can be safely logged out, the partition dismounted and checked
> without inconveniencing the user.

except for the

'shut the laptop down in a hurry, planning to continue work on
$public_transportation'

or

'shut down laptop, which is on batteries'

scenarios - in which fsck'ing at either shutdown or boot would be
undesirable...

These days I rarely use 'ext' filesystems for anything but /boot/, but I've
walked into the "unexpected fsck" enough times that I can see some value in
at least being forewarned.

/jon
--
YMMV
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: interrupt or cancel file system check at boot, occasionallyonly

jdd@dodin.org
Le 24/12/2011 07:40, Jon Clausen a écrit :

> These days I rarely use 'ext' filesystems for anything but /boot/, but I've
> walked into the "unexpected fsck" enough times that I can see some value in
> at least being forewarned.

do you have any number on the fsck time? I just has a checkout of my
desktop (2 drives, 1 and 2 Tb) and it was less than one minute (ext4),
so the waiting time is manageable. (openSUSE 12.1)

I think having it at shutdown is worst, because, I often shutdown in a
hurry (not having time to look at messages). But a waiting time with
ability to disable the control at boot could be a good solution, if I
boot in a hurry, usually I'm in front of the computer, waiting and I
can answer

sorry if all this was already answered, I couldn't follow all the thread

jdd

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

12