Finding out what is spinning up harddriveGNU/Linux, IO performance problemsHiding an encrypted folder in a...

Do you need to burn fuel between gravity assists?

Complex conjugate and transpose "with respect to a basis"

How can faith be maintained in a world of living gods?

Can taking my 1-week-old on a 6-7 hours journey in the car lead to medical complications?

Why would an airport be depicted with symbology for runways longer than 8,069 feet even though it is reported on the sectional as 7,200 feet?

Why would an AC motor heavily shake when driven with certain frequencies?

How do English-speaking kids loudly request something?

Return only the number of paired values in array javascript

What's the biggest difference between these two photos?

How do we create our own symbolisms?

How can I hint that my character isn't real?

Galilean transformation vs simple translation

Leaving the USA for 10 yrs when you have asylum

Is there a way to deal with desistance in a off-chain game?

The Green Glass Door, Revisited

Is mountain bike good for long distances?

Do aarakocra have arms as well as wings?

Automatically end list item with proper punctuation (semicolon, period)

Infinitely many primes

The meaning of "offing" in "an agreement in the offing"

Is there a "right" way to interpret a novel, if not, how do we make sure our novel is interpreted correctly?

Poor management handling of recent sickness and how to approach my return?

Is future tense in English really a myth?

Strategies for dealing with chess burnout?



Finding out what is spinning up harddrive


GNU/Linux, IO performance problemsHiding an encrypted folder in a shared system without root access (unshare -m)What is spinning my disk up periodically?Disks (in usb enclosure) keep waking up even when not mountedEntire Harddrive to linux swapMy HDD is constantly spinningWhat is writing/reading to a mounted share in a VirtualBox Linux guestHow to Know What Filesystem External Harddrive is UsingLogging/tracking-down process that auto-reboots CentOS server at boot timeStop spinning down internal disk






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







9















I am the owner of a NAS, running some Linux distribution. It comes with a web administration frontend, where I can manage several services, user rights and also when it should go to sleep. My problem is, for some reason, when the NAS has gone to sleep, the hard drive turns on again after a couple of minutes. Then it will spin for some time, then sleep again. This keeps going on indefinitely.



How can I try to determine the cause for this? I am very new to Linux, but I managed to get root access, and now have a SSH connection.










share|improve this question



























  • This is very old, but may still have relevant tips.

    – Gilles
    Jan 19 '12 at 0:36











  • Do you have some analytics /like plugin with the web/frontend interface to NAS box? what are the NAS box details? I am wondering if some systemtap tools can be employed in there to check out the disk activity. systemtap is only available for later versions of Linux kernel.

    – Nikhil Mulley
    Jan 19 '12 at 6:16













  • The NAS is a Lacie d2 Network 2. There is no plugin options, but i guess i could load anything into it. It runs a Green Unicorn webserver. The kernel is 2.6.31.14-svn6790.

    – Andreas
    Jan 19 '12 at 17:38


















9















I am the owner of a NAS, running some Linux distribution. It comes with a web administration frontend, where I can manage several services, user rights and also when it should go to sleep. My problem is, for some reason, when the NAS has gone to sleep, the hard drive turns on again after a couple of minutes. Then it will spin for some time, then sleep again. This keeps going on indefinitely.



How can I try to determine the cause for this? I am very new to Linux, but I managed to get root access, and now have a SSH connection.










share|improve this question



























  • This is very old, but may still have relevant tips.

    – Gilles
    Jan 19 '12 at 0:36











  • Do you have some analytics /like plugin with the web/frontend interface to NAS box? what are the NAS box details? I am wondering if some systemtap tools can be employed in there to check out the disk activity. systemtap is only available for later versions of Linux kernel.

    – Nikhil Mulley
    Jan 19 '12 at 6:16













  • The NAS is a Lacie d2 Network 2. There is no plugin options, but i guess i could load anything into it. It runs a Green Unicorn webserver. The kernel is 2.6.31.14-svn6790.

    – Andreas
    Jan 19 '12 at 17:38














