Page 1 of 1

External HDD spins up every 30 minutes

Posted: Thu Aug 20, 2015 4:51 pm
by SirJohnDoe
Recently I've noticed my external HDD spins up every 30 minutes, after which it'll spin down again in 10 minutes (the default time). It's a WD Studio II external HDD, formatted as NTFS and with a GPT system. Naturally I've been searching for what causes this. I've turned off several daemons, shut down Kodi, but the cycle continued. When checking for Disk read and write actions with iotop, I also couldn't identify the programs responsible.

What I've tried:

Turning off Kodi, vsftpd, samba, rsyslog, rsync, ntp, cron, as described here: http://info4admins.com/tips-to-spindown ... or-ubuntu/

Here's an iotop log of an hour (it occurs at 00 and 30 or close to that): http://pastebin.com/5xqtTHdM

A list of all services on my system (with service --status-all):

Code: Select all

[ ? ]  alsa-utils
 [ - ]  bootlogs
 [ ? ]  bootmisc.sh
 [ ? ]  cgroup-bin
 [ ? ]  checkfs.sh
 [ ? ]  checkroot-bootclean.sh
 [ - ]  checkroot.sh
 [ - ]  console-setup
 [ + ]  cron
 [ + ]  dbus
 [ ? ]  dphys-swapfile
 [ ? ]  fake-hwclock
 [ ? ]  hdparm
 [ - ]  hostname.sh
 [ ? ]  hwclock.sh
 [ + ]  ifplugd
 [ - ]  kbd
 [ - ]  keyboard-setup
 [ ? ]  killprocs
 [ ? ]  kmod
 [ - ]  kodi
 [ - ]  lightdm
 [ - ]  motd
 [ ? ]  mount
 [ ? ]  mount.save
 [ ? ]  mountall-bootclean.sh
 [ ? ]  mountall.sh
 [ ? ]  mountdevsubfs.sh
 [ ? ]  mountkernfs.sh
 [ ? ]  mountnfs-bootclean.sh
 [ ? ]  mountnfs.sh
 [ ? ]  mtab.sh
 [ ? ]  networking
 [ - ]  nfs-common
 [ + ]  ntp
 [ ? ]  plymouth
 [ ? ]  plymouth-log
 [ - ]  procps
 [ ? ]  raspi-config
 [ ? ]  rc.local
 [ - ]  rmnologin
 [ - ]  rpcbind
 [ - ]  rsync
 [ + ]  rsyslog
 [ + ]  samba
 [ ? ]  screen-cleanup
 [ ? ]  sendsigs
 [ + ]  ssh
 [ - ]  sudo
 [ + ]  triggerhappy
 [ ? ]  tvheadend
 [ + ]  udev
 [ ? ]  udev-mtab
 [ ? ]  umountfs
 [ ? ]  umountnfs.sh
 [ ? ]  umountroot
 [ - ]  unattended-upgrades
 [ - ]  urandom
 [ + ]  vsftpd
 [ - ]  x11-common
The disk itself is mounted with:

Code: Select all

sudo mount -t ntfs-3g -o defaults,noatime,uid=hts,umask=0113,dmask=0022 /dev/sda1 /home/pi/media/HDD1
using a script at start up (fstab was giving problems).

The raspbian version I run is from February. I've upgraded the kernel manually to 3.19.2-v7+ so it works with my tv stick.

Re: External HDD spins up every 30 minutes

Posted: Thu Aug 20, 2015 5:43 pm
by default_user8
See if useing hdparm to put the drive in stand by untill it's needed helps.

http://linux.die.net/man/8/hdparm

Re: External HDD spins up every 30 minutes

Posted: Thu Aug 20, 2015 6:54 pm
by SirJohnDoe
The problem isn't spinning down, as it does so automatically, put something takes it out of stand-by. Also HDparm doesn't work with external disks afaik, and probably also doesn't support NTFS.

Re: External HDD spins up every 30 minutes

Posted: Thu Aug 20, 2015 9:20 pm
by default_user8
It works on my seagate external drive, but not my toshiba. ;)

Re: External HDD spins up every 30 minutes

Posted: Thu Aug 20, 2015 9:27 pm
by DougieLawson
SirJohnDoe wrote:... and probably also doesn't support NTFS.
Does it have to be NTFS? It will run faster, file security will work and it will spin-down when not needed if you reformat it to ext4.

hdparm appears to work with my B+ which has the rootfs on a hard drive.

Code: Select all

root@apollo ~ # hdparm -B 1 /dev/sda

/dev/sda:
 setting Advanced Power Management level to 0x01 (1)
 APM_level      = 1
root@apollo ~ # hdparm /dev/sda

/dev/sda:
 multcount     =  0 (off)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 19457/255/63, sectors = 312581808, start = 0
root@apollo ~ #

Re: External HDD spins up every 30 minutes

Posted: Thu Aug 20, 2015 10:42 pm
by SirJohnDoe
DougieLawson wrote:
SirJohnDoe wrote:... and probably also doesn't support NTFS.
Does it have to be NTFS? It will run faster, file security will work and it will spin-down when not needed if you reformat it to ext4.

hdparm appears to work with my B+ which has the rootfs on a hard drive.

Code: Select all

root@apollo ~ # hdparm -B 1 /dev/sda

/dev/sda:
 setting Advanced Power Management level to 0x01 (1)
 APM_level      = 1
root@apollo ~ # hdparm /dev/sda

/dev/sda:
 multcount     =  0 (off)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 19457/255/63, sectors = 312581808, start = 0
root@apollo ~ #
Well, it's a lot of work to transfer 2 TB of files and put them another disk, then re-format and put them back.

Again, spinning down is no problem, it works fine. I'm just trying to find out what process wakes up my external HDD every 30 minutes

Re: External HDD spins up every 30 minutes

Posted: Thu Aug 20, 2015 10:54 pm
by DougieLawson
Looks like it's a feechur of the userland NTFS driver.

Re: External HDD spins up every 30 minutes

Posted: Fri Aug 21, 2015 5:22 am
by fruit-uk
SirJohnDoe wrote:Well, it's a lot of work to transfer 2 TB of files and put them another disk, then re-format and put them back.
Do it from your backup drive - you do have a backup, don't you? 2TB is a lot to lose.

Re: External HDD spins up every 30 minutes

Posted: Fri Aug 21, 2015 12:43 pm
by SirJohnDoe
fruit-uk wrote:
SirJohnDoe wrote:Well, it's a lot of work to transfer 2 TB of files and put them another disk, then re-format and put them back.
Do it from your backup drive - you do have a backup, don't you? 2TB is a lot to lose.
It's only movies and tv series, so it doesn't really matter as I can easily redownload everything. I've just managed to free up enough space on my other disks to transfer the lot, and will re-format it to ext4.

Re: External HDD spins up every 30 minutes

Posted: Fri Aug 21, 2015 10:34 pm
by default_user8
I have 2 1TB drives one mirrored to the other with rysnc. When I first set my system up I tried to do it with ntfs and had issues, reformatting solved everything. Maybe you'll have the same experience.

Re: External HDD spins up every 30 minutes

Posted: Wed Feb 17, 2016 5:08 pm
by bismosa
Hello,

did you find the problem?

I had the same problem. I use Openelec and have no iotop.
Then i have tried to find the problem with:

Code: Select all

while true; do lsof | grep sda; done
And have seen that smartmontools is accessing the drive. I have now deactivated it...and all is well :)

Regards Bismosa