LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-25-2005, 10:11 PM   #1
mherring02
Member
 
Registered: May 2005
Location: Pasadena, CA
Distribution: Ubuntu, Fedora
Posts: 50

Rep: Reputation: 15
updatedb locks system


Several times recently, I have found my computer almost paralyzed---running slowly that it is essentially unusable.
A quick check of system monitor shows that "updatedb" is running an consuming ~97% of CPU. Killing this process brings everything back to normal.
I am not familiar with setting up cron jobs---and have never toched anything in that area, but I gather that there may be something running automatically and getting stuck.

Any hints??

Athlon XP 2400, Abit MB, 1G ram, Ubuntu 5.04
Never a problem until this started a few days ago
 
Old 08-26-2005, 01:51 PM   #2
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
Killing updatedb is not a good idea unless you never want to take advantage of the speed & convenience of the locate command. Better to wait out the slowdown, it doesn't take that long:
Code:
# date;updatedb;date
Fri Aug 26 13:40:58 CDT 2005
Fri Aug 26 13:43:11 CDT 2005
That's 2 min 13 sec on a 750 Duron, 192 MB RAM, approx 15 GB being scanned (mounted & used).

Did you notice what time of day this happened?

Please post your /etc/crontab
Perhaps rescheduling the cron job is the answer.
 
Old 08-26-2005, 05:46 PM   #3
jdogpc
Member
 
Registered: Jul 2005
Location: Mafra, PT
Distribution: Fedora Core
Posts: 90

Rep: Reputation: 15
Hi mherring02,
not all distros are configured to run updatedb on a cron schedule nowadays, but if is configured to run from there it should be configured to run weekly so go to /etc/cron.weekly and delete or updatedb file from there.
That should solve your problem. Don't forget that if you ever want to use "locate" to search for some files you need to run "updatedb" manually as root.
 
Old 08-26-2005, 08:09 PM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,770

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
And, whatever you do, don't setup updatedb to run at boot. Unless you want enough time to suck down a few beers waiting for the system to boot and be usable.
 
Old 08-27-2005, 10:26 AM   #5
mherring02
Member
 
Registered: May 2005
Location: Pasadena, CA
Distribution: Ubuntu, Fedora
Posts: 50

Original Poster
Rep: Reputation: 15
Thanks for all the inputs...

In chasing this, I have found interesting evidence which I can not yet tie together:
Syslog shows that the system has gone into neverland repeatedly trying to access my external USB drive (/dev/sda)--the dates match when I was finding the system locked up. Here is a typical entry:
Aug 26 18:21:18 localhost anacron[24163]: Job `cron.monthly' terminated
Aug 26 18:21:18 localhost anacron[24163]: Normal exit (2 jobs run)
Aug 26 18:21:18 localhost kernel: Current sda: sense key No Sense
Aug 26 18:21:39 localhost last message repeated 15 times
Aug 26 18:22:39 localhost last message repeated 9 times
Aug 26 18:22:39 localhost kernel: FAT: Filesystem panic (dev sda1)
Aug 26 18:22:39 localhost kernel: invalid access to FAT (entry 0x21110b46)

<<followed by a bazillion more of the same>>

Note that it got in trouble AFTER anacron was done

checking mail messages:

for the period in question, there are daily messages indicating that updatedb was terminated---that presumably relates to my manual intervention every time I found the computer locked up.

Earlier (before the trouble), there are two interesting messages:
May 20: unable to locate /var/lib/slocate/slocate.db
Aug 10: segmentation fault usr/bin/updatedb

(the next mail message was the first of the series where the trouble started)

Just now, I ran updatedb manually and it completed in ~ 1.5 minutes with no ill effects.

I feel I am on the trail, but still not close the answer
 
Old 08-28-2005, 09:38 AM   #6
camelrider
Member
 
Registered: Apr 2003
Location: Juneau, Alaska
Posts: 244

Rep: Reputation: 31
Two suggestions:

1) You can edit the updatedb line in your cron files to exclude your usb drive if that is the only thing causing a problem. (See man updatedb. I think the -e switch will help)

2) You can run the updatedb command with an elevated nice value. (see man nice) In the days of i386 boxen with only a few MB of RAM nice was a pretty popular utility. It prevents a single process from hogging resources.

Hope this helps.
 
Old 08-28-2005, 11:34 AM   #7
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,377

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
I suspect that the USB drive may well be the root cause of the problem.

As suggested, I routinely use nice updatedb, so that the process runs at lower priority. Of course, it's an "I/O bound" process anyway, so priority doesn't matter so much.

And I schedule the daily run for 2:00 AM local time.
 
Old 08-28-2005, 11:59 AM   #8
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,377

Rep: Reputation: 170Reputation: 170
This is how I changed updatedb on my Slack system:

#!/bin/sh
/usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e "/tmp,/var/tmp,usr/tmp,/afs,/net,/mnt/win98,/mnt/winxp,/mnt/Suse,/mnt/hda7"
This script is located at /etc/cron.daily - it may be different for other distros.

-f excludes the specified filesystem types
-e excludes the specified directories.

These are the places I don't want or need to be indexed. Change to suit your system.
 
Old 08-28-2005, 02:06 PM   #9
mherring02
Member
 
Registered: May 2005
Location: Pasadena, CA
Distribution: Ubuntu, Fedora
Posts: 50

Original Poster
Rep: Reputation: 15
Thanks to everyone---now I understand cron and related things.

curiously, since I was grubbing around looking for clues, things have been OK. Reminds me of when I was 10--and could fix lawnmowers by taking them apart and reassembling---at the time I never knew WHY....

I claim that computers are not deterministic--for the simple reason that their "mother" never knows EXACTLY what is inside.
 
Old 08-28-2005, 04:54 PM   #10
jdogpc
Member
 
Registered: Jul 2005
Location: Mafra, PT
Distribution: Fedora Core
Posts: 90

Rep: Reputation: 15
Hi mherring02, by your post I think you should check your external hdd as it appears to have some problems.
Run a fsck as root to check it out, with look it's just logical problems.

umount /dev/sda1
fsck.vfat -rtv /dev/sda1

-r - interactive
-t - test for bas clusters
-v - verbose

this will take a while.
in case you see some errors identical to the ones you mentioned earlier and you think the hdd is ok test it on another machine or with another operating system, as this could also be a problem of your kernel modules either scsi emulation which I don't think so or usb driver.

Good Luck

JDOGPC

Last edited by jdogpc; 08-28-2005 at 04:56 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
updatedb crashes locks up the computer beejayzed Mandriva 8 12-27-2004 09:47 PM
What's the difference between 'updatedb' and 'updatedb&' ?? DreameR-X Linux - Newbie 4 12-18-2004 04:36 PM
Xine locks up system mykrob Linux - Software 6 11-08-2004 07:24 AM
system locks joseph_1970 Linux - Hardware 4 12-10-2003 10:04 PM
CD Record system locks drjimstuckinwin Linux - General 4 07-16-2001 06:39 AM


All times are GMT -5. The time now is 05:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration