How to find which process is regularly writing to disk?hard disks spin up by processes / applications that...

Installing Windows to flash UEFI/ BIOS, then reinstalling Ubuntu

Why is there a large performance impact when looping over an array over 240 elements?

Are there any lower-level means of travelling between planes of existence?

Running code generated in realtime in JavaScript with eval()

How can I communicate my issues with a potential date's pushy behavior?

Graphs for which a calculus student can reasonably compute the arclength

In which case does the Security misconfiguration vulnerability apply to?

What is the たんだ in と思ってたんだ for the sentence in question?

Why is Python 2.7 still the default Python version in Ubuntu?

Why command hierarchy, if the chain of command is standing next to each other?

Why aren't rainbows blurred-out into nothing after they are produced?

What can Amex do if I cancel their card after using the sign up bonus miles?

Are those flyers about apartment purchase a scam?

Are there really no countries that protect Freedom of Speech as the United States does?

How can I see if the data in a SQL Server table is page-compressed?

How was the murder committed?

Shapovalov form on Verma modules

How can I find an old paper when the usual methods fail?

Heating Margarine in Pan = loss of calories?

An array battle with odd secret powers

Would Mirko Vosk, Mind Drinker trigger Waste Not?

Why aren't rockets built with truss structures inside their fuel & oxidizer tanks to increase structural strength?

Will using a resistor in series with a LED to control its voltage increase the total energy expenditure?

A torrent of foreign terms



How to find which process is regularly writing to disk?


hard disks spin up by processes / applications that simply get a list of disks? How to prevent?Paritioning Scheme: Arch Linux server & laptopfind ount what [flush-8:0] is writingLinuxMint15: Suspend to RAM not workingFind which process is modifying a fileRaid5 + LVM2 + grub2: final config and bootWhy is OS constantly writing to disk (ext4) on a Ubuntu 14.04 machine? Is it normal?df shows 100% used, but logs keep getting writtenNeed to switch debian FS readonly writable layer from tmpfs to aufs to not lose files after booting`apt-get`, `dpkg` fails from a bluetooth serial port, but succeed from the physically attached consolesystemctl enable tmp.mount






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







40















How can I find which process is constantly writing to disk?



I like my workstation to be close to silent and I just build a new system (P8B75-M + Core i5 3450s -- the 's' because it has a lower max TDP) with quiet fans etc. and installed Debian Wheezy 64-bit on it.



And something is getting on my nerve: I can hear some kind of pattern like if the hard disk was writing or seeking someting (tick...tick...tick...trrrrrr rinse and repeat every second or so).



In the past I had a similar issue in the past (many, many years ago) and it turned out it was some CUPS log or something and I simply redirected that one (not important) logging to a (real) RAM disk.



But here I'm not sure.



I tried the following:



ls -lR /var/log > /tmp/a.tmp && sleep 5 && ls -lR /var/log > /tmp/b.tmp && diff /tmp/?.tmp


but nothing is changing there.



Now the strange thing is that I also hear the pattern when the prompt asking me to enter my LVM decryption passphrase is showing.



Could it be something in the kernel/system I just installed or do I have a faulty harddisk?



hdparm -tT /dev/sda report a correct HD speed (130 GB/s non-cached, sata 6GB) and I've already installed and compiled from big sources (Emacs) without issue so I don't think the system is bad.



(HD is a Seagate Barracude 500GB)










share|improve this question

























  • Are you sure it's a hard drive making that noise, and not something else? (Check the fans, including PSU fan. Had very strange clicking noises once when a very thin cable was too close to a fan and would sometimes very slightly touch the blades and bounce for a few "clicks"...)

    – Mat
    Jul 27 '12 at 6:03











  • @Mat: I'll take the hard drive outside of the case (the connectors should be long enough) to be sure and I'll report back ; )

    – Cedric Martin
    Jul 27 '12 at 7:02






  • 2





    Make sure your disk filesystems are mounted relatime or noatime. File reads can be causing writes to inodes to record the access time.

    – camh
    Jul 27 '12 at 9:48


















40















How can I find which process is constantly writing to disk?



I like my workstation to be close to silent and I just build a new system (P8B75-M + Core i5 3450s -- the 's' because it has a lower max TDP) with quiet fans etc. and installed Debian Wheezy 64-bit on it.



And something is getting on my nerve: I can hear some kind of pattern like if the hard disk was writing or seeking someting (tick...tick...tick...trrrrrr rinse and repeat every second or so).



In the past I had a similar issue in the past (many, many years ago) and it turned out it was some CUPS log or something and I simply redirected that one (not important) logging to a (real) RAM disk.



But here I'm not sure.



I tried the following:



ls -lR /var/log > /tmp/a.tmp && sleep 5 && ls -lR /var/log > /tmp/b.tmp && diff /tmp/?.tmp


but nothing is changing there.



Now the strange thing is that I also hear the pattern when the prompt asking me to enter my LVM decryption passphrase is showing.



Could it be something in the kernel/system I just installed or do I have a faulty harddisk?



hdparm -tT /dev/sda report a correct HD speed (130 GB/s non-cached, sata 6GB) and I've already installed and compiled from big sources (Emacs) without issue so I don't think the system is bad.



(HD is a Seagate Barracude 500GB)










share|improve this question

























  • Are you sure it's a hard drive making that noise, and not something else? (Check the fans, including PSU fan. Had very strange clicking noises once when a very thin cable was too close to a fan and would sometimes very slightly touch the blades and bounce for a few "clicks"...)

    – Mat
    Jul 27 '12 at 6:03











  • @Mat: I'll take the hard drive outside of the case (the connectors should be long enough) to be sure and I'll report back ; )

    – Cedric Martin
    Jul 27 '12 at 7:02






  • 2





    Make sure your disk filesystems are mounted relatime or noatime. File reads can be causing writes to inodes to record the access time.

    – camh
    Jul 27 '12 at 9:48














40












40








40


13






How can I find which process is constantly writing to disk?



I like my workstation to be close to silent and I just build a new system (P8B75-M + Core i5 3450s -- the 's' because it has a lower max TDP) with quiet fans etc. and installed Debian Wheezy 64-bit on it.



And something is getting on my nerve: I can hear some kind of pattern like if the hard disk was writing or seeking someting (tick...tick...tick...trrrrrr rinse and repeat every second or so).



In the past I had a similar issue in the past (many, many years ago) and it turned out it was some CUPS log or something and I simply redirected that one (not important) logging to a (real) RAM disk.



But here I'm not sure.



I tried the following:



ls -lR /var/log > /tmp/a.tmp && sleep 5 && ls -lR /var/log > /tmp/b.tmp && diff /tmp/?.tmp


but nothing is changing there.



Now the strange thing is that I also hear the pattern when the prompt asking me to enter my LVM decryption passphrase is showing.



Could it be something in the kernel/system I just installed or do I have a faulty harddisk?



hdparm -tT /dev/sda report a correct HD speed (130 GB/s non-cached, sata 6GB) and I've already installed and compiled from big sources (Emacs) without issue so I don't think the system is bad.



(HD is a Seagate Barracude 500GB)










share|improve this question














How can I find which process is constantly writing to disk?



I like my workstation to be close to silent and I just build a new system (P8B75-M + Core i5 3450s -- the 's' because it has a lower max TDP) with quiet fans etc. and installed Debian Wheezy 64-bit on it.



And something is getting on my nerve: I can hear some kind of pattern like if the hard disk was writing or seeking someting (tick...tick...tick...trrrrrr rinse and repeat every second or so).



In the past I had a similar issue in the past (many, many years ago) and it turned out it was some CUPS log or something and I simply redirected that one (not important) logging to a (real) RAM disk.



But here I'm not sure.



I tried the following:



ls -lR /var/log > /tmp/a.tmp && sleep 5 && ls -lR /var/log > /tmp/b.tmp && diff /tmp/?.tmp


but nothing is changing there.



Now the strange thing is that I also hear the pattern when the prompt asking me to enter my LVM decryption passphrase is showing.



Could it be something in the kernel/system I just installed or do I have a faulty harddisk?



hdparm -tT /dev/sda report a correct HD speed (130 GB/s non-cached, sata 6GB) and I've already installed and compiled from big sources (Emacs) without issue so I don't think the system is bad.



(HD is a Seagate Barracude 500GB)







linux debian logs hard-disk






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 27 '12 at 4:31









Cedric MartinCedric Martin

1,1555 gold badges20 silver badges30 bronze badges




1,1555 gold badges20 silver badges30 bronze badges
















  • Are you sure it's a hard drive making that noise, and not something else? (Check the fans, including PSU fan. Had very strange clicking noises once when a very thin cable was too close to a fan and would sometimes very slightly touch the blades and bounce for a few "clicks"...)

    – Mat
    Jul 27 '12 at 6:03











  • @Mat: I'll take the hard drive outside of the case (the connectors should be long enough) to be sure and I'll report back ; )

    – Cedric Martin
    Jul 27 '12 at 7:02






  • 2





    Make sure your disk filesystems are mounted relatime or noatime. File reads can be causing writes to inodes to record the access time.

    – camh
    Jul 27 '12 at 9:48



















  • Are you sure it's a hard drive making that noise, and not something else? (Check the fans, including PSU fan. Had very strange clicking noises once when a very thin cable was too close to a fan and would sometimes very slightly touch the blades and bounce for a few "clicks"...)

    – Mat
    Jul 27 '12 at 6:03











  • @Mat: I'll take the hard drive outside of the case (the connectors should be long enough) to be sure and I'll report back ; )

    – Cedric Martin
    Jul 27 '12 at 7:02






  • 2





    Make sure your disk filesystems are mounted relatime or noatime. File reads can be causing writes to inodes to record the access time.

    – camh
    Jul 27 '12 at 9:48

















Are you sure it's a hard drive making that noise, and not something else? (Check the fans, including PSU fan. Had very strange clicking noises once when a very thin cable was too close to a fan and would sometimes very slightly touch the blades and bounce for a few "clicks"...)

– Mat
Jul 27 '12 at 6:03





Are you sure it's a hard drive making that noise, and not something else? (Check the fans, including PSU fan. Had very strange clicking noises once when a very thin cable was too close to a fan and would sometimes very slightly touch the blades and bounce for a few "clicks"...)

– Mat
Jul 27 '12 at 6:03













@Mat: I'll take the hard drive outside of the case (the connectors should be long enough) to be sure and I'll report back ; )

– Cedric Martin
Jul 27 '12 at 7:02





@Mat: I'll take the hard drive outside of the case (the connectors should be long enough) to be sure and I'll report back ; )

– Cedric Martin
Jul 27 '12 at 7:02




2




2





Make sure your disk filesystems are mounted relatime or noatime. File reads can be causing writes to inodes to record the access time.

– camh
Jul 27 '12 at 9:48





Make sure your disk filesystems are mounted relatime or noatime. File reads can be causing writes to inodes to record the access time.

– camh
Jul 27 '12 at 9:48










8 Answers
8






active

oldest

votes


















41














Did you tried to examin what programs like iotop is showing? It will tell you exacly what kind of process is currently writing to the disk.



example output:



Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init
2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd]
3 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0]
6 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0]
7 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdog/0]
8 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
1033 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [flush-8:0]
10 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/1]





share|improve this answer























  • 1





    thanks for that tip. I didn't know about iotop. On Debian I did an apt-cache search iotop to find out that I had to apt-get iotop. Very cool command!

    – Cedric Martin
    Aug 2 '12 at 15:56






  • 3





    I use iotop -o -b -d 10 which every 10secs prints a list of processes that read/wrote to disk and the amount of IO bandwidth used.

    – ndemou
    Jun 20 '16 at 15:32





















15














You can enable IO debugging via echo 1 > /proc/sys/vm/block_dump and then watch the debugging messages in /var/log/syslog. This has the advantage of obtaining some type of log file with past activities whereas iotop only shows the current activity.






share|improve this answer





















  • 3





    It is absolutely crazy to leave sysloging enabled when block_dump is active. Logging causes disk activity, which causes logging, which causes disk activity etc. Better stop syslog before enabling this (and use dmesg to read the messages)

    – dan3
    Jul 15 '13 at 8:32











  • You are absolutely right, although the effect isn't as dramatic as you describe it. If you just want to have a short peek at the disk activity there is no need to stop the syslog daemon.

    – scai
    Jul 16 '13 at 6:32











  • I've tried it about 2 years ago and it brought my machine to a halt. One of these days when I have nothing important running I'll try it again :)

    – dan3
    Jul 16 '13 at 7:22













  • I tried it, nothing really happened. Especially because of file system buffering. A write to syslog doesn't immediately trigger a write to disk.

    – scai
    Jul 16 '13 at 10:50






  • 1





    I would assume there is rate general rate limiting in place for the log messages, which handles this case too(?)

    – Volker Siegel
    Apr 16 '14 at 22:57



















5














Assuming that the disk noises are due to a process causing a write and not to some disk spindown problem, you can use the audit subsystem (install the auditd package). Put a watch on the sync calls and its friends:



auditctl -S sync -S fsync -S fdatasync -a exit,always


Watch the logs in /var/log/audit/audit.log. Be careful not to do this if the audit logs themselves are flushed! Check in /etc/auditd.conf that the flush option is set to none.



If files are being flushed often, a likely culprit is the system logs. For example, if you log failed incoming connection attempts and someone is probing your machine, that will generate a lot of entries; this can cause a disk to emit machine gun-style noises. With the basic log daemon sysklogd, check /etc/syslog.conf: if a log file name is not be preceded by -, then that log is flushed to disk after each write.






share|improve this answer




























  • @StephenKitt Huh. No. The asker mentioned Debian so I've changed it to a link to the Debian package.

    – Gilles
    Mar 23 '18 at 18:24



















3














It might be your drives automatically spinning down, lots of consumer-grade drives do that these days. Unfortunately on even a lightly loaded system, this results in the drives constantly spinning down and then spinning up again, especially if you're running hddtemp or similar to monitor the drive temperature (most drives stupidly don't let you query the SMART temperature value without spinning up the drive - cretinous!).



This is not only annoying, it can wear out the drives faster as many drives have only a limited number of park cycles. e.g. see https://bugs.launchpad.net/ubuntu/+source/hdparm/+bug/952556 for a description of the problem.



I disable idle-spindown on all my drives with the following bit of shell code. you could put it in an /etc/rc.boot script, or in /etc/rc.local or similar.




for disk in /dev/sd? ; do
/sbin/hdparm -q -S 0 "$disk"
done





