I posted a question here because my HDDs keep spinning up for no apparent reason and wanted to find out what process causes them to spin up.

In the comments to that question, I was told to use iosnoop which (without any arguments or switches) generated a few hundred lines within the few minutes it took one of the HDDs to randomly spin up. After copying the output and telling Emacs to remove all lines with the device number corresponding to the SD card (about accesses to which I don't care), I'm left with this:

COMM         PID    TYPE DEV      BLOCK        BYTES     LATms
dumpe2fs     19467  R    8,0      272648       4096      23.25
Ending tracing...

As there only is 1 line of data left, it seems reasonable to assume that the culprit has been identified. But why is dumpe2fs called randomly? More important than that: How do I make it stop, preferably without breaking stuff (which the dirty solution of renaming the corresponding file might do)?

Running sudo dumpe2fs /dev/sda1 manually does make the corresponding HDD spin up. The command, however, does already return its output and terminate before the HDD is spun up (without the ~ 7 s delay I experience when accessing files while the HDDs are spun down).

I use Ubuntu Mate 16.04.

  • Is dumpe2fs called randomly, or at fixed times? Dec 4 '17 at 15:56
  • @MarkPlotnick I cannot tell when it or possibly other commands which make at least one of the HDDs spin up are called. I guess I'd have to sit next to my HDDs for a day and write down the times they spin up to note a pattern, if there is any, because I don't know of any side-effect-free means of measuring whether the HDDs are spun down. I read of some a while back but it doesn't work for my external HDDs. They always return active/idle or whatever it was, independently of whether they're actually spun up.
    – UTF-8
    Dec 4 '17 at 15:58
  • No need to physically monitor the disks to tell when dumpe2fs runs. Give iosnoop the -s -n dumpe2fs options and it'll tell you the times when that command is running. Dec 4 '17 at 16:16
  • @MarkPlotnick Thank you. I set up a screen with that and will let it run until I gathered enough data.
    – UTF-8
    Dec 4 '17 at 16:19
  • My goal here is to see whether it runs on a schedule. If so, you can go rummaging through crontabs and sshd logs to see what may be running it. Dec 4 '17 at 16:42

To figure out why dumpe2fs is being run, you could replace it with a logger. Rename /sbin/dumpe2fs to /sbin/dumpe2fs.real, and create a script called /sbin/dumpe2fs containing

echo dumpe2fs "$@" >> /var/log/dumpe2fs-search.log
date >> /var/log/dumpe2fs-search.log
pstree >> /var/log/dumpe2fs-search.log
exec dumpe2fs.real "$@"

Then look through the log file to determine what’s running dumpe2fs...

  • Don't forget to mark the new script as executable, e.g.: sudo chmod a+x /usr/bin/dumpe2fs.
    – vedg
    Jan 6 '19 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.