Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
find utility always starts in "D" state and may keep beeing in this state for as long as it wants(needs?). Could someone explain why. What I am doing is:
# find /(anything) -name ^regExpr(also might be a name*)
sometimes complemented with the "-d" option
Cpu(s): 3.0%us, 2.5%sy, 0.0%ni, 94.2%id, 0.3%wa, 0.0%hi, 0.0%si, 0.0%st
random ss of the top's cpu(s) during this "hang".
Also, the "1min load average" jumps from almost insignificantly to like 5.0. What is it waiting for? Why? My CPU doesn't let it be executed, no idea. Sorry if stupid.
What I am doing is:
# find /(anything) -name ^regExpr(also might be a name*)
sometimes complemented with the "-d" option
D stands for "Uninterruptible sleep" and running your find under 'strace' should show you why it doesn't work the way you think it should. That said, when looking at '/' you may almost always want "-xdev" because you most likely don't want to recurse into VFS like /proc or /sys and stay on the local system. And maybe my 'find' is old but when I want to search for files with a path-based regex I use "-regex", not "-name" though you can mix 'em NP.
If you use find a lot you might be better off using updatedb/locate.
As to why it drops into state "D", that is because most of the time that process will be waiting on (disk) I/O. The spike in loadavg is most likely because other processes doing I/O are being forced to wait as well. Try the following to see if this is true
Code:
top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D: "count}'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.