share|improve this answer























  • 2





    that you can't query SMART readings without spinning up the drive leaves me speechless :-/ Now obviously the "spinning down" issue can become quite complicated. Regarding disabling the spinning down: wouldn't that in itself cause the HD to wear out faster? I mean: it's never ever "resting" as long as the system is on then?

    – Cedric Martin
    Aug 2 '12 at 16:03











  • IIRC you can query some SMART values without causing the drive to spin up, but temperature isn't one of them on any of the drives i've tested (incl models from WD, Seagate, Samsung, Hitachi). Which is, of course, crazy because concern over temperature is one of the reasons for idling a drive. re: wear: AIUI 1. constant velocity is less wearing than changing speed. 2. the drives have to park the heads in a safe area and a drive is only rated to do that so many times (IIRC up to a few hundred thousand - easily exceeded if the drive is idling and spinning up every few seconds)

    – cas
    Aug 2 '12 at 21:42











  • It's a long debate regarding whether it's better to leave drives running or to spin them down. Personally I believe it's best to leave them running - I turn my computer off at night and when I go out but other than that I never spin my drives down. Some people prefer to spin them down, say, at night if they're leaving the computer on or if the computer's idle for a long time, and in such cases the advantage of spinning them down for a few hours versus leaving them running is debatable. What's never good though is when the hard drive repeatedly spins down and up again in a short period of time.

    – Micheal Johnson
    Mar 12 '16 at 20:48











  • Note also that spinning the drive down after it's been idle for a few hours is a bit silly, because if it's been idle for a few hours then it's likely to be used again within an hour. In that case, it would seem better to spin the drive down promptly if it's idle (like, within 10 minutes), but it's also possible for the drive to be idle for a few minutes when someone is using the computer and is likely to need the drive again soon.

    – Micheal Johnson
    Mar 12 '16 at 20:51











  • I thought sure this would fix my issue as I hear the drive make a periodic clacking sound (3-4 times/second) like it's writing even when it's not mounted! But I still hear the noise after running this command. Worryingly, it's the drive I use to back up my internal SSD...

    – Michael
    16 hours ago



















1














I just found that s.m.a.r.t was causing an external USB disk to spin up again and again on my raspberry pi. Although SMART is generally a good thing, I decided to disable it again and since then it seems that unwanted disk activity has stopped






share|improve this answer


























  • You can configure smart daemon not to scan USB disks, most good linux distributions do this by default.

    – lzap
    Jun 15 '17 at 11:19



















1














You can wack on this a bit. Should narrow it down for most.



find / -mount -newer /proc -print


Give files modified since boot on the physical device of the / files system. Knowing the files will likely help identify the writer.






