Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Hard drive auto powers ON a few seconds after it was powered OFF

  1. #1

    Question Hard drive auto powers ON a few seconds after it was powered OFF

    Hi,

    There is a laptop which I am trying to configure. Most of the time all it is used for is to replay to infinity the same mp3 file (which is a small file, just 18mb) which is first copied to tmpfs /tmp and mplayer loops it from there. The laptop is used with the lid closed and in runlevel 3. I am trying to make it NOT to use the hard drive during that kind of use as it is simply not necessary.

    I have set the ext4 fs mount point with 'noatime' parameter both for / and /home. I also have in /etc/sysctl.d/99-sysctl.conf

    Code:
    vm.swappiness=0
    vm.vfs_cache_pressure=50
    So after all that I run:

    Code:
    # hdparm -B1 -Y /dev/sda
    
    /dev/sda:
     setting Advanced Power Management level to 0x01 (1)
     APM_level      = 1
     issuing sleep command
    I can hear the hard drive powering off. However in 2-3 seconds it wakes up again without any user action - no keyboard press, network cable is pulled off, no mouse/touchpad use, there is no wifi adapter on this PC and no USB or other devices connected.

    In the journal I read:

    Code:
    Apr 02 23:16:36 xxx kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6                                                
    Apr 02 23:16:36 xxx kernel: ata1.00: waking up from sleep                                                                            
    Apr 02 23:16:36 xxx kernel: ata1: soft resetting link                                                                                
    Apr 02 23:16:38 xxx kernel: ata1.00: configured for UDMA/100                                                                         
    Apr 02 23:16:38 xxx kernel: ata1.01: configured for UDMA/33                                                                          
    Apr 02 23:16:38 xxx kernel: ata1: EH complete
    The first two lines also appear directly in the console.

    Everything described above was done without playing the mp3, so I can not blame mplayer for the wake.

    How can I make so that the hard drive powers off and stays off?

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,101
    Blog Entries
    2

    Default Re: Hard drive auto powers ON a few seconds after it was powered OFF

    Something in the OS is initiating activity, possibly a background housekeeping service.

    To identify what that might be, you can
    - run iotop, which displays your disk activity in real time (naturally, you will need to view your display)
    - Possibly that activity might have been written to /proc/diskstats. Less or cat the file.

    In any case, running in init 3 may not be good enough, you may want to install a dualboot to a text-only "Server" installation to minimize default running processes.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3

    Default Re: Hard drive auto powers ON a few seconds after it was powered OFF

    Quote Originally Posted by tsu2 View Post
    Something in the OS is initiating activity, possibly a background housekeeping service.

    To identify what that might be, you can
    - run iotop, which displays your disk activity in real time (naturally, you will need to view your display)
    Thanks. I installed iotop and ran it. Then I read that I can show what is actually reading/writing using -o option. It is giving me this:

    Code:
    Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
    Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
      TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND                                                                                      
      253 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.39 % [kworker/0:5]
    The last line shows and hides every second. What process is that and how can I disable it (also is it safe to?). Again - I am testing without mplayer running.

    - Possibly that activity might have been written to /proc/diskstats. Less or cat the file.


    Code:
    # cat /proc/diskstats
       8       0 sda 9117 5476 615476 253560 969 287 74792 476204 0 78364 729764
       8       1 sda1 49 0 4448 2152 0 0 0 0 0 1604 2152
       8       2 sda2 8857 5362 558954 242016 956 286 74728 474996 0 77560 717012
       8       3 sda3 157 114 48890 7868 7 1 64 1040 0 6176 8908
      11       0 sr0 0 0 0 0 0 0 0 0 0 0 0


    What does this mean?

    In any case, running in init 3 may not be good enough, you may want to install a dualboot to a text-only "Server" installation to minimize default running processes.

    That is not possible.

  4. #4

    Default Re: Hard drive auto powers ON a few seconds after it was powered OFF

    From time to time iotop also shows this line and :

    Code:
    295 be/3 root        0.00 B/s    3.92 K/s  0.00 %  3.41 % [jbd2/sda2-8]

  5. #5

    Default Re: Hard drive auto powers ON a few seconds after it was powered OFF

    Also monitoring iotop via SSH connection showed me that at the moment the HDD wakes, systemd-journal shows as a line in iotop.

    I tried to stop manually:

    Code:
    systemctl stop systemd-journald.service && systemctl stop systemd-journal-catalog-update.service
    but the services magically restart themselves (although in Yast they appear as disabled).

  6. #6

    Default Re: Hard drive auto powers ON a few seconds after it was powered OFF

    I found some info that kworker is a kernel thread. Does that mean I am doomed and I cannot turn off hard disk as the kernel needs to write things to disk??

  7. #7
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,695

    Default Re: Hard drive auto powers ON a few seconds after it was powered OFF

    Might check the journal may be a error being written maybe

  8. #8

    Default Re: Hard drive auto powers ON a few seconds after it was powered OFF

    Quote Originally Posted by gogalthorp View Post
    Might check the journal may be a error being written maybe
    Could you please elaborate on that a little more?

  9. #9
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,695

    Default Re: Hard drive auto powers ON a few seconds after it was powered OFF

    Well something is triggering a journal write this may be a periodic error happening causing the write and thus the spin up of the disk. In any case looking at the journal will tell what is causing the write.

  10. #10

    Default Re: Hard drive auto powers ON a few seconds after it was powered OFF

    Quote Originally Posted by gogalthorp View Post
    In any case looking at the journal will tell what is causing the write.
    In the OP I pasted the journal lines which appear when the spin up happens. How do I find from that what is causing the write?

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •