[SOLVED] RAMDisk Full

Introduce yourself to us and other members here, or share your own product reviews, suggestions, and tips and tricks of using QNAP products.
User avatar
ehj
Starting out
Posts: 10
Joined: Sat Feb 23, 2013 5:08 pm
Location: Rijswijk ZH
Contact:

Re: [SOLVED] RAMDisk Full

Post by ehj »

Having same trouble. Since Qnap OS 4.02 update and after installing/deinstalling dlna server. Now symbolic links are missing and going to wong places.
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [SOLVED] RAMDisk Full

Post by schumaku »

ehj wrote: Since Qnap OS 4.02 update and after installing/deinstalling dlna server. Now symbolic links are missing and going to wong places.
Create a dedicated thread, and provide more details, i.e. what DLNA server installed/removed, what symlinks you are talking of...
User avatar
ehj
Starting out
Posts: 10
Joined: Sat Feb 23, 2013 5:08 pm
Location: Rijswijk ZH
Contact:

Re: [SOLVED] RAMDisk Full

Post by ehj »

Thanks.. i resolved the issue by killing the running twonkymediasrv and transcoder processes and rm -f - ing their folders on /share that should be located in /share/MD0_DATA/ with symlinks. /dev/ram0 went from 100% to 79% and afterr that was able to enter the webgui again and fully removed all in app_center/my_apps.
Proves for me that cause can be anything but i think packages should be tested better before putting them in app_center.
Thanks for your reply. Thanks Qnap for stuff that does not work.
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [SOLVED] RAMDisk Full

Post by schumaku »

Twonky App does not create symlinks to shares as not required at all - it's using the shared folder definitions, and defaults to the Multimedia share, using the symlinks already in place. Transcoding (not enabled nor GUI controllable), use upload (not available from the GUI), and cache are located on /var/twonkymedia/twonkymedia/db resp. /var/twonkymedia/twonkymedia/db/cache by default - with /var/twonkymedia/ being a symlink to the first storage volume. (i.e. with a RAID twonkymedia -> /share/MD0_DATA/.@twonkymedia.db/ - that's the only symlink I'm aware of.)

What to say? Thank you for being not very helpful, providing details of these folders and symlinks claimed, ... Under the line - if there should be an issue - you post has not much value for the community.
User avatar
pakoistinen
Know my way around
Posts: 149
Joined: Sat May 24, 2008 12:38 pm

Re: [SOLVED] RAMDisk Full

Post by pakoistinen »

I've regained the stability on my NAS after disabling the download station. It's' now been two days since the last ramdisk full problem. It appears that the box will hum nicely and keep alive as long as I don't use the download station.

The flipside is that download station was quite useful in many respects. Perhaps I will try either the new QTS beta version or transmission next.
TS-421 with QTS 4: 4 hdds: 2 x 1,5TB raid1 and 2 x 2TB raid1 arrays.
TS-209: 2 hdds: 2 x 750GB raid1 array.
Mail pasi at turvallisuus dot org
User avatar
ehj
Starting out
Posts: 10
Joined: Sat Feb 23, 2013 5:08 pm
Location: Rijswijk ZH
Contact:

Re: [SOLVED] RAMDisk Full

Post by ehj »

@ chumaku
Sorry to not being very helpfull to the community.
So i'm new to this community and i have not much experience with qnap but i have with unix-like systems and i'm willing to help everybody out with whatever problem they have. I'l try to adapt.

I understand Twonky does not create or use a symlink for storing the mirrored media. The links for cache and log i know from a relocating tutorial but I assumed a symlink for storage because there is a folder /share/twonky after each reboot. It contains filestructure like 'Mutimedia' with subfolders like this:
/share/twonky/videos/Twonky/
gespiegelde videoâs/ geüploade videoâs/

I have no twonky installed but after booting there is a twonkymediasrv process running and a transcoder process. The share/twonky folder and /dev/ram0 is 100% again after rebooting.
When i kill the 2 processes and remove the /share/twonky, /dev/ram0 goes from 100% to 78% .
The features that you say are not gui controllable (transcoding/upload/pointing to extra folders) are present in the webinterface of Twonky server 7 which is in a separate QPkG.
So maybe my trouble is a leftover from that qpkg ? But i did not put a folder /share/twonky on the system.

After reboot it is problem is back.
I need a way to fix this in a peristent way..

Thanks again
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [SOLVED] RAMDisk Full

Post by schumaku »

ehj wrote:I understand Twonky does not create or use a symlink for storing the mirrored media. The links for cache and log i know from a relocating tutorial but I assumed a symlink for storage because there is a folder /share/twonky after each reboot. It contains filestructure like 'Mutimedia' with subfolders like this:
/share/twonky/videos/Twonky/
gespiegelde videoâs/ geüploade videoâs/
Why change something that isn't broken (yet)? Where can we find this tutorial? Complain at the source - doubt that's QNAP at all. Working with folders like /share/[whatever] by anything different but shared folders (which ensures the symlinks to permanent storage are built) is playing on a high risk. Or the maker of the tutorial does have a twonkymedia share? Who knows...
ehj wrote:I have no twonky installed but after booting there is a twonkymediasrv process running...
Some (or all) contain a default Twonky Server v6.0.39 or the like. The control is located with Applications -> DLNA Media Server in any case.
ehj wrote:...and a transcoder process.
Assume you talk of ffmpeg processes - this binary is used fo various tasks - Media Library video thumbnail creation, Media Library transcoding, ... but again no QNAP Twonky supports transcoding.
ehj wrote:So maybe my trouble is a leftover from that qpkg ? But i did not put a folder /share/twonky on the system.
I believe you - but start with what was modded with this tutorial. QNAP does not create a /share/twonky directory :geek:

Regards,
-Kurt.
User avatar
ehj
Starting out
Posts: 10
Joined: Sat Feb 23, 2013 5:08 pm
Location: Rijswijk ZH
Contact:

Re: [SOLVED] RAMDisk Full

Post by ehj »

Why change something that isn't broken (yet)? Where can we find this tutorial? Complain at the source - doubt that's QNAP at all. Working with folders like /share/[whatever] by anything different but shared folders (which ensures the symlinks to permanent storage are built) is playing on a high risk. Or the maker of the tutorial does have a twonkymedia share? Who knows...
Things are broken here, that's why i try changing/changing back to see what is a cause. I started looking for a problem because the indexing of the dlna servers did not work an with mirroring i only got a few files. And the system started complaining about not being able to write configurations and settings.
This is the link: http://wiki.qnap.com/wiki/TwonkyMedia_L ... Relocation
Some (or all) contain a default Twonky Server v6.0.39 or the like. The control is located with Applications -> DLNA Media Server in any case.
When i installed twonky server 7.x qpkg it asked for media library as prerequisite. After installing i could login to the webinterface of twonky at port 9000. There you have the possibillity to add change mediafolders for indexing and configure mirror options for combining media archives of other dlna compatible servers in the network.
Assume you talk of ffmpeg processes - this binary is used fo various tasks - Media Library video thumbnail creation, Media Library transcoding, ... but again no QNAP Twonky supports transcoding.
i think ffmpeg is on the system somewhere like gd or jpeglib ed but the process that is filling ramdisk is 'mytranscodesvr'. The process ''twonkymediasvr' is disappeared after last boot.

Code: Select all

[~] # top
Mem: 651640K used, 369468K free, 0K shrd, 14436K buff, 379552K cached
Load average: 0.00, 0.01, 0.05    (State: S=sleeping R=running, W=waiting)

  PID USER     STATUS   RSS  PPID %CPU %MEM COMMAND
11762 admin    R        916 10689  0.3  0.0 top
  399 admin    SW         0     2  0.1  0.0 kworker/2:1
 4584 admin    S        10M     1  0.0  1.0 myidbserver
 4492 admin    S        10M     1  0.0  1.0 mymediadbserver
 4603 admin    S       9528     1  0.0  0.9 mytranscodesvr
 5358 admin    S       9500     1  0.0  0.9 apache_proxys
 4879 admin    S <     8972     1  0.0  0.8 apache_proxy
 4887 admin    S <     6264  4879  0.0  0.6 apache_proxy
 4886 admin    S <     6264  4879  0.0  0.6 apache_proxy
 4885 admin    S <     6004  4879  0.0  0.5 apache_proxy
 4884 admin    S <     6000  4879  0.0  0.5 apache_proxy
 5364 admin    S       5308  5358  0.0  0.5 apache_proxys
 5365 admin    S       5308  5358  0.0  0.5 apache_proxys
10280 admin    S <     5024  4879  0.0  0.4 apache_proxy
10281 admin    S <     5024  4879  0.0  0.4 apache_proxy
10282 admin    S <     5024  4879  0.0  0.4 apache_proxy
10283 admin    S <     5024  4879  0.0  0.4 apache_proxy
10284 admin    S <     5024  4879  0.0  0.4 apache_proxy
10285 admin    S <     5024  4879  0.0  0.4 apache_proxy
 5054 admin    S       2628     1  0.0  0.2 smbd
 4750 admin    S <     2124     1  0.0  0.2 _thttpd_
10679 admin    S       2052  5343  0.0  0.2 sshd
 4916 admin    S       1964     1  0.0  0.1 cupsd
 5071 admin    S       1836     1  0.0  0.1 nmbd
 3976 admin    S       1800     1  0.0  0.1 nmbd
 8811 admin    S       1720     1  0.0  0.1 rpc.mountd
 8866 admin    S       1720     1  0.0  0.1 rpc.mountd
10689 admin    S       1644 10679  0.0  0.1 sh
 8792 admin    S       1524     1  0.0  0.1 hotswap
 8856 admin    S       1348     1  0.0  0.1 bcclient
 8802 admin    S       1340     1  0.0  0.1 bcclient
 4124 admin    S       1328     1  0.0  0.1 upnpd
 7116 admin    S       1320     1  0.0  0.1 upnpd
 4402 admin    S       1164     1  0.0  0.1 rpc.statd
 3343 admin    S       1080     1  0.0  0.1 qsmartd
 8715 admin    S       1064     1  0.0  0.1 upsutil
 2294 admin    S        968     1  0.0  0.0 daemon_mgr.nvr
 5343 admin    S        960     1  0.0  0.0 sshd
 5061 admin    S        928  5054  0.0  0.0 smbd
 5164 admin    S        900     1  0.0  0.0 ntpdated
 4242 admin    S        724     1  0.0  0.0 portmap
 6923 admin    S        724     1  0.0  0.0 iscsi_logd
 5378 admin    S        704     1  0.0  0.0 crond
 2874 admin    S        696     1  0.0  0.0 modagent
 7692 admin    S        692     1  0.0  0.0 syslog_maild
 7487 admin    S N      656     1  0.0  0.0 rsyncd
    1 admin    S        624     0  0.0  0.0 init
 8102 admin    S        572     1  0.0  0.0 getty
 8101 admin    S        568     1  0.0  0.0 getty
 7441 admin    S N      552     1  0.0  0.0 acpid
 8798 admin    S <      256     1  0.0  0.0 qwatchdogd
 4289 admin    S         92     1  0.0  0.0 rpc.rquotad
 1484 admin    SW         0     2  0.0  0.0 md13_raid1
   10 admin    SW         0     2  0.0  0.0 kworker/0:1

[~] # df
Filesystem                Size      Used Available Use% Mounted on
/dev/ram0               139.5M    139.5M         0 100% /
tmpfs                    64.0M    328.0k     63.7M   1% /tmp
/dev/sda4               364.2M    227.8M    136.4M  63% /mnt/ext
/dev/md9                509.5M     80.9M    428.6M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir

[/share] # ls -al
drwxrwxr-x   32 admin    administ      1024 Nov  5 20:23 ./
drwxr-xr-x   22 admin    administ      1024 Nov  5 20:23 ../
lrwxrwxrwx    1 admin    administ        17 Nov  5 20:22 Download -> MD0_DATA/Download/
drwxrwxrwx    2 admin    administ      1024 Sep 19  2005 HDA_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDB_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDC_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDD_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDE_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDF_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDG_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDH_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDI_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDJ_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDK_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDL_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDM_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDN_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDO_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDP_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDQ_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDR_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDS_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDT_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDU_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDV_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDW_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDX_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDY_DATA/
drwxrwxrwx    2 admin    administ      1024 Dec  7  2005 HDZ_DATA/
drwxrwxrwx   23 admin    administ      4096 Nov  5 20:16 MD0_DATA/
lrwxrwxrwx    1 admin    administ        19 Nov  5 20:22 Multimedia -> MD0_DATA/Multimedia/
lrwxrwxrwx    1 admin    administ        28 Nov  5 20:22 Network Recycle Bin 1 -> MD0_DATA/Network Recycle Bin@
lrwxrwxrwx    1 admin    administ        15 Nov  5 20:22 Public -> MD0_DATA/Public@
drwxr-xr-x    2 admin    administ      1024 Nov  5 20:23 Qsync/
lrwxrwxrwx    1 admin    administ        19 Nov  5 20:22 Recordings -> MD0_DATA/Recordings/
lrwxrwxrwx    1 admin    administ        12 Nov  5 20:22 Usb -> MD0_DATA/Usb@
lrwxrwxrwx    1 admin    administ        12 Nov  5 20:22 Web -> MD0_DATA/Web@
lrwxrwxrwx    1 admin    administ        19 Nov  5 20:22 ernieshare -> MD0_DATA/ernieshare/
drwxrwxr-x   28 admin    administ      1024 Nov  5 20:25 external/
lrwxrwxrwx    1 admin    administ        14 Nov  5 20:22 homes -> MD0_DATA/homes@
lrwxrwxrwx    1 admin    administ        22 Nov  5 20:22 iona2bitbased -> MD0_DATA/iona2bitbased/
lrwxrwxrwx    1 admin    administ        25 Nov  5 20:22 nas -> MD0_DATA/.@msdfs_root/nas@
lrwxrwxrwx    1 admin    administ        13 Nov  5 20:22 nfs5 -> MD0_DATA/nfs5/
drwxr-xr-x    5 admin    administ      1024 Nov  5 20:23 twonky/
lrwxrwxrwx    1 admin    administ        32 Nov  5 20:23 twonkymedia -> /share/MD0_DATA/.@twonkymedia.db/

[/share/MD0_DATA] # ls -al
drwxrwxrwx   23 admin    administ      4096 Nov  5 20:16 ./
drwxrwxr-x   32 admin    administ      1024 Nov  5 20:23 ../
drwxrwxrwx    5 admin    administ      4096 Nov  5 10:53 .@mysql/
drwx------    4 admin    administ      4096 Mar 13  2012 .@qsync/
drwxr-xr-x    8 admin    administ      4096 Nov  3 11:34 .@twonkymedia.db/
drwxr-xr-x    6 admin    administ      4096 Nov  5 17:40 .antivirus/
drwxr-xr-x    2 admin    administ      4096 Oct 14  2012 .idmap/
drwxr-xr-x    4 admin    administ      4096 Nov  5 21:48 .locks/
drwxrwxrwx    2 admin    administ      4096 Nov  5 11:09 .php_session/
drwxr-xr-x    3 admin    administ      4096 Nov  5 20:16 .qpkg/
drwxrwxrwx    5 admin    administ      4096 Nov  5 20:23 .spool/
drwxr-xr-x    4 admin    administ      4096 Nov  5 17:40 .system/
drwxr-xr-x    3 admin    administ      4096 Dec  5  2012 .torrent/
drwxrwxrwx    5 admin    administ      4096 May 20 15:44 Download/
drwxrwxrwx    7 admin    administ      4096 Nov  4 23:19 Multimedia/
drwxr-xr-x    2 admin    administ      4096 Nov  4 07:54 Qsync/
drwxrwxrwx    3 admin    administ      4096 Nov  4 23:19 Recordings/
-rw-------    1 admin    administ      8192 Nov  5 17:39 aquota.user
drwxrwxrwx    4 admin    administ      4096 May 15 14:52 ernieshare/
drwxrwxrwx    3 admin    administ      4096 May 15 10:55 iona2bitbased/
drwx------    2 admin    administ     16384 Mar 13  2012 lost+found/
drwxr-xr-x    7 admin    administ      4096 Feb 10  2013 nfs5/
drwxr-xr-x    4 admin    administ      4096 Nov  5 10:31 optware/
drwxr-xr-x    4 admin    administ      4096 Nov  5 12:12 twonky/
The things that should be running are webserver, mysql, php, opnvpn, nfsd, iscsi, sshd. All media server apps are deinstalled.
The state above this is after rebooting. Before rebooting i reinstalled Twonkyserver 7.2.x and that did download but froze during install (30%) after that the system froze and the only thing i could do was reboot in the shell. After this failed install of Twonkyserver 7.2.x the proces twonkymediasvr disappeared.
But i cannot login gui without resolving the 100% ramdisk problem first.

Look at this one-liner reproducing the solution to some problem:

Code: Select all

[/share] # df;kill 4603; rm -fr /share/twonky;df
Filesystem                Size      Used Available Use% Mounted on
/dev/ram0               139.5M    139.5M         0 100% /
tmpfs                    64.0M    328.0k     63.7M   1% /tmp
/dev/sda4               364.2M    227.8M    136.4M  63% /mnt/ext
/dev/md9                509.5M     80.9M    428.6M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir
Filesystem                Size      Used Available Use% Mounted on
/dev/ram0               139.5M    109.5M     30.0M  78% /
tmpfs                    64.0M    328.0k     63.7M   1% /tmp
/dev/sda4               364.2M    227.8M    136.4M  63% /mnt/ext
/dev/md9                509.5M     80.9M    428.6M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir
[/share] #
And now i can login gui again.
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [SOLVED] RAMDisk Full

Post by schumaku »

That Wiki entry is years old, and was done to move data from a small system partition (RAID1 - HDA_ROOT) to the first storage volume (MD0_DATA or HDA_DATA). No word and no reference to the root RAM disk. For the firmware built-in Twonky 6 an even more the Twonky 7 Apps, it's obsolete: The data is already at the right place - in every case.

Even when reading the Wiki entry backwards: There is no reference to a /share/twonky or the like. At least I can't find one. All folders and symlinks created reside on physical storage - and never in the RAM disk.
User avatar
ehj
Starting out
Posts: 10
Joined: Sat Feb 23, 2013 5:08 pm
Location: Rijswijk ZH
Contact:

Re: [SOLVED] RAMDisk Full

Post by ehj »

Ok, you got a point i was just troubleshooting and looking to possible issues and i noticed my system has a structure that is a little different.
The files they refer to are in my system on /opt/ext and not /mnt/HDA_ROOT. And as far as i could see compared to that article my situation was same config. And indeed i did not find what i was looking for. Why my systrem has a /share/twonky and where that is coming from.

Now i do the same as before (one-liner with cleanup) but i do not kill the transcoder process.
Within a few seconds after rm -f the /share/twonky it is back again.
And i'm almost shure the transcoder is 'trying' to fill it whith a 10 gb videofile or something like that using old settings and a daemon that should not be running.

(to make it readable i removed al de /share/HD?_DATA lines from the du - command)

Code: Select all


[~] # vim /share/MD0_DATA/sleep10.sh

[~] # chmod 700 /share/MD0_DATA/sleep10.sh

[~] # /share/MD0_DATA/sleep10.sh

[~] # cat /share/MD0_DATA/sleep10.sh
#!/bin/sh

sleep 10

[~] # du -sk /share/* ; df ; rm -fr /share/twonky ; /share/MD0_DATA/sleep10.sh ; df ; du -sk /share/*

0       /share/Download
0       /share/ernieshare
27      /share/external
1       /share/HDA_DATA
0       /share/homes
42221516        /share/MD0_DATA
0       /share/Multimedia
0       /share/nas
0       /share/Network Recycle Bin 1
0       /share/nfs5
0       /share/Public
2       /share/Qsync
0       /share/Recordings
30707   /share/twonky
0       /share/twonkymedia
0       /share/Usb
0       /share/Web

Filesystem                Size      Used Available Use% Mounted on
[b]/dev/ram0               139.5M    139.5M         0 100% /
[/b]tmpfs                    64.0M    360.0k     63.6M   1% /tmp
/dev/sda4               364.2M    231.6M    132.6M  64% /mnt/ext
/dev/md9                509.5M     81.0M    428.4M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir
Filesystem                Size      Used Available Use% Mounted on
/dev/ram0               139.5M    139.5M         0 100% /
tmpfs                    64.0M    360.0k     63.6M   1% /tmp
/dev/sda4               364.2M    231.6M    132.6M  64% /mnt/ext
/dev/md9                509.5M     81.0M    428.4M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir

0       /share/Download
0       /share/ernieshare
27      /share/external
0       /share/homes
42221516        /share/MD0_DATA
0       /share/Multimedia
0       /share/nas
0       /share/Network Recycle Bin 1
0       /share/nfs5
0       /share/Public
2       /share/Qsync
0       /share/Recordings
30706   /share/twonky
0       /share/twonkymedia
0       /share/Usb
0       /share/Web

and when i do kill the process this happens:

Code: Select all


[~] # pidof mytranscodesvr
4603
[~] #
[~] # du -sk /share/* ; df ; kill 4603 ; rm -fr /share/twonky ; /share/MD0_DATA/sleep10.sh ; df ; du -sk /share/*
0       /share/Download
0       /share/ernieshare
27      /share/external
1       /share/HDA_DATA
0       /share/homes
42221520        /share/MD0_DATA
0       /share/Multimedia
0       /share/nas
0       /share/Network Recycle Bin 1
0       /share/nfs5
0       /share/Public
2       /share/Qsync
0       /share/Recordings
30709   /share/twonky
0       /share/twonkymedia
0       /share/Usb
0       /share/Web
Filesystem                Size      Used Available Use% Mounted on
[b]/dev/ram0               139.5M    109.5M     30.0M  78% /
[/b]tmpfs                    64.0M    352.0k     63.7M   1% /tmp
/dev/sda4               364.2M    232.3M    132.0M  64% /mnt/ext
/dev/md9                509.5M     81.3M    428.2M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir
Filesystem                Size      Used Available Use% Mounted on
/dev/ram0               139.5M    112.3M     27.1M  81% /
tmpfs                    64.0M    352.0k     63.7M   1% /tmp
/dev/sda4               364.2M    232.2M    132.0M  64% /mnt/ext
/dev/md9                509.5M     81.3M    428.2M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir
0       /share/Download
0       /share/ernieshare
27      /share/external
1       /share/HDA_DATA
0       /share/homes
0       /share/iona2bitbased
42221520        /share/MD0_DATA
0       /share/Multimedia
0       /share/nas
0       /share/Network Recycle Bin 1
0       /share/nfs5
0       /share/Public
2       /share/Qsync
0       /share/Recordings
0       /share/twonkymedia
0       /share/Usb
0       /share/Web
[~] #

And /share/twonky is gone plus ramdisk is normal again, seems.

Strange?

Code: Select all

[/etc/init.d] # find ./* | xargs grep 'mytranscodesvr'
./QMediaService.sh:     /bin/pidof  mytranscodesvr 1>/dev/null 2>&1
./QMediaService.sh:        [ $? = 0 ] || /bin/rm /tmp/mytranscodesvr.lock 1>/dev/null 2>/dev/null
./QMediaService.sh:     $PACKAGE_PATH/bin/[b][color=#BF0000]mytranscodesvr[/color][/b] $TRANSCODE_PARAMS >/dev/null 2>&1
./QMediaService.sh:             killall mytranscodesvr 2>/dev/null
./QMediaService.sh:             rm /tmp/mytranscodesvr.lock 1>/dev/null 2>/dev/null
./QMediaService.sh:             killall mytranscodesvr 2>/dev/null
./QMediaService.sh:             rm /tmp/mytranscodesvr.lock 1>/dev/null 2>/dev/null
./StartMediaService.sh:         #/sbin/daemon_mgr mytranscodesvr start "/etc/init.d/QMediaService.sh startTranscodeSvr 1>/dev/null 2>/dev/null"
./StartMediaService.sh: #/sbin/daemon_mgr mytranscodesvr stop "/etc/init.d/QMediaService.sh stopTranscodeSvr 1>/dev/null 2>/dev/null"
./StartMediaService.sh: rm /tmp/mytranscodesvr.lock 1>/dev/null 2>/dev/null

the startscript QMediaService.sh with the line : $PACKAGE_PATH/bin/mytranscodesvr $TRANSCODE_PARAMS >/dev/null 2>
And in /etc/config/ :

Code: Select all


[/etc/config] # find ./* | xargs grep 'twonky'
./crontab:0 3 * * * /bin/rm -rf /mnt/HDA_ROOT/twonkymedia/twonkymedia.db/cache/*
./rssdoc/qpkgrss_eng.xml:                                                               <img src="http://forum.qnap.com/rss/images/QPKG/twonkymedia.png" width="100" height="100" />
./twonkyvision-mediaserver6.ini:cachedir=/var/twonky/TwonkyServer/db/cache
./twonkyvision-mediaserver6.ini:dbdir=/var/twonky/TwonkyServer/db
./twonkyvision-mediaserver6.ini:servermanagedmusicdir=[color=#BF0000]/share/twonky/music/Twonky[/color]
./twonkyvision-mediaserver6.ini:servermanagedpicturedir=[color=#BF0000]/share/twonky/pictures/Twonky[/color]
./twonkyvision-mediaserver6.ini:servermanagedvideodir=[color=#BF0000]/share/twonky/videos/Twonky[/color]
./twonkyvision-mediaserver6.ini:onlinedir=/var/twonkymedia/twonkymedia/twonkymedia-server-online-data
./twonkyvision-mediaserver6.ini:mediastatisticsdir=/var/twonkymedia/twonkymedia/media-statistics/
./twonkyvision-mediaserver6.ini:rmhomedrive=/var/twonky/TwonkyServer/db
[/etc/config] #



That is probably where the folders come from.

By the way.. dpkg.conf is vanished now .. probably because of system unable to write to the full ramdisk.

I think this is actually root cause also of many other people having the ramdisk full issue.
Last edited by ehj on Wed Nov 06, 2013 11:09 am, edited 1 time in total.
User avatar
ehj
Starting out
Posts: 10
Joined: Sat Feb 23, 2013 5:08 pm
Location: Rijswijk ZH
Contact:

Re: [SOLVED] RAMDisk Full

Post by ehj »

Ok, you got a point i was just troubleshooting and looking to possible issues and i noticed my system has a structure that is a little different.
The files they refer to are in my system on /opt/ext and not /mnt/HDA_ROOT. And as far as i could see compared to that article my situation was same config. And indeed i did not find what i was looking for. Why my systrem has a /share/twonky and where that is coming from.

Now i do the same as before (one-liner with cleanup) but i do not kill the transcoder process.
Within a few seconds after rm -f the /share/twonky it is back again.
And i'm almost shure the transcoder is 'trying' to fill it whith a 10 gb videofile or something like that using old settings and a daemon that should not be running.

(to make it readable i removed al de /share/HD?_DATA lines from the du - command)

Code: Select all


[~] # vim /share/MD0_DATA/sleep10.sh

[~] # chmod 700 /share/MD0_DATA/sleep10.sh

[~] # /share/MD0_DATA/sleep10.sh

[~] # cat /share/MD0_DATA/sleep10.sh
#!/bin/sh

sleep 10

[~] # du -sk /share/* ; df ; rm -fr /share/twonky ; /share/MD0_DATA/sleep10.sh ; df ; du -sk /share/*

0       /share/Download
0       /share/ernieshare
27      /share/external
1       /share/HDA_DATA
0       /share/homes
0       /share/iona2bitbased
42221516        /share/MD0_DATA
0       /share/Multimedia
0       /share/nas
0       /share/Network Recycle Bin 1
0       /share/nfs5
0       /share/Public
2       /share/Qsync
0       /share/Recordings
30707   /share/twonky
0       /share/twonkymedia
0       /share/Usb
0       /share/Web

Filesystem                Size      Used Available Use% Mounted on
/dev/ram0               139.5M    139.5M         0 100% /
tmpfs                    64.0M    360.0k     63.6M   1% /tmp
/dev/sda4               364.2M    231.6M    132.6M  64% /mnt/ext
/dev/md9                509.5M     81.0M    428.4M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir
Filesystem                Size      Used Available Use% Mounted on
/dev/ram0               139.5M    139.5M         0 100% /
tmpfs                    64.0M    360.0k     63.6M   1% /tmp
/dev/sda4               364.2M    231.6M    132.6M  64% /mnt/ext
/dev/md9                509.5M     81.0M    428.4M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir

0       /share/Download
0       /share/ernieshare
27      /share/external
0       /share/homes
0       /share/iona2bitbased
42221516        /share/MD0_DATA
0       /share/Multimedia
0       /share/nas
0       /share/Network Recycle Bin 1
0       /share/nfs5
0       /share/Public
2       /share/Qsync
0       /share/Recordings
30706   /share/twonky
0       /share/twonkymedia
0       /share/Usb
0       /share/Web

and when i do kill the process this happens:

Code: Select all


[~] # pidof mytranscodesvr
4603
[~] #
[~] # du -sk /share/* ; df ; kill 4603 ; rm -fr /share/twonky ; /share/MD0_DATA/sleep10.sh ; df ; du -sk /share/*
0       /share/Download
0       /share/ernieshare
27      /share/external
1       /share/HDA_DATA
0       /share/homes
0       /share/iona2bitbased
42221520        /share/MD0_DATA
0       /share/Multimedia
0       /share/nas
0       /share/Network Recycle Bin 1
0       /share/nfs5
0       /share/Public
2       /share/Qsync
0       /share/Recordings
30709   /share/twonky
0       /share/twonkymedia
0       /share/Usb
0       /share/Web
Filesystem                Size      Used Available Use% Mounted on
/dev/ram0               139.5M    139.5M         0 100% /
tmpfs                    64.0M    356.0k     63.7M   1% /tmp
/dev/sda4               364.2M    231.5M    132.7M  64% /mnt/ext
/dev/md9                509.5M     81.3M    428.2M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir

Filesystem                Size      Used Available Use% Mounted on
/dev/ram0               139.5M    109.5M     30.0M  78% /
tmpfs                    64.0M    356.0k     63.7M   1% /tmp
/dev/sda4               364.2M    231.5M    132.7M  64% /mnt/ext
/dev/md9                509.5M     81.3M    428.2M  16% /mnt/HDA_ROOT
/dev/md0                  3.6T     40.5G      3.5T   1% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
tmpfs                     8.0M         0      8.0M   0% /var/syslog_maildir

0       /share/Download
0       /share/ernieshare
27      /share/external
1       /share/HDA_DATA
0       /share/homes
0       /share/iona2bitbased
42221520        /share/MD0_DATA
0       /share/Multimedia
0       /share/nas
0       /share/Network Recycle Bin 1
0       /share/nfs5
0       /share/Public
2       /share/Qsync
0       /share/Recordings
0       /share/twonkymedia
0       /share/Usb
0       /share/Web

And /share/twonky is gone plus ramdisk is normal again.

Strange?

Code: Select all

[/etc/init.d] # find ./* | xargs grep 'mytranscodesvr'
./QMediaService.sh:     /bin/pidof  mytranscodesvr 1>/dev/null 2>&1
./QMediaService.sh:        [ $? = 0 ] || /bin/rm /tmp/mytranscodesvr.lock 1>/dev/null 2>/dev/null
./QMediaService.sh:     $PACKAGE_PATH/bin/mytranscodesvr $TRANSCODE_PARAMS >/dev/null 2>&1
./QMediaService.sh:             killall mytranscodesvr 2>/dev/null
./QMediaService.sh:             rm /tmp/mytranscodesvr.lock 1>/dev/null 2>/dev/null
./QMediaService.sh:             killall mytranscodesvr 2>/dev/null
./QMediaService.sh:             rm /tmp/mytranscodesvr.lock 1>/dev/null 2>/dev/null
./StartMediaService.sh:         #/sbin/daemon_mgr mytranscodesvr start "/etc/init.d/QMediaService.sh startTranscodeSvr 1>/dev/null 2>/dev/null"
./StartMediaService.sh: #/sbin/daemon_mgr mytranscodesvr stop "/etc/init.d/QMediaService.sh stopTranscodeSvr 1>/dev/null 2>/dev/null"
./StartMediaService.sh: rm /tmp/mytranscodesvr.lock 1>/dev/null 2>/dev/null

the startscript QMediaService.sh with the line : $PACKAGE_PATH/bin/mytranscodesvr $TRANSCODE_PARAMS >/dev/null 2>
And in /etc/config/ :

Code: Select all


[/etc/config] # find ./* | xargs grep 'twonky'
./crontab:0 3 * * * /bin/rm -rf /mnt/HDA_ROOT/twonkymedia/twonkymedia.db/cache/*
./rssdoc/qpkgrss_eng.xml:                                                               <img src="http://forum.qnap.com/rss/images/QPKG/twonkymedia.png" width="100" height="100" />
./twonkyvision-mediaserver6.ini:cachedir=/var/twonky/TwonkyServer/db/cache
./twonkyvision-mediaserver6.ini:dbdir=/var/twonky/TwonkyServer/db
./twonkyvision-mediaserver6.ini:servermanagedmusicdir=/share/twonky/music/Twonky
./twonkyvision-mediaserver6.ini:servermanagedpicturedir=/share/twonky/pictures/Twonky
./twonkyvision-mediaserver6.ini:servermanagedvideodir=/share/twonky/videos/Twonky
./twonkyvision-mediaserver6.ini:onlinedir=/var/twonkymedia/twonkymedia/twonkymedia-server-online-data
./twonkyvision-mediaserver6.ini:mediastatisticsdir=/var/twonkymedia/twonkymedia/media-statistics/
./twonkyvision-mediaserver6.ini:rmhomedrive=/var/twonky/TwonkyServer/db
[/etc/config] #



That is probably where the folders come from.

By the way.. dpkg.conf is vanished now .. probably because of system unable to write to the full ramdisk.

I think this is actually root cause also of many other people having the ramdisk full issue.
User avatar
ehj
Starting out
Posts: 10
Joined: Sat Feb 23, 2013 5:08 pm
Location: Rijswijk ZH
Contact:

Re: [SOLVED] RAMDisk Full

Post by ehj »

Supplement:
In the process list these scripts are running and after a while twonky is again back and filling ramdisk.

Code: Select all

4492 admin     10368 S   /usr/local/medialibrary/bin/mymediadbserver -d -i -1
 4584 admin     10828 S   /usr/local/medialibrary/bin/myidbserver -d
  7165 admin       368 S   /mnt/HDA_ROOT/twonkymedia/twonkymedia -inifile /etc/config/twonkyvision-mediaserver6.ini -enableweb 2 -powersavemode 1 -logfile /mnt/HDA_ROOT/twonkymedia/twonkymediaserver6-log.txt -suppressmenu mediafeeds
 7166 admin      7184 S   /mnt/HDA_ROOT/twonkymedia/twonkymediaserver -inifile /etc/config/twonkyvision-mediaserver6.ini -enableweb 2 -powersavemode 1 -logfile /mnt/HDA_ROOT/twonkymedia/twonkymediaserver6-log.txt -suppressmenu mediafeed
They should not run to begin with.

Wild guess: (for further investigation) It looks like there is a chicken <> egg problem.
When the system starts defaults are taken (from inifiles). The inifiles let the daemons fillup the ramdrive while the startscript is deciphering what to put in the /etc/config/pckg.conf file. But the qpkg.conf will not be written when the ramdisk is full.
In the next stage qpkg.conf is read but empy and everything is left default. And there is /share/twonky back again.
This actually what i already saw since a week now when i browsed through the settings in the Qmanager App on my iphone that i use to wake-on-lan the qnap. Everything i disabled is switched on again.
if the defaults where suitable for my system (option during installation for raid or not) this would not happen.

But i have no clue yet about init/boot and maybe i'm totally wrong with this conclusion and have to do a factory reset.
User avatar
pakoistinen
Know my way around
Posts: 149
Joined: Sat May 24, 2008 12:38 pm

Re: [SOLVED] RAMDisk Full

Post by pakoistinen »

I am also in the impression that we are dealing with that sort of problems. It seems that there is no single cause for the ramdisk full errors. I think these errors not only cover qpkg.conf but also /var/.application.conf sometimes. These are kind of "central configuration files" that most, if not all, apps use. There have been reports that people find strange stuff in these config files sometimes because many scripts read from and write to these files.

Imho, this means that we've got a complex spaghetti situation in our hands. Generally, the startup scripts don't handle errors well on these boxes. We probably also have some weird race conditions here and there when daemons try to read or write the config files simultaneously. For instance, the default error condition for /etc/init.d/btd.sh is to write everything to /share/Qdownload which fills up the RAM disk quickly. If the btd doesn't find the config files for some reason it defaults to old directory structure from the past. < In qnap they use that location for backwards compatibility with the older Qnap devices that use that folder. In newer devices this error condition causes a problem that fills up the ramdisk. I consider these to be a design flaws that can't be fixed easily. Such instability should be accounted for during the requirements and design phases of development.

After I removed most of my apps, including the Qnap's inbuilt ones, there have been no ramdisk full errors anymore. Now I run a few well written ones from external sources (like Crashplan).
TS-421 with QTS 4: 4 hdds: 2 x 1,5TB raid1 and 2 x 2TB raid1 arrays.
TS-209: 2 hdds: 2 x 750GB raid1 array.
Mail pasi at turvallisuus dot org
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [SOLVED] RAMDisk Full

Post by schumaku »

Twonky does not take space on the root ram disk...

[~] # du /share/twonky
0 /share/twonky
[~] # du /share/twonkymedia
0 /share/twonkymedia

...here is why...

[~] # ls -ls /share/twonky
0 lrwxrwxrwx 1 admin administ 32 Nov 5 18:57 /share/twonky -> /share/HDA_DATA/.@twonkymedia.db/
[~] # ls -ls /share/twonkymedia
0 lrwxrwxrwx 1 admin administ 32 Nov 5 18:57 /share/twonkymedia -> /share/HDA_DATA/.@twonkymedia.db/

The symlinks are created with the /etc/init.d/twonkymedia6.sh run.
pakoistinen wrote:I think these errors not only cover qpkg.conf but also /var/.application.conf sometimes. These are kind of "central configuration files" that most, if not all, apps use. There have been reports that people find strange stuff in these config files sometimes because many scripts read from and write to these files.
This is a layer I don't have any oversight. How it should be possible complete data blocks (not complete config sections) can end within a different config file is beyond me, especially as we know most of reading and setting config variables is done by getvar and setvar (a few exceptions came in recently, the QTS 4 has an image handling smb.conf share sections in blocks. Lack of locking (i.e. by a semaphore) to avoind concurrent write and update actions might explain some. This is probably key to many of the "strange" effects very few QNAP owners experience.
pakoistinen wrote:For instance, the default error condition for /etc/init.d/btd.sh is to write everything to /share/Qdownload which fills up the RAM disk quickly. If the btd doesn't find the config files for some reason it defaults to old directory structure from the past. < In qnap they use that location for backwards compatibility with the older Qnap devices that use that folder. In newer devices this error condition causes a problem that fills up the ramdisk.
Yes, as we've discussed already: The getvar defaulting to Qmultimedia if "nothing" is available to proof different.
ehj wrote:The inifiles let the daemons fillup the ramdrive while the startscript is deciphering what to put in the /etc/config/pckg.conf file. But the qpkg.conf will not be written when the ramdisk is full.
Five by one - qpkg.conf is a permanent stored config file, mainly updated by the App Center while adding, updating, and removing apps - along with some built-in default ones.
ehj wrote:But i have no clue yet about init/boot and maybe i'm totally wrong with this conclusion and have to do a factory reset.
With the known situation from above I would opt to wipe the partition tables of the HDD and ensure everything is redone from scratch.
User avatar
pakoistinen
Know my way around
Posts: 149
Joined: Sat May 24, 2008 12:38 pm

Re: [SOLVED] RAMDisk Full

Post by pakoistinen »

For me it seems that there is no single cause for the ramdisk full errors. I think these errors not only cover qpkg.conf but also /var/.application.conf sometimes. These are central configuration files that most apps use to indicate if the app is installed or running. Sometimes people find strange stuff in these config files because many scripts read from and write to these files during startup by using getcfg and setcfg. (just cat /etc/init.d for either setcfg or getcfg). For instance the /etc/init.d/ scripts don't seem to use any kind of a lock mechanism to prevent race conditions or simultaneous reads / writes to config files. And there is no mechanism that would audit that the integrity of data entries in those files is intact. Furthermore, the logic in the scripts that handles central config file reads/writes seem to be written differently across each script. Therefore it is very difficult to deduce the exact source of problems in each case.

Imho, this means that we've got a complex spaghetti situation in our hands. To make things worse the startup scripts don't handle errors well on these boxes. For instance, the default error condition for /etc/init.d/btd.sh is to write everything to /share/Qdownload which fills up the RAM disk quickly. This condition happens if the config files or correct entries in them are not found. If the btd doesn't find the config files for some reason it defaults to old directory structure from the past (Qdownload). That location is used for backwards compatibility with the older Qnap devices that use that folder. In newer devices this error condition causes a problem that fills up the ramdisk. I consider these to be a design flaws that can't be fixed easily.

After I disabled most of my apps, including the Qnap's inbuilt ones, there have been no ramdisk full errors anymore. Now I run a few well written ones from external sources (like Crashplan).

Edit: One final thought: Why not design the system so that the apps that are within support (Qnap) would always use a known good configuration that can not be changed by other apps? The others should definitely use different configuration files that would not interfere with the integrity of the default system services. This way it would be possible to create integrity checks that ensure that the core components of the system work correctly - only the external apps would need to be debugged in error cases. Now that we share the same configs across all applications this is nearly impossible.
TS-421 with QTS 4: 4 hdds: 2 x 1,5TB raid1 and 2 x 2TB raid1 arrays.
TS-209: 2 hdds: 2 x 750GB raid1 array.
Mail pasi at turvallisuus dot org
Locked

Return to “Users' Corner”