9












9








9


4






I am the owner of a NAS, running some Linux distribution. It comes with a web administration frontend, where I can manage several services, user rights and also when it should go to sleep. My problem is, for some reason, when the NAS has gone to sleep, the hard drive turns on again after a couple of minutes. Then it will spin for some time, then sleep again. This keeps going on indefinitely.



How can I try to determine the cause for this? I am very new to Linux, but I managed to get root access, and now have a SSH connection.










share|improve this question
















I am the owner of a NAS, running some Linux distribution. It comes with a web administration frontend, where I can manage several services, user rights and also when it should go to sleep. My problem is, for some reason, when the NAS has gone to sleep, the hard drive turns on again after a couple of minutes. Then it will spin for some time, then sleep again. This keeps going on indefinitely.



How can I try to determine the cause for this? I am very new to Linux, but I managed to get root access, and now have a SSH connection.







linux hard-disk






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 20 '12 at 16:47









Kevin

29.2k11 gold badges69 silver badges105 bronze badges




29.2k11 gold badges69 silver badges105 bronze badges










asked Jan 19 '12 at 0:00









AndreasAndreas

1481 gold badge1 silver badge3 bronze badges




1481 gold badge1 silver badge3 bronze badges
















  • This is very old, but may still have relevant tips.

    – Gilles
    Jan 19 '12 at 0:36











  • Do you have some analytics /like plugin with the web/frontend interface to NAS box? what are the NAS box details? I am wondering if some systemtap tools can be employed in there to check out the disk activity. systemtap is only available for later versions of Linux kernel.

    – Nikhil Mulley
    Jan 19 '12 at 6:16













  • The NAS is a Lacie d2 Network 2. There is no plugin options, but i guess i could load anything into it. It runs a Green Unicorn webserver. The kernel is 2.6.31.14-svn6790.

    – Andreas
    Jan 19 '12 at 17:38



















  • This is very old, but may still have relevant tips.

    – Gilles
    Jan 19 '12 at 0:36











  • Do you have some analytics /like plugin with the web/frontend interface to NAS box? what are the NAS box details? I am wondering if some systemtap tools can be employed in there to check out the disk activity. systemtap is only available for later versions of Linux kernel.

    – Nikhil Mulley
    Jan 19 '12 at 6:16













  • The NAS is a Lacie d2 Network 2. There is no plugin options, but i guess i could load anything into it. It runs a Green Unicorn webserver. The kernel is 2.6.31.14-svn6790.

    – Andreas
    Jan 19 '12 at 17:38

















This is very old, but may still have relevant tips.

– Gilles
Jan 19 '12 at 0:36





This is very old, but may still have relevant tips.

– Gilles
Jan 19 '12 at 0:36













Do you have some analytics /like plugin with the web/frontend interface to NAS box? what are the NAS box details? I am wondering if some systemtap tools can be employed in there to check out the disk activity. systemtap is only available for later versions of Linux kernel.

– Nikhil Mulley
Jan 19 '12 at 6:16







Do you have some analytics /like plugin with the web/frontend interface to NAS box? what are the NAS box details? I am wondering if some systemtap tools can be employed in there to check out the disk activity. systemtap is only available for later versions of Linux kernel.

– Nikhil Mulley
Jan 19 '12 at 6:16















The NAS is a Lacie d2 Network 2. There is no plugin options, but i guess i could load anything into it. It runs a Green Unicorn webserver. The kernel is 2.6.31.14-svn6790.

– Andreas
Jan 19 '12 at 17:38





The NAS is a Lacie d2 Network 2. There is no plugin options, but i guess i could load anything into it. It runs a Green Unicorn webserver. The kernel is 2.6.31.14-svn6790.

– Andreas
Jan 19 '12 at 17:38










4 Answers
4






active

oldest

votes


















6
















inotify-tools is a simple way of doing this. There are several examples on their site that would be able to do what you want (see the inotifywatch example for a really basic one).






share|improve this answer




























  • I am currently looking into this. First, i need to compile the source for an ARMv5TE cpu. That might prove to be difficult enough :)

    – Andreas
    Jan 19 '12 at 17:34



















6
















Try running iotop perhaps? I've found it useful in the past.






share|improve this answer



































    2
















    Another tip: Use Systemtap, there are bunch of probe scripts on systemtap's site useful enough to find the culprit.



    In another case altogether,



    If you want to find out which process caused the disk to spin up, you can
    gather information by setting the flag /proc/sys/vm/block_dump.
    When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk
    needs to spin up, and to increase battery life even more. The output of
    block_dump is written to the kernel output, and it can be retrieved using
    "dmesg" or look at your syslog kern facility for the destination of the debug messages. Generally, it should be /var/log/debug . When you use block_dump and your kernel logging level also includes
    kernel debugging messages, you probably want to turn off klogd, otherwise
    the output of block_dump will be logged, causing disk activity that is not
    normally there.






    share|improve this answer

































      2
















      You need to tell the kernel to inform you of all the reads/writes to disks, then you need to look at that information.



      So:



      # sync
      # echo 1 > /proc/sys/vm/block_dump
      # dmesg -c | grep '/dev/sda'


      sync flushes all pending writes to disks, so that you'll only see new reads or writes.
      dmesg -c shows you the kernel messages, and clears them (otherwise you see the old ones too, each time you run dmesg).
      grep filters the output of dmesg for activity for the disk you're interested in. Replace /dev/sda with your actual device.



      I usually use something like this to spin down the disk, then check for when it spins up again:



      # sync
      # hdparm -y /dev/sda
      # while true; do hdparm -C /dev/sda ; sleep 600 ; done


      The while loop checks the disk active/idle status every 10 minutes. When you see it power up, run the dmesg line above to see whodunnit.






      share|improve this answer




























        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/4.0/"u003ecc by-sa 4.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%2f29409%2ffinding-out-what-is-spinning-up-harddrive%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        6
















        inotify-tools is a simple way of doing this. There are several examples on their site that would be able to do what you want (see the inotifywatch example for a really basic one).






        share|improve this answer




























        • I am currently looking into this. First, i need to compile the source for an ARMv5TE cpu. That might prove to be difficult enough :)

          – Andreas
          Jan 19 '12 at 17:34
















        6
















        inotify-tools is a simple way of doing this. There are several examples on their site that would be able to do what you want (see the inotifywatch example for a really basic one).






        share|improve this answer




























        • I am currently looking into this. First, i need to compile the source for an ARMv5TE cpu. That might prove to be difficult enough :)

          – Andreas
          Jan 19 '12 at 17:34














        6














        6










        6









        inotify-tools is a simple way of doing this. There are several examples on their site that would be able to do what you want (see the inotifywatch example for a really basic one).






        share|improve this answer















        inotify-tools is a simple way of doing this. There are several examples on their site that would be able to do what you want (see the inotifywatch example for a really basic one).







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 46 mins ago









        Ward Muylaert

        1114 bronze badges




        1114 bronze badges










        answered Jan 19 '12 at 0:13









        PatrickPatrick

        53.9k12 gold badges141 silver badges189 bronze badges




        53.9k12 gold badges141 silver badges189 bronze badges
















        • I am currently looking into this. First, i need to compile the source for an ARMv5TE cpu. That might prove to be difficult enough :)

          – Andreas
          Jan 19 '12 at 17:34



















        • I am currently looking into this. First, i need to compile the source for an ARMv5TE cpu. That might prove to be difficult enough :)

          – Andreas
          Jan 19 '12 at 17:34

















        I am currently looking into this. First, i need to compile the source for an ARMv5TE cpu. That might prove to be difficult enough :)

        – Andreas
        Jan 19 '12 at 17:34





        I am currently looking into this. First, i need to compile the source for an ARMv5TE cpu. That might prove to be difficult enough :)

        – Andreas
        Jan 19 '12 at 17:34













        6
















        Try running iotop perhaps? I've found it useful in the past.






        share|improve this answer
































          6
















          Try running iotop perhaps? I've found it useful in the past.






          share|improve this answer






























            6














            6










            6









            Try running iotop perhaps? I've found it useful in the past.






            share|improve this answer















            Try running iotop perhaps? I've found it useful in the past.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 20 '12 at 19:53

























            answered Jan 20 '12 at 16:09









            Faheem MithaFaheem Mitha

            24.1k18 gold badges88 silver badges140 bronze badges




            24.1k18 gold badges88 silver badges140 bronze badges


























                2
















                Another tip: Use Systemtap, there are bunch of probe scripts on systemtap's site useful enough to find the culprit.



                In another case altogether,



                If you want to find out which process caused the disk to spin up, you can
                gather information by setting the flag /proc/sys/vm/block_dump.
                When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk
                needs to spin up, and to increase battery life even more. The output of
                block_dump is written to the kernel output, and it can be retrieved using
                "dmesg" or look at your syslog kern facility for the destination of the debug messages. Generally, it should be /var/log/debug . When you use block_dump and your kernel logging level also includes
                kernel debugging messages, you probably want to turn off klogd, otherwise
                the output of block_dump will be logged, causing disk activity that is not
                normally there.






                share|improve this answer






























                  2
















                  Another tip: Use Systemtap, there are bunch of probe scripts on systemtap's site useful enough to find the culprit.



                  In another case altogether,



                  If you want to find out which process caused the disk to spin up, you can
                  gather information by setting the flag /proc/sys/vm/block_dump.
                  When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk
                  needs to spin up, and to increase battery life even more. The output of
                  block_dump is written to the kernel output, and it can be retrieved using
                  "dmesg" or look at your syslog kern facility for the destination of the debug messages. Generally, it should be /var/log/debug . When you use block_dump and your kernel logging level also includes
                  kernel debugging messages, you probably want to turn off klogd, otherwise
                  the output of block_dump will be logged, causing disk activity that is not
                  normally there.






                  share|improve this answer




























                    2














                    2










                    2









                    Another tip: Use Systemtap, there are bunch of probe scripts on systemtap's site useful enough to find the culprit.



                    In another case altogether,



                    If you want to find out which process caused the disk to spin up, you can
                    gather information by setting the flag /proc/sys/vm/block_dump.
                    When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk
                    needs to spin up, and to increase battery life even more. The output of
                    block_dump is written to the kernel output, and it can be retrieved using
                    "dmesg" or look at your syslog kern facility for the destination of the debug messages. Generally, it should be /var/log/debug . When you use block_dump and your kernel logging level also includes
                    kernel debugging messages, you probably want to turn off klogd, otherwise
                    the output of block_dump will be logged, causing disk activity that is not
                    normally there.






                    share|improve this answer













                    Another tip: Use Systemtap, there are bunch of probe scripts on systemtap's site useful enough to find the culprit.



                    In another case altogether,



                    If you want to find out which process caused the disk to spin up, you can
                    gather information by setting the flag /proc/sys/vm/block_dump.
                    When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk
                    needs to spin up, and to increase battery life even more. The output of
                    block_dump is written to the kernel output, and it can be retrieved using
                    "dmesg" or look at your syslog kern facility for the destination of the debug messages. Generally, it should be /var/log/debug . When you use block_dump and your kernel logging level also includes
                    kernel debugging messages, you probably want to turn off klogd, otherwise
                    the output of block_dump will be logged, causing disk activity that is not
                    normally there.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jan 20 '12 at 16:22









                    Nikhil MulleyNikhil Mulley

                    6,62622 silver badges45 bronze badges




                    6,62622 silver badges45 bronze badges


























                        2
















                        You need to tell the kernel to inform you of all the reads/writes to disks, then you need to look at that information.



                        So:



                        # sync
                        # echo 1 > /proc/sys/vm/block_dump
                        # dmesg -c | grep '/dev/sda'


                        sync flushes all pending writes to disks, so that you'll only see new reads or writes.
                        dmesg -c shows you the kernel messages, and clears them (otherwise you see the old ones too, each time you run dmesg).
                        grep filters the output of dmesg for activity for the disk you're interested in. Replace /dev/sda with your actual device.



                        I usually use something like this to spin down the disk, then check for when it spins up again:



                        # sync
                        # hdparm -y /dev/sda
                        # while true; do hdparm -C /dev/sda ; sleep 600 ; done


                        The while loop checks the disk active/idle status every 10 minutes. When you see it power up, run the dmesg line above to see whodunnit.






                        share|improve this answer






























                          2
















                          You need to tell the kernel to inform you of all the reads/writes to disks, then you need to look at that information.



                          So:



                          # sync
                          # echo 1 > /proc/sys/vm/block_dump
                          # dmesg -c | grep '/dev/sda'


                          sync flushes all pending writes to disks, so that you'll only see new reads or writes.
                          dmesg -c shows you the kernel messages, and clears them (otherwise you see the old ones too, each time you run dmesg).
                          grep filters the output of dmesg for activity for the disk you're interested in. Replace /dev/sda with your actual device.



                          I usually use something like this to spin down the disk, then check for when it spins up again:



                          # sync
                          # hdparm -y /dev/sda
                          # while true; do hdparm -C /dev/sda ; sleep 600 ; done


                          The while loop checks the disk active/idle status every 10 minutes. When you see it power up, run the dmesg line above to see whodunnit.






                          share|improve this answer




























                            2














                            2










                            2









                            You need to tell the kernel to inform you of all the reads/writes to disks, then you need to look at that information.



                            So:



                            # sync
                            # echo 1 > /proc/sys/vm/block_dump
                            # dmesg -c | grep '/dev/sda'


                            sync flushes all pending writes to disks, so that you'll only see new reads or writes.
                            dmesg -c shows you the kernel messages, and clears them (otherwise you see the old ones too, each time you run dmesg).
                            grep filters the output of dmesg for activity for the disk you're interested in. Replace /dev/sda with your actual device.



                            I usually use something like this to spin down the disk, then check for when it spins up again:



                            # sync
                            # hdparm -y /dev/sda
                            # while true; do hdparm -C /dev/sda ; sleep 600 ; done


                            The while loop checks the disk active/idle status every 10 minutes. When you see it power up, run the dmesg line above to see whodunnit.






                            share|improve this answer













                            You need to tell the kernel to inform you of all the reads/writes to disks, then you need to look at that information.



                            So:



                            # sync
                            # echo 1 > /proc/sys/vm/block_dump
                            # dmesg -c | grep '/dev/sda'


                            sync flushes all pending writes to disks, so that you'll only see new reads or writes.
                            dmesg -c shows you the kernel messages, and clears them (otherwise you see the old ones too, each time you run dmesg).
                            grep filters the output of dmesg for activity for the disk you're interested in. Replace /dev/sda with your actual device.



                            I usually use something like this to spin down the disk, then check for when it spins up again:



                            # sync
                            # hdparm -y /dev/sda
                            # while true; do hdparm -C /dev/sda ; sleep 600 ; done


                            The while loop checks the disk active/idle status every 10 minutes. When you see it power up, run the dmesg line above to see whodunnit.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jul 1 '14 at 23:14









                            Greg BellGreg Bell

                            3503 silver badges11 bronze badges




                            3503 silver badges11 bronze badges


































                                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%2f29409%2ffinding-out-what-is-spinning-up-harddrive%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...