Endless Disk Activity QTS 4.4.1 [SOLVED]

Discussion about hard drive spin down (standby) feature of NAS.
Post Reply
kicritos
New here
Posts: 2
Joined: Sat Feb 29, 2020 4:15 am

Endless Disk Activity QTS 4.4.1 [SOLVED]

Post by kicritos » Mon Mar 16, 2020 9:31 pm

Using QNap QTS 4.4.1

After installing docker-station i have noticed that my harddisks started to be continuosly active EVER :( . Disk activity never ends so i decided to investigate whats going on.


following the instrucions from qnap wiki i have downloaded and run script from:
https://wiki.qnap.com/wiki/Find_out_whi ... m_spindown

Running script

We have to look for lines like

Code: Select all

<7>[52475.727464] setcfg(9191): dirtied inode 7041 (CACHEDEV1_DATA.log) on md9
This means that process setcfg with pid 9191 have modified file CACHEDEV1_DATA.log on device md9

Code: Select all

<7>[52482.016599] jbd2/md9-8(2518): WRITE block 616080 on unknown-block(9,9) (8 sectors)
Like md9 device is updated, its journal have been written

Code: Select all

<7>[52482.027584] md9_raid1(2505): WRITE block 1060216 on unknown-block(8,0) (1 sectors)
Finally, datablock is written to device md9, preventing disk to sleep.


Analysing output i have found that docker.log is being updated several times a minute.

Code: Select all

<7>[52473.727438] python2(9191): dirtied inode 7046 (docker.log) on md9

With these logs.

Code: Select all

time="2020-03-16T01:50:18.680573251+01:00" level=debug msg="Calling GET /v1.32/containers/json" 
I 've noticed that Container-Station runs docker in debug mode :shock: , so i have edited file

Code: Select all

/share/CACHEDEV1_DATA/.qpkg/container-station/script/run-docker.sh
Wich is script used by container-station to run docker, look for Debug enabled options

And comment Debug option.
Changed

Code: Select all

DOCKER_OPTS="$DOCKER_OPTS -D"
to

Code: Select all

#DOCKER_OPTS="$DOCKER_OPTS -D"
container station uses redis too, and redis.log is updated frequently, so i have lowered log level from redis in order to reduce disk accesses

To do so, i have edited

Code: Select all

/share/CACHEDEV1_DATA/.qpkg/container-station/etc/redis.conf
and change:

Code: Select all

loglevel notify
to

Code: Select all

loglevel warning


After that i realised that smbstatus is being called every few seconds. As i don't use samba, and i don't know how to stop smb callings, i have renamed smbstatus binary

Code: Select all

/mnt/ext/opt/samba/bin/smbstatus


to

Code: Select all

/mnt/ext/opt/samba/bin/smbstatus_hidden
And now disc activity have stopped and my disks have a pleasant sleep :DD :DD .
QTS 4.4.1
HS-553DX

User avatar
graemev
Getting the hang of things
Posts: 96
Joined: Sun Feb 12, 2012 10:17 pm

Re: Endless Disk Activity QTS 4.4.1 [SOLVED]

Post by graemev » Thu Apr 22, 2021 4:26 am

Taking a lead from your smbstatus(1), I note in /etc/config/smb.conf the lines:

Code: Select all

lock directory = /share/CACHEDEV1_DATA/.samba/lock
state directory = /share/CACHEDEV1_DATA/.samba/state
cache directory = /share/CACHEDEV1_DATA/.samba/cache
lock directory (G)
This option specifies the directory where lock files will be placed. The lock files are used to implement the max connections option.

Note: This option can not be set inside registry configurations.
Default: lock directory = ${prefix}/var/locks
Example: lock directory = /var/run/samba/locks
When I did:

Code: Select all

find /share/CACHEDEV1_DATA -xdev -mmin -20 > /tmp/touched
It shows:

Code: Select all

/share/CACHEDEV1_DATA/Public/Backups/ingrid-mac/private/var/db/sudo/sebastian
/share/CACHEDEV1_DATA/.qpkg/CodexPack/tmp
/share/CACHEDEV1_DATA/.qpkg/MediaSignPlayer/CodexPackExt/tmp
/share/CACHEDEV1_DATA/.samba/lock/msg.lock
/share/CACHEDEV1_DATA/.samba/lock/smbXsrv_session_global.tdb
/share/CACHEDEV1_DATA/.samba/lock/smbXsrv_tcon_global.tdb
/share/CACHEDEV1_DATA/.qulog/local_access.MYI
/share/CACHEDEV1_DATA/.qulog/local_access.MYD
So , an obvious question; why on earth are they storing the lock files on the raid disk, the mt or even RAMdisk would surely be a much better place?

ABTW, pretty sure nobody is accessing that "backup" file , it must be a stray windowbox making probes of some sort.

Mousetick
Been there, done that
Posts: 955
Joined: Thu Aug 24, 2017 10:28 pm

Re: Endless Disk Activity QTS 4.4.1 [SOLVED]

Post by Mousetick » Fri Apr 23, 2021 5:28 am

graemev wrote: ↑
Thu Apr 22, 2021 4:26 am
So , an obvious question; why on earth are they storing the lock files on the raid disk, the mt or even RAMdisk would surely be a much better place?
They are not stored on the RAID disks, they are stored on a tmpfs (RAM) filesystem mounted at <System-Volume-Path>/.samba/lock/msg.lock. So this directory and its contents does not involve any disk access at all - by design.

To see for yourself, you can use this command while Samba is running:

Code: Select all

# mount
Or you can study the contents of the script /etc/init.d/smb.sh which sets up the tmpfs filesystems for Samba.

User avatar
graemev
Getting the hang of things
Posts: 96
Joined: Sun Feb 12, 2012 10:17 pm

Re: Endless Disk Activity QTS 4.4.1 [SOLVED]

Post by graemev » Sat Apr 24, 2021 3:12 am

Well <System-Volume-Path>/.samba/lock/msg.lock is indeed tmpfs:

[~] # df -h /share/CACHEDEV1_DATA/.samba/lock/msg.lock
Filesystem Size Used Available Use% Mounted on
tmpfs 48.0M 60.0K 47.9M 0% /share/CACHEDEV1_DATA/.samba/lock/msg.lock


But the other two files (from the find(1) ) are not
[~] # df -h /share/CACHEDEV1_DATA/.samba/lock/smbXsrv_session_global.tdb
Filesystem Size Used Available Use% Mounted on
/dev/mapper/cachedev1
5.0T 3.1T 1.8T 63% /share/CACHEDEV1_DATA
[~] # df -h /share/CACHEDEV1_DATA/.samba/lock/smbXsrv_tcon_global.tdb
Filesystem Size Used Available Use% Mounted on
/dev/mapper/cachedev1
5.0T 3.1T 1.8T 63% /share/CACHEDEV1_DATA


Nor are the other two locations mentioned in smb.conf


[~] # df -h /share/CACHEDEV1_DATA/.samba/state
Filesystem Size Used Available Use% Mounted on
/dev/mapper/cachedev1
5.0T 3.1T 1.8T 63% /share/CACHEDEV1_DATA
[~] # df -h /share/CACHEDEV1_DATA/.samba/cache/
Filesystem Size Used Available Use% Mounted on
/dev/mapper/cachedev1
5.0T 3.1T 1.8T 63% /share/CACHEDEV1_DATA

Post Reply

Return to “HDD Spin Down (HDD Standby)”