share|improve this answer



































    1














    In case you need to narrow it down to an exact disk use the following:



    run lsblk and look up the device number. In the case below it is 9:126



    NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
    sda 8:0 0 7.3T 0 disk
    └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
    sdb 8:16 0 7.3T 0 disk
    └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
    sdc 8:32 0 7.3T 0 disk
    └─sdc1 8:33 0 7.3T 0 part /mnt/InternalFBE


    run lsof | grep '9,126' with the : replace with , compared to the above disk number. In my case this shows up as:



    bash      389162            root  cwd       DIR              9,126      4096  449183796 /mnt/InternalPhase/0000000001/CHANNEL01/LIVE/PHASE/DATA/2018/10/04


    with the PID of 389162 kill this process using:



    kill -9 389162





    share|improve this answer

































      -1














      The problem is that the system needs to flush data from the disk buffers to the disk ever 5 seconds or so by default. Thus if the disk does spin down, there will be little option other than to spin back up again when a flush needs to happen. So the problem is not really avoidable other than by disabling spins downs or disk power management features altogether hdparm -B 255 /dev/hdax. This is probably the better option since restarting so often can definitely be more damaging than simply staying on all the time.






      share|improve this answer





















      • 1





        It's only going to flush data if there's any data to flush. If the disk is really not in use, then there isn't going to be any buffered data to flush.

        – Micheal Johnson
        Mar 12 '16 at 20:53














      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f44103%2fhow-to-find-which-process-is-regularly-writing-to-disk%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      8 Answers
      8






      active

      oldest

      votes








      8 Answers
      8






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      41














      Did you tried to examin what programs like iotop is showing? It will tell you exacly what kind of process is currently writing to the disk.



      example output:



      Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
      TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
      1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init
      2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd]
      3 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0]
      6 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0]
      7 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdog/0]
      8 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
      1033 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [flush-8:0]
      10 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/1]





      share|improve this answer























      • 1





        thanks for that tip. I didn't know about iotop. On Debian I did an apt-cache search iotop to find out that I had to apt-get iotop. Very cool command!

        – Cedric Martin
        Aug 2 '12 at 15:56






      • 3





        I use iotop -o -b -d 10 which every 10secs prints a list of processes that read/wrote to disk and the amount of IO bandwidth used.

        – ndemou
        Jun 20 '16 at 15:32


















      41














      Did you tried to examin what programs like iotop is showing? It will tell you exacly what kind of process is currently writing to the disk.



      example output:



      Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
      TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
      1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init
      2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd]
      3 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0]
      6 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0]
      7 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdog/0]
      8 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
      1033 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [flush-8:0]
      10 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/1]





      share|improve this answer























      • 1





        thanks for that tip. I didn't know about iotop. On Debian I did an apt-cache search iotop to find out that I had to apt-get iotop. Very cool command!

        – Cedric Martin
        Aug 2 '12 at 15:56






      • 3





        I use iotop -o -b -d 10 which every 10secs prints a list of processes that read/wrote to disk and the amount of IO bandwidth used.

        – ndemou
        Jun 20 '16 at 15:32
















      41












      41








      41







      Did you tried to examin what programs like iotop is showing? It will tell you exacly what kind of process is currently writing to the disk.



      example output:



      Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
      TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
      1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init
      2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd]
      3 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0]
      6 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0]
      7 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdog/0]
      8 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
      1033 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [flush-8:0]
      10 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/1]





      share|improve this answer















      Did you tried to examin what programs like iotop is showing? It will tell you exacly what kind of process is currently writing to the disk.



      example output:



      Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
      TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
      1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init
      2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd]
      3 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0]
      6 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0]
      7 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdog/0]
      8 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
      1033 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [flush-8:0]
      10 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/1]






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jul 27 '12 at 9:52

























      answered Jul 27 '12 at 8:27









      mnmncmnmnc

      4026 silver badges14 bronze badges




      4026 silver badges14 bronze badges











      • 1





        thanks for that tip. I didn't know about iotop. On Debian I did an apt-cache search iotop to find out that I had to apt-get iotop. Very cool command!

        – Cedric Martin
        Aug 2 '12 at 15:56






      • 3





        I use iotop -o -b -d 10 which every 10secs prints a list of processes that read/wrote to disk and the amount of IO bandwidth used.

        – ndemou
        Jun 20 '16 at 15:32
















      • 1





        thanks for that tip. I didn't know about iotop. On Debian I did an apt-cache search iotop to find out that I had to apt-get iotop. Very cool command!

        – Cedric Martin
        Aug 2 '12 at 15:56






      • 3





        I use iotop -o -b -d 10 which every 10secs prints a list of processes that read/wrote to disk and the amount of IO bandwidth used.

        – ndemou
        Jun 20 '16 at 15:32










      1




      1





      thanks for that tip. I didn't know about iotop. On Debian I did an apt-cache search iotop to find out that I had to apt-get iotop. Very cool command!

      – Cedric Martin
      Aug 2 '12 at 15:56





      thanks for that tip. I didn't know about iotop. On Debian I did an apt-cache search iotop to find out that I had to apt-get iotop. Very cool command!

      – Cedric Martin
      Aug 2 '12 at 15:56




      3




      3





      I use iotop -o -b -d 10 which every 10secs prints a list of processes that read/wrote to disk and the amount of IO bandwidth used.

      – ndemou
      Jun 20 '16 at 15:32







      I use iotop -o -b -d 10 which every 10secs prints a list of processes that read/wrote to disk and the amount of IO bandwidth used.

      – ndemou
      Jun 20 '16 at 15:32















      15














      You can enable IO debugging via echo 1 > /proc/sys/vm/block_dump and then watch the debugging messages in /var/log/syslog. This has the advantage of obtaining some type of log file with past activities whereas iotop only shows the current activity.






      share|improve this answer





















      • 3





        It is absolutely crazy to leave sysloging enabled when block_dump is active. Logging causes disk activity, which causes logging, which causes disk activity etc. Better stop syslog before enabling this (and use dmesg to read the messages)

        – dan3
        Jul 15 '13 at 8:32











      • You are absolutely right, although the effect isn't as dramatic as you describe it. If you just want to have a short peek at the disk activity there is no need to stop the syslog daemon.

        – scai
        Jul 16 '13 at 6:32











      • I've tried it about 2 years ago and it brought my machine to a halt. One of these days when I have nothing important running I'll try it again :)

        – dan3
        Jul 16 '13 at 7:22













      • I tried it, nothing really happened. Especially because of file system buffering. A write to syslog doesn't immediately trigger a write to disk.

        – scai
        Jul 16 '13 at 10:50






      • 1





        I would assume there is rate general rate limiting in place for the log messages, which handles this case too(?)

        – Volker Siegel
        Apr 16 '14 at 22:57
















      15














      You can enable IO debugging via echo 1 > /proc/sys/vm/block_dump and then watch the debugging messages in /var/log/syslog. This has the advantage of obtaining some type of log file with past activities whereas iotop only shows the current activity.






      share|improve this answer





















      • 3





        It is absolutely crazy to leave sysloging enabled when block_dump is active. Logging causes disk activity, which causes logging, which causes disk activity etc. Better stop syslog before enabling this (and use dmesg to read the messages)

        – dan3
        Jul 15 '13 at 8:32











      • You are absolutely right, although the effect isn't as dramatic as you describe it. If you just want to have a short peek at the disk activity there is no need to stop the syslog daemon.

        – scai
        Jul 16 '13 at 6:32











      • I've tried it about 2 years ago and it brought my machine to a halt. One of these days when I have nothing important running I'll try it again :)

        – dan3
        Jul 16 '13 at 7:22













      • I tried it, nothing really happened. Especially because of file system buffering. A write to syslog doesn't immediately trigger a write to disk.

        – scai
        Jul 16 '13 at 10:50






      • 1





        I would assume there is rate general rate limiting in place for the log messages, which handles this case too(?)

        – Volker Siegel
        Apr 16 '14 at 22:57














      15












      15








      15







      You can enable IO debugging via echo 1 > /proc/sys/vm/block_dump and then watch the debugging messages in /var/log/syslog. This has the advantage of obtaining some type of log file with past activities whereas iotop only shows the current activity.






      share|improve this answer













      You can enable IO debugging via echo 1 > /proc/sys/vm/block_dump and then watch the debugging messages in /var/log/syslog. This has the advantage of obtaining some type of log file with past activities whereas iotop only shows the current activity.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jul 27 '12 at 10:48









      scaiscai

      7,3452 gold badges19 silver badges35 bronze badges




      7,3452 gold badges19 silver badges35 bronze badges











      • 3





        It is absolutely crazy to leave sysloging enabled when block_dump is active. Logging causes disk activity, which causes logging, which causes disk activity etc. Better stop syslog before enabling this (and use dmesg to read the messages)

        – dan3
        Jul 15 '13 at 8:32











      • You are absolutely right, although the effect isn't as dramatic as you describe it. If you just want to have a short peek at the disk activity there is no need to stop the syslog daemon.

        – scai
        Jul 16 '13 at 6:32











      • I've tried it about 2 years ago and it brought my machine to a halt. One of these days when I have nothing important running I'll try it again :)

        – dan3
        Jul 16 '13 at 7:22













      • I tried it, nothing really happened. Especially because of file system buffering. A write to syslog doesn't immediately trigger a write to disk.

        – scai
        Jul 16 '13 at 10:50






      • 1





        I would assume there is rate general rate limiting in place for the log messages, which handles this case too(?)

        – Volker Siegel
        Apr 16 '14 at 22:57














      • 3





        It is absolutely crazy to leave sysloging enabled when block_dump is active. Logging causes disk activity, which causes logging, which causes disk activity etc. Better stop syslog before enabling this (and use dmesg to read the messages)

        – dan3
        Jul 15 '13 at 8:32











      • You are absolutely right, although the effect isn't as dramatic as you describe it. If you just want to have a short peek at the disk activity there is no need to stop the syslog daemon.

        – scai
        Jul 16 '13 at 6:32











      • I've tried it about 2 years ago and it brought my machine to a halt. One of these days when I have nothing important running I'll try it again :)

        – dan3
        Jul 16 '13 at 7:22













      • I tried it, nothing really happened. Especially because of file system buffering. A write to syslog doesn't immediately trigger a write to disk.

        – scai
        Jul 16 '13 at 10:50






      • 1





        I would assume there is rate general rate limiting in place for the log messages, which handles this case too(?)

        – Volker Siegel
        Apr 16 '14 at 22:57








      3




      3





      It is absolutely crazy to leave sysloging enabled when block_dump is active. Logging causes disk activity, which causes logging, which causes disk activity etc. Better stop syslog before enabling this (and use dmesg to read the messages)

      – dan3
      Jul 15 '13 at 8:32





      It is absolutely crazy to leave sysloging enabled when block_dump is active. Logging causes disk activity, which causes logging, which causes disk activity etc. Better stop syslog before enabling this (and use dmesg to read the messages)

      – dan3
      Jul 15 '13 at 8:32













      You are absolutely right, although the effect isn't as dramatic as you describe it. If you just want to have a short peek at the disk activity there is no need to stop the syslog daemon.

      – scai
      Jul 16 '13 at 6:32





      You are absolutely right, although the effect isn't as dramatic as you describe it. If you just want to have a short peek at the disk activity there is no need to stop the syslog daemon.

      – scai
      Jul 16 '13 at 6:32













      I've tried it about 2 years ago and it brought my machine to a halt. One of these days when I have nothing important running I'll try it again :)

      – dan3
      Jul 16 '13 at 7:22







      I've tried it about 2 years ago and it brought my machine to a halt. One of these days when I have nothing important running I'll try it again :)

      – dan3
      Jul 16 '13 at 7:22















      I tried it, nothing really happened. Especially because of file system buffering. A write to syslog doesn't immediately trigger a write to disk.

      – scai
      Jul 16 '13 at 10:50





      I tried it, nothing really happened. Especially because of file system buffering. A write to syslog doesn't immediately trigger a write to disk.

      – scai
      Jul 16 '13 at 10:50




      1




      1





      I would assume there is rate general rate limiting in place for the log messages, which handles this case too(?)

      – Volker Siegel
      Apr 16 '14 at 22:57





      I would assume there is rate general rate limiting in place for the log messages, which handles this case too(?)

      – Volker Siegel
      Apr 16 '14 at 22:57











      5














      Assuming that the disk noises are due to a process causing a write and not to some disk spindown problem, you can use the audit subsystem (install the auditd package). Put a watch on the sync calls and its friends:



      auditctl -S sync -S fsync -S fdatasync -a exit,always


      Watch the logs in /var/log/audit/audit.log. Be careful not to do this if the audit logs themselves are flushed! Check in /etc/auditd.conf that the flush option is set to none.



      If files are being flushed often, a likely culprit is the system logs. For example, if you log failed incoming connection attempts and someone is probing your machine, that will generate a lot of entries; this can cause a disk to emit machine gun-style noises. With the basic log daemon sysklogd, check /etc/syslog.conf: if a log file name is not be preceded by -, then that log is flushed to disk after each write.






      share|improve this answer




























      • @StephenKitt Huh. No. The asker mentioned Debian so I've changed it to a link to the Debian package.

        – Gilles
        Mar 23 '18 at 18:24
















      5














      Assuming that the disk noises are due to a process causing a write and not to some disk spindown problem, you can use the audit subsystem (install the auditd package). Put a watch on the sync calls and its friends:



      auditctl -S sync -S fsync -S fdatasync -a exit,always


      Watch the logs in /var/log/audit/audit.log. Be careful not to do this if the audit logs themselves are flushed! Check in /etc/auditd.conf that the flush option is set to none.



      If files are being flushed often, a likely culprit is the system logs. For example, if you log failed incoming connection attempts and someone is probing your machine, that will generate a lot of entries; this can cause a disk to emit machine gun-style noises. With the basic log daemon sysklogd, check /etc/syslog.conf: if a log file name is not be preceded by -, then that log is flushed to disk after each write.






      share|improve this answer




























      • @StephenKitt Huh. No. The asker mentioned Debian so I've changed it to a link to the Debian package.

        – Gilles
        Mar 23 '18 at 18:24














      5












      5








      5







      Assuming that the disk noises are due to a process causing a write and not to some disk spindown problem, you can use the audit subsystem (install the auditd package). Put a watch on the sync calls and its friends:



      auditctl -S sync -S fsync -S fdatasync -a exit,always


      Watch the logs in /var/log/audit/audit.log. Be careful not to do this if the audit logs themselves are flushed! Check in /etc/auditd.conf that the flush option is set to none.



      If files are being flushed often, a likely culprit is the system logs. For example, if you log failed incoming connection attempts and someone is probing your machine, that will generate a lot of entries; this can cause a disk to emit machine gun-style noises. With the basic log daemon sysklogd, check /etc/syslog.conf: if a log file name is not be preceded by -, then that log is flushed to disk after each write.






      share|improve this answer















      Assuming that the disk noises are due to a process causing a write and not to some disk spindown problem, you can use the audit subsystem (install the auditd package). Put a watch on the sync calls and its friends:



      auditctl -S sync -S fsync -S fdatasync -a exit,always


      Watch the logs in /var/log/audit/audit.log. Be careful not to do this if the audit logs themselves are flushed! Check in /etc/auditd.conf that the flush option is set to none.



      If files are being flushed often, a likely culprit is the system logs. For example, if you log failed incoming connection attempts and someone is probing your machine, that will generate a lot of entries; this can cause a disk to emit machine gun-style noises. With the basic log daemon sysklogd, check /etc/syslog.conf: if a log file name is not be preceded by -, then that log is flushed to disk after each write.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 23 '18 at 18:23

























      answered Jul 28 '12 at 1:34









      GillesGilles

      569k136 gold badges1174 silver badges1686 bronze badges




      569k136 gold badges1174 silver badges1686 bronze badges
















      • @StephenKitt Huh. No. The asker mentioned Debian so I've changed it to a link to the Debian package.

        – Gilles
        Mar 23 '18 at 18:24



















      • @StephenKitt Huh. No. The asker mentioned Debian so I've changed it to a link to the Debian package.

        – Gilles
        Mar 23 '18 at 18:24

















      @StephenKitt Huh. No. The asker mentioned Debian so I've changed it to a link to the Debian package.

      – Gilles
      Mar 23 '18 at 18:24





      @StephenKitt Huh. No. The asker mentioned Debian so I've changed it to a link to the Debian package.

      – Gilles
      Mar 23 '18 at 18:24











      3














      It might be your drives automatically spinning down, lots of consumer-grade drives do that these days. Unfortunately on even a lightly loaded system, this results in the drives constantly spinning down and then spinning up again, especially if you're running hddtemp or similar to monitor the drive temperature (most drives stupidly don't let you query the SMART temperature value without spinning up the drive - cretinous!).



      This is not only annoying, it can wear out the drives faster as many drives have only a limited number of park cycles. e.g. see https://bugs.launchpad.net/ubuntu/+source/hdparm/+bug/952556 for a description of the problem.



      I disable idle-spindown on all my drives with the following bit of shell code. you could put it in an /etc/rc.boot script, or in /etc/rc.local or similar.




      for disk in /dev/sd? ; do
      /sbin/hdparm -q -S 0 "$disk"
      done





      share|improve this answer























      • 2





        that you can't query SMART readings without spinning up the drive leaves me speechless :-/ Now obviously the "spinning down" issue can become quite complicated. Regarding disabling the spinning down: wouldn't that in itself cause the HD to wear out faster? I mean: it's never ever "resting" as long as the system is on then?

        – Cedric Martin
        Aug 2 '12 at 16:03











      • IIRC you can query some SMART values without causing the drive to spin up, but temperature isn't one of them on any of the drives i've tested (incl models from WD, Seagate, Samsung, Hitachi). Which is, of course, crazy because concern over temperature is one of the reasons for idling a drive. re: wear: AIUI 1. constant velocity is less wearing than changing speed. 2. the drives have to park the heads in a safe area and a drive is only rated to do that so many times (IIRC up to a few hundred thousand - easily exceeded if the drive is idling and spinning up every few seconds)

        – cas
        Aug 2 '12 at 21:42











      • It's a long debate regarding whether it's better to leave drives running or to spin them down. Personally I believe it's best to leave them running - I turn my computer off at night and when I go out but other than that I never spin my drives down. Some people prefer to spin them down, say, at night if they're leaving the computer on or if the computer's idle for a long time, and in such cases the advantage of spinning them down for a few hours versus leaving them running is debatable. What's never good though is when the hard drive repeatedly spins down and up again in a short period of time.

        – Micheal Johnson
        Mar 12 '16 at 20:48











      • Note also that spinning the drive down after it's been idle for a few hours is a bit silly, because if it's been idle for a few hours then it's likely to be used again within an hour. In that case, it would seem better to spin the drive down promptly if it's idle (like, within 10 minutes), but it's also possible for the drive to be idle for a few minutes when someone is using the computer and is likely to need the drive again soon.

        – Micheal Johnson
        Mar 12 '16 at 20:51











      • I thought sure this would fix my issue as I hear the drive make a periodic clacking sound (3-4 times/second) like it's writing even when it's not mounted! But I still hear the noise after running this command. Worryingly, it's the drive I use to back up my internal SSD...

        – Michael
        16 hours ago
















      3














      It might be your drives automatically spinning down, lots of consumer-grade drives do that these days. Unfortunately on even a lightly loaded system, this results in the drives constantly spinning down and then spinning up again, especially if you're running hddtemp or similar to monitor the drive temperature (most drives stupidly don't let you query the SMART temperature value without spinning up the drive - cretinous!).



      This is not only annoying, it can wear out the drives faster as many drives have only a limited number of park cycles. e.g. see https://bugs.launchpad.net/ubuntu/+source/hdparm/+bug/952556 for a description of the problem.



      I disable idle-spindown on all my drives with the following bit of shell code. you could put it in an /etc/rc.boot script, or in /etc/rc.local or similar.




      for disk in /dev/sd? ; do
      /sbin/hdparm -q -S 0 "$disk"
      done





      share|improve this answer























      • 2





        that you can't query SMART readings without spinning up the drive leaves me speechless :-/ Now obviously the "spinning down" issue can become quite complicated. Regarding disabling the spinning down: wouldn't that in itself cause the HD to wear out faster? I mean: it's never ever "resting" as long as the system is on then?

        – Cedric Martin
        Aug 2 '12 at 16:03











      • IIRC you can query some SMART values without causing the drive to spin up, but temperature isn't one of them on any of the drives i've tested (incl models from WD, Seagate, Samsung, Hitachi). Which is, of course, crazy because concern over temperature is one of the reasons for idling a drive. re: wear: AIUI 1. constant velocity is less wearing than changing speed. 2. the drives have to park the heads in a safe area and a drive is only rated to do that so many times (IIRC up to a few hundred thousand - easily exceeded if the drive is idling and spinning up every few seconds)

        – cas
        Aug 2 '12 at 21:42











      • It's a long debate regarding whether it's better to leave drives running or to spin them down. Personally I believe it's best to leave them running - I turn my computer off at night and when I go out but other than that I never spin my drives down. Some people prefer to spin them down, say, at night if they're leaving the computer on or if the computer's idle for a long time, and in such cases the advantage of spinning them down for a few hours versus leaving them running is debatable. What's never good though is when the hard drive repeatedly spins down and up again in a short period of time.

        – Micheal Johnson
        Mar 12 '16 at 20:48











      • Note also that spinning the drive down after it's been idle for a few hours is a bit silly, because if it's been idle for a few hours then it's likely to be used again within an hour. In that case, it would seem better to spin the drive down promptly if it's idle (like, within 10 minutes), but it's also possible for the drive to be idle for a few minutes when someone is using the computer and is likely to need the drive again soon.

        – Micheal Johnson
        Mar 12 '16 at 20:51











      • I thought sure this would fix my issue as I hear the drive make a periodic clacking sound (3-4 times/second) like it's writing even when it's not mounted! But I still hear the noise after running this command. Worryingly, it's the drive I use to back up my internal SSD...

        – Michael
        16 hours ago














      3












      3








      3







      It might be your drives automatically spinning down, lots of consumer-grade drives do that these days. Unfortunately on even a lightly loaded system, this results in the drives constantly spinning down and then spinning up again, especially if you're running hddtemp or similar to monitor the drive temperature (most drives stupidly don't let you query the SMART temperature value without spinning up the drive - cretinous!).



      This is not only annoying, it can wear out the drives faster as many drives have only a limited number of park cycles. e.g. see https://bugs.launchpad.net/ubuntu/+source/hdparm/+bug/952556 for a description of the problem.



      I disable idle-spindown on all my drives with the following bit of shell code. you could put it in an /etc/rc.boot script, or in /etc/rc.local or similar.




      for disk in /dev/sd? ; do
      /sbin/hdparm -q -S 0 "$disk"
      done





      share|improve this answer















      It might be your drives automatically spinning down, lots of consumer-grade drives do that these days. Unfortunately on even a lightly loaded system, this results in the drives constantly spinning down and then spinning up again, especially if you're running hddtemp or similar to monitor the drive temperature (most drives stupidly don't let you query the SMART temperature value without spinning up the drive - cretinous!).



      This is not only annoying, it can wear out the drives faster as many drives have only a limited number of park cycles. e.g. see https://bugs.launchpad.net/ubuntu/+source/hdparm/+bug/952556 for a description of the problem.



      I disable idle-spindown on all my drives with the following bit of shell code. you could put it in an /etc/rc.boot script, or in /etc/rc.local or similar.




      for disk in /dev/sd? ; do
      /sbin/hdparm -q -S 0 "$disk"
      done






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited 15 hours ago

























      answered Jul 27 '12 at 9:40









      cascas

      41.2k4 gold badges59 silver badges110 bronze badges




      41.2k4 gold badges59 silver badges110 bronze badges











      • 2





        that you can't query SMART readings without spinning up the drive leaves me speechless :-/ Now obviously the "spinning down" issue can become quite complicated. Regarding disabling the spinning down: wouldn't that in itself cause the HD to wear out faster? I mean: it's never ever "resting" as long as the system is on then?

        – Cedric Martin
        Aug 2 '12 at 16:03











      • IIRC you can query some SMART values without causing the drive to spin up, but temperature isn't one of them on any of the drives i've tested (incl models from WD, Seagate, Samsung, Hitachi). Which is, of course, crazy because concern over temperature is one of the reasons for idling a drive. re: wear: AIUI 1. constant velocity is less wearing than changing speed. 2. the drives have to park the heads in a safe area and a drive is only rated to do that so many times (IIRC up to a few hundred thousand - easily exceeded if the drive is idling and spinning up every few seconds)

        – cas
        Aug 2 '12 at 21:42











      • It's a long debate regarding whether it's better to leave drives running or to spin them down. Personally I believe it's best to leave them running - I turn my computer off at night and when I go out but other than that I never spin my drives down. Some people prefer to spin them down, say, at night if they're leaving the computer on or if the computer's idle for a long time, and in such cases the advantage of spinning them down for a few hours versus leaving them running is debatable. What's never good though is when the hard drive repeatedly spins down and up again in a short period of time.

        – Micheal Johnson
        Mar 12 '16 at 20:48











      • Note also that spinning the drive down after it's been idle for a few hours is a bit silly, because if it's been idle for a few hours then it's likely to be used again within an hour. In that case, it would seem better to spin the drive down promptly if it's idle (like, within 10 minutes), but it's also possible for the drive to be idle for a few minutes when someone is using the computer and is likely to need the drive again soon.

        – Micheal Johnson
        Mar 12 '16 at 20:51











      • I thought sure this would fix my issue as I hear the drive make a periodic clacking sound (3-4 times/second) like it's writing even when it's not mounted! But I still hear the noise after running this command. Worryingly, it's the drive I use to back up my internal SSD...

        – Michael
        16 hours ago














      • 2





        that you can't query SMART readings without spinning up the drive leaves me speechless :-/ Now obviously the "spinning down" issue can become quite complicated. Regarding disabling the spinning down: wouldn't that in itself cause the HD to wear out faster? I mean: it's never ever "resting" as long as the system is on then?

        – Cedric Martin
        Aug 2 '12 at 16:03











      • IIRC you can query some SMART values without causing the drive to spin up, but temperature isn't one of them on any of the drives i've tested (incl models from WD, Seagate, Samsung, Hitachi). Which is, of course, crazy because concern over temperature is one of the reasons for idling a drive. re: wear: AIUI 1. constant velocity is less wearing than changing speed. 2. the drives have to park the heads in a safe area and a drive is only rated to do that so many times (IIRC up to a few hundred thousand - easily exceeded if the drive is idling and spinning up every few seconds)

        – cas
        Aug 2 '12 at 21:42











      • It's a long debate regarding whether it's better to leave drives running or to spin them down. Personally I believe it's best to leave them running - I turn my computer off at night and when I go out but other than that I never spin my drives down. Some people prefer to spin them down, say, at night if they're leaving the computer on or if the computer's idle for a long time, and in such cases the advantage of spinning them down for a few hours versus leaving them running is debatable. What's never good though is when the hard drive repeatedly spins down and up again in a short period of time.

        – Micheal Johnson
        Mar 12 '16 at 20:48











      • Note also that spinning the drive down after it's been idle for a few hours is a bit silly, because if it's been idle for a few hours then it's likely to be used again within an hour. In that case, it would seem better to spin the drive down promptly if it's idle (like, within 10 minutes), but it's also possible for the drive to be idle for a few minutes when someone is using the computer and is likely to need the drive again soon.

        – Micheal Johnson
        Mar 12 '16 at 20:51











      • I thought sure this would fix my issue as I hear the drive make a periodic clacking sound (3-4 times/second) like it's writing even when it's not mounted! But I still hear the noise after running this command. Worryingly, it's the drive I use to back up my internal SSD...

        – Michael
        16 hours ago








      2




      2





      that you can't query SMART readings without spinning up the drive leaves me speechless :-/ Now obviously the "spinning down" issue can become quite complicated. Regarding disabling the spinning down: wouldn't that in itself cause the HD to wear out faster? I mean: it's never ever "resting" as long as the system is on then?

      – Cedric Martin
      Aug 2 '12 at 16:03





      that you can't query SMART readings without spinning up the drive leaves me speechless :-/ Now obviously the "spinning down" issue can become quite complicated. Regarding disabling the spinning down: wouldn't that in itself cause the HD to wear out faster? I mean: it's never ever "resting" as long as the system is on then?

      – Cedric Martin
      Aug 2 '12 at 16:03













      IIRC you can query some SMART values without causing the drive to spin up, but temperature isn't one of them on any of the drives i've tested (incl models from WD, Seagate, Samsung, Hitachi). Which is, of course, crazy because concern over temperature is one of the reasons for idling a drive. re: wear: AIUI 1. constant velocity is less wearing than changing speed. 2. the drives have to park the heads in a safe area and a drive is only rated to do that so many times (IIRC up to a few hundred thousand - easily exceeded if the drive is idling and spinning up every few seconds)

      – cas
      Aug 2 '12 at 21:42





      IIRC you can query some SMART values without causing the drive to spin up, but temperature isn't one of them on any of the drives i've tested (incl models from WD, Seagate, Samsung, Hitachi). Which is, of course, crazy because concern over temperature is one of the reasons for idling a drive. re: wear: AIUI 1. constant velocity is less wearing than changing speed. 2. the drives have to park the heads in a safe area and a drive is only rated to do that so many times (IIRC up to a few hundred thousand - easily exceeded if the drive is idling and spinning up every few seconds)

      – cas
      Aug 2 '12 at 21:42













      It's a long debate regarding whether it's better to leave drives running or to spin them down. Personally I believe it's best to leave them running - I turn my computer off at night and when I go out but other than that I never spin my drives down. Some people prefer to spin them down, say, at night if they're leaving the computer on or if the computer's idle for a long time, and in such cases the advantage of spinning them down for a few hours versus leaving them running is debatable. What's never good though is when the hard drive repeatedly spins down and up again in a short period of time.

      – Micheal Johnson
      Mar 12 '16 at 20:48





      It's a long debate regarding whether it's better to leave drives running or to spin them down. Personally I believe it's best to leave them running - I turn my computer off at night and when I go out but other than that I never spin my drives down. Some people prefer to spin them down, say, at night if they're leaving the computer on or if the computer's idle for a long time, and in such cases the advantage of spinning them down for a few hours versus leaving them running is debatable. What's never good though is when the hard drive repeatedly spins down and up again in a short period of time.

      – Micheal Johnson
      Mar 12 '16 at 20:48













      Note also that spinning the drive down after it's been idle for a few hours is a bit silly, because if it's been idle for a few hours then it's likely to be used again within an hour. In that case, it would seem better to spin the drive down promptly if it's idle (like, within 10 minutes), but it's also possible for the drive to be idle for a few minutes when someone is using the computer and is likely to need the drive again soon.

      – Micheal Johnson
      Mar 12 '16 at 20:51





      Note also that spinning the drive down after it's been idle for a few hours is a bit silly, because if it's been idle for a few hours then it's likely to be used again within an hour. In that case, it would seem better to spin the drive down promptly if it's idle (like, within 10 minutes), but it's also possible for the drive to be idle for a few minutes when someone is using the computer and is likely to need the drive again soon.

      – Micheal Johnson
      Mar 12 '16 at 20:51













      I thought sure this would fix my issue as I hear the drive make a periodic clacking sound (3-4 times/second) like it's writing even when it's not mounted! But I still hear the noise after running this command. Worryingly, it's the drive I use to back up my internal SSD...

      – Michael
      16 hours ago





      I thought sure this would fix my issue as I hear the drive make a periodic clacking sound (3-4 times/second) like it's writing even when it's not mounted! But I still hear the noise after running this command. Worryingly, it's the drive I use to back up my internal SSD...

      – Michael
      16 hours ago











      1














      I just found that s.m.a.r.t was causing an external USB disk to spin up again and again on my raspberry pi. Although SMART is generally a good thing, I decided to disable it again and since then it seems that unwanted disk activity has stopped






      share|improve this answer


























      • You can configure smart daemon not to scan USB disks, most good linux distributions do this by default.

        – lzap
        Jun 15 '17 at 11:19
















      1














      I just found that s.m.a.r.t was causing an external USB disk to spin up again and again on my raspberry pi. Although SMART is generally a good thing, I decided to disable it again and since then it seems that unwanted disk activity has stopped






      share|improve this answer


























      • You can configure smart daemon not to scan USB disks, most good linux distributions do this by default.

        – lzap
        Jun 15 '17 at 11:19














      1












      1








      1







      I just found that s.m.a.r.t was causing an external USB disk to spin up again and again on my raspberry pi. Although SMART is generally a good thing, I decided to disable it again and since then it seems that unwanted disk activity has stopped






      share|improve this answer













      I just found that s.m.a.r.t was causing an external USB disk to spin up again and again on my raspberry pi. Although SMART is generally a good thing, I decided to disable it again and since then it seems that unwanted disk activity has stopped







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Oct 27 '15 at 8:16









      jrojro

      111 bronze badge




      111 bronze badge
















      • You can configure smart daemon not to scan USB disks, most good linux distributions do this by default.

        – lzap
        Jun 15 '17 at 11:19



















      • You can configure smart daemon not to scan USB disks, most good linux distributions do this by default.

        – lzap
        Jun 15 '17 at 11:19

















      You can configure smart daemon not to scan USB disks, most good linux distributions do this by default.

      – lzap
      Jun 15 '17 at 11:19





      You can configure smart daemon not to scan USB disks, most good linux distributions do this by default.

      – lzap
      Jun 15 '17 at 11:19











      1














      You can wack on this a bit. Should narrow it down for most.



      find / -mount -newer /proc -print


      Give files modified since boot on the physical device of the / files system. Knowing the files will likely help identify the writer.






      share|improve this answer
































        1














        You can wack on this a bit. Should narrow it down for most.



        find / -mount -newer /proc -print


        Give files modified since boot on the physical device of the / files system. Knowing the files will likely help identify the writer.






        share|improve this answer






























          1












          1








          1







          You can wack on this a bit. Should narrow it down for most.



          find / -mount -newer /proc -print


          Give files modified since boot on the physical device of the / files system. Knowing the files will likely help identify the writer.






          share|improve this answer















          You can wack on this a bit. Should narrow it down for most.



          find / -mount -newer /proc -print


          Give files modified since boot on the physical device of the / files system. Knowing the files will likely help identify the writer.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 18 '16 at 23:06









          techraf

          4,36310 gold badges23 silver badges43 bronze badges




          4,36310 gold badges23 silver badges43 bronze badges










          answered Sep 18 '16 at 22:37









          user190618user190618

          111 bronze badge




          111 bronze badge


























              1














              In case you need to narrow it down to an exact disk use the following:



              run lsblk and look up the device number. In the case below it is 9:126



              NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
              sda 8:0 0 7.3T 0 disk
              └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
              sdb 8:16 0 7.3T 0 disk
              └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
              sdc 8:32 0 7.3T 0 disk
              └─sdc1 8:33 0 7.3T 0 part /mnt/InternalFBE


              run lsof | grep '9,126' with the : replace with , compared to the above disk number. In my case this shows up as:



              bash      389162            root  cwd       DIR              9,126      4096  449183796 /mnt/InternalPhase/0000000001/CHANNEL01/LIVE/PHASE/DATA/2018/10/04


              with the PID of 389162 kill this process using:



              kill -9 389162





              share|improve this answer






























                1














                In case you need to narrow it down to an exact disk use the following:



                run lsblk and look up the device number. In the case below it is 9:126



                NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
                sda 8:0 0 7.3T 0 disk
                └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
                sdb 8:16 0 7.3T 0 disk
                └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
                sdc 8:32 0 7.3T 0 disk
                └─sdc1 8:33 0 7.3T 0 part /mnt/InternalFBE


                run lsof | grep '9,126' with the : replace with , compared to the above disk number. In my case this shows up as:



                bash      389162            root  cwd       DIR              9,126      4096  449183796 /mnt/InternalPhase/0000000001/CHANNEL01/LIVE/PHASE/DATA/2018/10/04


                with the PID of 389162 kill this process using:



                kill -9 389162





                share|improve this answer




























                  1












                  1








                  1







                  In case you need to narrow it down to an exact disk use the following:



                  run lsblk and look up the device number. In the case below it is 9:126



                  NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
                  sda 8:0 0 7.3T 0 disk
                  └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
                  sdb 8:16 0 7.3T 0 disk
                  └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
                  sdc 8:32 0 7.3T 0 disk
                  └─sdc1 8:33 0 7.3T 0 part /mnt/InternalFBE


                  run lsof | grep '9,126' with the : replace with , compared to the above disk number. In my case this shows up as:



                  bash      389162            root  cwd       DIR              9,126      4096  449183796 /mnt/InternalPhase/0000000001/CHANNEL01/LIVE/PHASE/DATA/2018/10/04


                  with the PID of 389162 kill this process using:



                  kill -9 389162





                  share|improve this answer













                  In case you need to narrow it down to an exact disk use the following:



                  run lsblk and look up the device number. In the case below it is 9:126



                  NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
                  sda 8:0 0 7.3T 0 disk
                  └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
                  sdb 8:16 0 7.3T 0 disk
                  └─md126 9:126 0 13.8T 0 raid0 /mnt/InternalPhase
                  sdc 8:32 0 7.3T 0 disk
                  └─sdc1 8:33 0 7.3T 0 part /mnt/InternalFBE


                  run lsof | grep '9,126' with the : replace with , compared to the above disk number. In my case this shows up as:



                  bash      389162            root  cwd       DIR              9,126      4096  449183796 /mnt/InternalPhase/0000000001/CHANNEL01/LIVE/PHASE/DATA/2018/10/04


                  with the PID of 389162 kill this process using:



                  kill -9 389162






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 4 '18 at 13:28









                  Jacques MALAPRADEJacques MALAPRADE

                  1235 bronze badges




                  1235 bronze badges


























                      -1














                      The problem is that the system needs to flush data from the disk buffers to the disk ever 5 seconds or so by default. Thus if the disk does spin down, there will be little option other than to spin back up again when a flush needs to happen. So the problem is not really avoidable other than by disabling spins downs or disk power management features altogether hdparm -B 255 /dev/hdax. This is probably the better option since restarting so often can definitely be more damaging than simply staying on all the time.






                      share|improve this answer





















                      • 1





                        It's only going to flush data if there's any data to flush. If the disk is really not in use, then there isn't going to be any buffered data to flush.

                        – Micheal Johnson
                        Mar 12 '16 at 20:53
















                      -1














                      The problem is that the system needs to flush data from the disk buffers to the disk ever 5 seconds or so by default. Thus if the disk does spin down, there will be little option other than to spin back up again when a flush needs to happen. So the problem is not really avoidable other than by disabling spins downs or disk power management features altogether hdparm -B 255 /dev/hdax. This is probably the better option since restarting so often can definitely be more damaging than simply staying on all the time.






                      share|improve this answer





















                      • 1





                        It's only going to flush data if there's any data to flush. If the disk is really not in use, then there isn't going to be any buffered data to flush.

                        – Micheal Johnson
                        Mar 12 '16 at 20:53














                      -1












                      -1








                      -1







                      The problem is that the system needs to flush data from the disk buffers to the disk ever 5 seconds or so by default. Thus if the disk does spin down, there will be little option other than to spin back up again when a flush needs to happen. So the problem is not really avoidable other than by disabling spins downs or disk power management features altogether hdparm -B 255 /dev/hdax. This is probably the better option since restarting so often can definitely be more damaging than simply staying on all the time.






                      share|improve this answer













                      The problem is that the system needs to flush data from the disk buffers to the disk ever 5 seconds or so by default. Thus if the disk does spin down, there will be little option other than to spin back up again when a flush needs to happen. So the problem is not really avoidable other than by disabling spins downs or disk power management features altogether hdparm -B 255 /dev/hdax. This is probably the better option since restarting so often can definitely be more damaging than simply staying on all the time.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered May 9 '13 at 10:36









                      paul reynoldspaul reynolds

                      1




                      1











                      • 1





                        It's only going to flush data if there's any data to flush. If the disk is really not in use, then there isn't going to be any buffered data to flush.

                        – Micheal Johnson
                        Mar 12 '16 at 20:53














                      • 1





                        It's only going to flush data if there's any data to flush. If the disk is really not in use, then there isn't going to be any buffered data to flush.

                        – Micheal Johnson
                        Mar 12 '16 at 20:53








                      1




                      1





                      It's only going to flush data if there's any data to flush. If the disk is really not in use, then there isn't going to be any buffered data to flush.

                      – Micheal Johnson
                      Mar 12 '16 at 20:53





                      It's only going to flush data if there's any data to flush. If the disk is really not in use, then there isn't going to be any buffered data to flush.

                      – Micheal Johnson
                      Mar 12 '16 at 20:53


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f44103%2fhow-to-find-which-process-is-regularly-writing-to-disk%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                      Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                      Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...