Hard drive check

Every 2 months or so, when booting up my PC, I find that the boot sequence is very slow. When I press ESC, I see that the system is carrying out a hard drive check on all three of my disks. This seems to take forever.

Can anyone tell me what is happening during this check, adn is there any way I can change the frequency of this check. My thought is, if this check has to be carried out, I’d rather have it on a monthly basis, or even every 2-3 weeks, thereby ensuring that it doesn’t take so long, at-least not as long as it would if it was done every 60-62 days.

Also which program is used to carry out this check and can I start it manually, can I even change options/settings, assuming there are any to change?

Thanks.

Most all linux distributions will run fsck (filesystem check) after x number of boots (generally 10 or so). It’s looking for and if necessary recovering broken inodes. Actually it’s a good thing, and I wouldn’t mess with it. As in so what if booting take a bit longer every so often. You can change the frequency of this event, but right now I can’t remember how, maybe someone else can elucidate and illuminate on the subject. :slight_smile:

it is running a file checking program…which really does need to be
run every once in a while…

as far as i know, it will take the same amount of time (or VERY close
to it) no matter if it is done once a day or once a year…

only way i know to make it quicker is to 1) have less disks and/or 2)
less space and/or 3) faster running disks…

its kinda like having the oil changed in your car: got to happen and
gonna take some time…

relax…

hmmmmm…actually, i guess you COULD decide when it is gonna happen
(say, at lunch time when you don’t wanna touch the machine) by
running the program manually, after doing a reboot to an in-memory
image (via CD/DVD/knoppix or whatever)

but, i don’t have the particulars on how to do that…or exactly what
program (probably fsck) or the command line switches which need to be
set for YOUR setup, and to stave off the auto-function doing it
again, tomorrow.


see caveat: http://tinyurl.com/6aagco
DenverD (Linux Counter 282315) via NNTP, Thunderbird 2.0.0.14, KDE
3.5.7, SUSE Linux 10.3, 2.6.22.18-0.2-default #1 SMP i686 athlon

On 2008-08-25, silkmaze <silkmaze@no-mx.forums.opensuse.org> wrote:

> Every 2 months or so, when booting up my PC, I find that the boot
> sequence is very slow. When I press ESC, I see that the system is
> carrying out a hard drive check on all three of my disks. This seems to
> take forever.

That is so by design.

> Can anyone tell me what is happening during this check, adn is there
> any way I can change the frequency of this check. My thought is, if this
> check has to be carried out, I’d rather have it on a monthly basis, or
> even every 2-3 weeks, thereby ensuring that it doesn’t take so long,
> at-least not as long as it would if it was done every 60-62 days.

Running it more often, will NOT make it run faster. It’s a simple FS check,
which has to check the entire disk.

> Also which program is used to carry out this check and can I start it
> manually, can I even change options/settings, assuming there are any to
> change?

The name of the tools is tune2fs.
Amongst other things, it can:

  • set number of mounts before fsck
  • set max delay between fsck’s.

Another use:
When an ext2/3 filesystem is formated by default 5% is reserved for
root. Reserved space is supposed to reduce fragementation and allow
root to login in case the filesystem becomes 100% used. You can use
tune2fs to reduce the amount of reserved space.

I’ve been wanting to do that for my 500 GB /home drive. Should save 25 GB,
not negligeable.

Be carefull with that kind of tool…


Hanlon’s Razor:
Never attribute to malice that which is
adequately explained by stupidity.

On Mon, 25 Aug 2008 10:06:02 GMT
silkmaze <silkmaze@no-mx.forums.opensuse.org> wrote:

>
> Every 2 months or so, when booting up my PC, I find that the boot
> sequence is very slow. When I press ESC, I see that the system is
> carrying out a hard drive check on all three of my disks. This seems to
> take forever.
>
> Can anyone tell me what is happening during this check, adn is there
> any way I can change the frequency of this check. My thought is, if this
> check has to be carried out, I’d rather have it on a monthly basis, or
> even every 2-3 weeks, thereby ensuring that it doesn’t take so long,
> at-least not as long as it would if it was done every 60-62 days.
>
> Also which program is used to carry out this check and can I start it
> manually, can I even change options/settings, assuming there are any to
> change?
>
> Thanks.
>
>

Think of the check as a VERY indepth version of chkdsk or scandisk.

As mentioned in the other posts, you can alter the frequency of the checks,
or disable them altogether, although this is not recommended.

as root:

tune2fs -i 1m /dev/sda2
would set sda2 to automatically perform a test every month. (1m), ‘-i’ is
‘interval’… it understands seconds, days, weeks and months. A value of
zero (0) turns off interval checking.

5 days: -i 5d
2 weeks: -i 2w
Once a quarter: -i 3m

tune2fs -c 5 /dev/sda2
sets sda2 to perform fsck every 5 mounts. ‘0’ or ‘-1’ disables this. (this
is mounts, not boots. You may umount/mount the filesystem for some
reason, it counts those too.

the ‘-C’ (capital C) option allows you to SET the current number of mounts
for a filesystem.

This would allow you to cause the fsck’s to be staggered.

You may set the Volume Label on a filesysem with the ‘-L’ option. Useful for
labeling your drives for easier mounting

As another poster mentioned, you may set the % of total space reserved for
root’s use with the ‘-m’ option. Very handy since drives today are vastly
larger than before, and 1% can be sizable! The Default value when a
filesystem is formatted is 5%. If your drive is > 100GB, then 1% is more
than sufficent for recovery purposes. If the drive is NOT used for logging
or system/root purposes, you should be able to get away with 0% too.

Read the man page for tune2fs for more information (man tune2fs)

There is also a reiserfs utility with comparable functions: reiserfstune

Loni


L R Nix
lornix@lornix.com

I think that before I even remotely contemplate “tinkering” with this, I should take a very careful look at “tune2fs”.

Thanks for all the information. It’s a good start.