Re: Unnecessary hard drive spin-ups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12Feb2020 19:09, Roger Heflin <rogerheflin@xxxxxxxxx> wrote:
It may be the pwd command doing it.  It works like this:

if something runs pwd when its cwd is under say /var/log then pwd goes
through all files in /var/log until it finds .. then it goes up a
directory and repeats, until it gets to /.

getcwd() is a system call on Linux since 2.1.92. It doesn't need to perform the expensive ".. then stat everything for a match" loop.

[... snip arranging mounts to be in more out-of-the-way places ...]

On Wed, Feb 12, 2020 at 1:11 PM Dave Ulrick <d-ulrick@xxxxxxxxxxx> wrote:
I ran 'strace' on 'ls' but nothing interesting showed up. Then, I ran
'strace' on 'bash'. I ran 'ls' from 'bash' and then exited. The strace
log shows two connect()s to a socket file under /var/run:

socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) =
-1 ENOEN
T (No such file or directory)
close(3)

/var/run/nscd/socket appears to be related to the 'nscd' DNS cache which
I am not running on my PCs.

Aye.

So, it looks likely that reading /var/run caused the contents of /var to
be read. This would have triggered a wakeup of the device hosting
/var/backups which would be a cause of its hard drive spinning up.

This would surprise me; accessing a direct name doesn't require stating everything adjacent.

You can test this:

- wait for the drive to spin down
- type ">>var/run/nscd/socket" and preess <enter> (do NOT filecomplete that path, your shell will do unwanted filesystem access)
- see if/when the drive spins up

Cheers,
Cameron Simpson <cs@xxxxxxxxxx>
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux