Clean OS (Debian), OpenMediaVault and other "firmwares"

Fox_exe wrote:


mariogolf wrote:> I’ve a question: When wdmc goes poweroff, is the led corol always green after completed poweroff?


Hmm. No, he switch to yellow, then - to white.

Its controlled by /etc/init.d/wd-leds.sh

 

 

 Example wd-leds.sh:

#! /bin/sh

BEGIN INIT INFO

Provides: led_init

Required-Start: $remote_fs $syslog

Required-Stop: $remote_fs $syslog

Default-Start: 1 2 3 4 5 6

Default-Stop: 0 6

Short-Description: Start daemon at boot time

Description: Set LED color at start/stop.

END INIT INFO

case “$1” in
start)
echo “Set LED to Green”
echo green > /sys/class/leds/system_led/color
;;
stop)
echo “Set LED to yellow”
echo yellow > /sys/class/leds/system_led/color
;;
*)
echo “Usage: /etc/init.d/led_boot {start|stop}”
exit 1
;;
esac

chmod a+x /etc/init.d/wd-leds.sh

update-rc.d wd-leds.sh defaults

 

 

This is wd-led.sh in /etc/init.d/

#! /bin/sh

### BEGIN INIT INFO
# Provides: led_init
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Set LED color at start/stop.
### END INIT INFO


case "`runlevel`" in
        "0 0"|"N 0"|"0")
                echo blue > /sys/class/leds/system_led/color
                ;;
        "0 1"|"N 1")
                echo yellow > /sys/class/leds/system_led/color
                ;;
        "1 2"|"N 2")
                echo green > /sys/class/leds/system_led/color
                ;;
        "2 6"|"N 6")
                echo yellow > /sys/class/leds/system_led/color
                ;;
esac

#case "$1" in
# start)
# echo "Set LED to Green "
# echo green > /sys/class/leds/system_led/color
# ;;
# stop)
# echo "Set LED to yellow "
# echo yellow > /sys/class/leds/system_led/color
# ;;
# *)
# echo "Usage: /etc/init.d/led_boot {start|stop}"
# exit 1
# ;;
#esac

# exit 0

Have you suggestions for me? Have I to replace it with your example?

Then, I upgraded system.

wdmc upgraded also openmediavault it have asked to me if overwrite the default version of /etc/default/openmediavault or no.

I have denied this request. Is it ok?

thank you again!

mariogolf wrote:> wdmc upgraded also openmediavault it have asked to me if overwrite the default version of /etc/default/openmediavault or no.

I have denied this request. Is it ok?

thank you again!

  1. Yes.
  2. Yes.

Fox_exe wrote:


mariogolf wrote:> wdmc upgraded also openmediavault it have asked to me if overwrite the default version of /etc/default/openmediavault or no.

I have denied this request. Is it ok?

thank you again!


  1. Yes.
  2. Yes.

Ok, but I don’t understand… twice yes to what?

I’m a little confused!! :wink:

  1. Yes, overwrite OMV configs is normal.
  2. Yes, you can replace wd-leds to this cript. No matter.

Fox_exe wrote:

  1. Yes, overwrite OMV configs is normal.
  2. Yes, you can replace wd-leds to this cript. No matter.

OK, thanks.

  1. I had choosen “no” about overwrite request. Have I to reload the config script? (If your anwer is yes… how can I do it?)

  2. ok, replaced!

Then the third question.

I want to set wdmc as home server to test sites/CSM, and I want to change the behaviour of nginx.

How can I set nginx to show omv when I request <ip.wmdc>/omv/ (instead <ip.wmcd>/ )?

So of I want setup another site I go to it typing <ip.wmcd>/site1/ .

I suppose I need modify a config file (/etc/nignx/site-???/openmediavault-webgui), but I don’t know what it is neither how.

Can you help me?

Thank you!

Thank you very much!, that was a perfect answer for what I was looking for, defenitily going to try the Clean Debian, I have access to a linux machine so no worries right there. 

about ownclod and OMV, do you have any advice? any reason why you installed OMV over owncloud? or is just personal taste. 

Thanks again for your effort and help.

OMV have OwnCloud plugin. Works good as well.

Update!

* OMV v1.11
* Kernel 3.2.40 + Modules
* Omvextras.org plugins
* Samba v4.13
* Transmission 2.84

  • IScsi Target still wont work (Need recompile kernel module and remove linux-headers from dependencies)
  • WON not supported by hardware
  • Samba’s speed still low

Fox_exe wrote:

Update!

* OMV v1.11
[…]

  • WON not supported by hardware

Sorry Fox_exe,

what is “WON”?

Thanks

Fox_exe wrote:

Run this:

mdadm --stop /dev/md1
mdadm /dev/md1 --remove /dev/sda2
mdadm --wait /dev/md1
mdadm --zero-superblock --force --verbose /dev/sda2
mdadm /dev/md0 --add /dev/sda2

Its revert mdraid to normal state (Need for easy change/revert firmware by my Autoinstall script)

 

About mycloud.local - just edit /etc/hosts and change to what you want (Or just delete “mycloud” and “local”)

Hi Fox_exe,

thanks for your work, and support!

I really hope somebody will find sometime to help around writing some documentation about this project… just save you from the most silly (like mine) and obvious questions (just a faq, redirecting basic question to the proper domain would be very helpful… like some stuff which is just basic linux staff and you should be saved from being bothered with =).

So please, what is the script you suggested me doing?

From what I understand OMV default configuration should be on at least for 2 drives (one for the OS one for data): did you partion the only drive in the WD My Cloud to make it work with OMV? Is the script deleting the raid made from partions of the same drive and just leaving to partions (OS+data)?

More silly questions to come… sorry!

(see:  http://forums.openmediavault.org/index.php/Thread/7409-creating-my-first-NFS-share/))

Many thanks

PS:

I already updated to 1.11

PPS:

when I go under the network > interfaces tab I get the following error message:

Device ‘ip6tnl0’ not supported

Error #6003:
exception 'OMVException' with message 'Device 'ip6tnl0' not supported' in /usr/share/openmediavault/engined/rpc/network.inc:253
Stack trace:
#0 [internal function]: OMVRpcServiceNetwork->enumerateDevicesList(Array, Array)
#1 /usr/share/php/openmediavault/rpcservice.inc(125): call_user_func_array(Array, Array)
#2 /usr/share/php/openmediavault/rpc.inc(79): OMVRpcServiceAbstract->callMethod('enumerateDevice...', Array, Array)
#3 /usr/sbin/omv-engined(500): OMVRpc::exec('Network', 'enumerateDevice...', Array, Array, 1)
#4 {main}

No, my script only restore original “WD” layout.

OMV can work on one drive (And did it). Just dont touch md raid in web UI.

First step after run OMV on WDMC - remount /dev/sda4 (Storeage  → File systems →  /dev/sda4 → unmount (You got a error. Its normal), then mount again).

About network error:  http://forums.openmediavault.org/index.php/Thread/7400-Network-Interface-Error/


Ps: Now - i test recovery image for restore (unbrick) device w/o opening device.

Also possible edit boot scripts (Boot env).

See in G.Drive folder. (tftp_magic)

After playing around a bit with the clean Debian I want to thank fox_exe again for this great work. It’s so much better than the original Firmware and I don’t risk bricking it with every little thing I do.

Unfortunately, I’m not too lucky with my installations. I tried Plex and it worked, only I found no way to make my files show inside plex.

Owncloud works but seems very unstable, though this would mainly be a problem of owncloud itself.

But one big issue occured these days. Now, when I’m trying to do literally anything with the box it freezes for a minute or so. It doesn’t crash but becomes really slow. The thing I don’t understand is that a top command shows CPU usage of 2%  and few memory usage

Anyone got an idea whether I can do anything but reinstall? Are there helping  logfiles?

Thanks so much

Here my top

 PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
 4067 root      20   0     0    0    0 S   1.3  0.0   0:01.24 kworker/0:0
 4081 root      20   0  4336 1356  872 R   0.7  0.6   0:00.19 top
  334 root      20   0     0    0    0 S   0.3  0.0   0:52.70 scsi_eh_0
  911 root      20   0     0    0    0 D   0.3  0.0   2:23.08 pfe_ctrl_tim
 2765 mysql     20   0  309m  37m 2328 S   0.3 16.6   5:42.29 mysqld
    1 root      20   0  1660  436  408 S   0.0  0.2   0:10.47 init
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.01 kthreadd
    3 root      20   0     0    0    0 D   0.0  0.0   0:00.00 cpu1_hotplug
    4 root      20   0     0    0    0 S   0.0  0.0   0:02.70 ksoftirqd/0
    7 root      rt   0     0    0    0 S   0.0  0.0   0:00.00 migration/0
    8 root      rt   0     0    0    0 S   0.0  0.0   0:00.00 migration/1
    9 root      20   0     0    0    0 S   0.0  0.0   0:07.23 kworker/1:0
   10 root      20   0     0    0    0 S   0.0  0.0   0:00.30 ksoftirqd/1
   11 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 khelper
   12 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/u:1
   37 root      20   0     0    0    0 S   0.0  0.0   0:13.43 kworker/1:1
  219 root      20   0     0    0    0 S   0.0  0.0   0:00.33 sync_supers
  221 root      20   0     0    0    0 S   0.0  0.0   0:00.00 bdi-default
  223 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kblockd
  229 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 ata_sff
  240 root      20   0     0    0    0 S   0.0  0.0   0:00.07 khubd
  246 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 md
  269 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 rpciod
  282 root      20   0     0    0    0 S   0.0  0.0   0:01.74 kswapd0
  283 root      20   0     0    0    0 S   0.0  0.0   0:00.00 fsnotify_mar
  284 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 nfsiod
  287 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 crypto
  337 root      20   0     0    0    0 S   0.0  0.0   0:00.01 scsi_eh_1
  340 root      20   0     0    0    0 S   0.0  0.0   0:00.12 kworker/u:2
  351 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 comcerto_spi
  353 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 comcerto_spi
  402 root      -2   0     0    0    0 D   0.0  0.0   0:07.51 btn_t
  412 root      -2   0     0    0    0 S   0.0  0.0   0:00.00 a3gblink_t
  429 root      20   0     0    0    0 S   0.0  0.0   0:07.80 md0_raid1
  432 root      20   0     0    0    0 D   0.0  0.0   0:02.18 kjournald
  558 root      20   0  2404  604  496 S   0.0  0.3   0:00.28 udevd
  607 root      20   0  2400  724  392 S   0.0  0.3   0:00.02 udevd
  608 root      20   0  2400  584  364 S   0.0  0.3   0:00.00 udevd
  818 root      20   0     0    0    0 D   0.0  0.0   0:00.95 flush-9:0
  911 root      20   0     0    0    0 D   0.0  0.0   2:23.13 pfe_ctrl_tim
 1552 root      20   0     0    0    0 D   0.0  0.0   0:00.52 jbd2/sda4-8
 1553 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 ext4-dio-unw
 1962 root      20   0  1704  460  400 D   0.0  0.2   0:21.19 syslogd
 1998 root      20   0  309m  536  492 S   0.0  0.2   0:03.97 php5-fpm
 1999 www-data  20   0  309m  360  348 S   0.0  0.2   0:00.00 php5-fpm
 2000 www-data  20   0  309m  360  348 S   0.0  0.2   0:00.00 php5-fpm
 2020 root      20   0 92164 7312 5868 S   0.0  3.2   0:06.92 apache2
 2114 messageb  20   0  2692  772  556 S   0.0  0.3   0:00.24 dbus-daemon
 2181 root      20   0  3840  520  440 S   0.0  0.2   0:00.02 cnid_metad
 2183 root      20   0  1340  336  336 S   0.0  0.1   0:00.09 mysqld_safe
 2194 root      20   0 14392 1184  916 S   0.0  0.5   0:20.49 afpd
 2202 avahi     20   0  2864 1060  864 S   0.0  0.5   0:01.05 avahi-daemon
 2207 avahi     20   0  2736  228  200 S   0.0  0.1   0:00.00 avahi-daemon
 2241 root      20   0 27368 2012 1548 S   0.0  0.9   0:00.61 console-kit-
 2348 root      20   0 22284 1456 1144 S   0.0  0.6   0:00.27 polkitd
 2627 root      20   0  7224 2140 1372 D   0.0  0.9   0:16.87 cupsd
 2632 www-data  20   0 99664  18m  12m S   0.0  8.1   0:05.77 apache2
 2708 root      20   0  4080  368  260 S   0.0  0.2   0:00.00 dhclient
 2737 colord    20   0 23704 1636 1276 S   0.0  0.7   0:00.21 colord
 2765 mysql     20   0  309m  37m 2328 S   0.0 16.4   5:42.40 mysqld
 2766 root      20   0  1444  384  384 S   0.0  0.2   0:00.01 logger
 2774 colord    20   0 47472 7212 5404 S   0.0  3.1   0:01.21 colord-sane
 2868 root      20   0  5136  872  444 S   0.0  0.4   0:00.01 sshd
 2881 root      20   0  8136 1204  740 S   0.0  0.5   0:04.77 nmbd
 2897 root      20   0 15560 1864 1204 S   0.0  0.8   0:01.35 smbd
 2906 root      20   0 16692 2200 1420 S   0.0  1.0   0:00.13 smbd
 3275 Debian-e  20   0  6212  728  408 S   0.0  0.3   0:00.06 exim4
 3305 root      20   0  1636  536  420 S   0.0  0.2   0:00.01 getty
 3389 www-data  20   0  100m  22m  14m S   0.0  9.7   0:04.08 apache2
 3392 www-data  20   0 99760  19m  13m S   0.0  8.8   0:09.45 apache2
 3396 www-data  20   0 99648  18m  12m S   0.0  8.0   0:02.71 apache2
 3397 www-data  20   0 99672  17m  11m S   0.0  7.9   0:07.10 apache2
 3525 www-data  20   0 99760  16m  10m S   0.0  7.3   0:02.85 apache2
 3561 www-data  20   0 99632  18m  12m S   0.0  8.1   0:02.47 apache2
 3802 www-data  20   0 92252 3192 1512 S   0.0  1.4   0:00.43 apache2
 3803 www-data  20   0 92244 3156 1476 S   0.0  1.4   0:00.49 apache2
 3804 www-data  20   0 92236 2536  940 S   0.0  1.1   0:00.00 apache2
 4011 timemach  20   0 18620 2312 1624 S   0.0  1.0   0:00.69 afpd
 4016 root      20   0     0    0    0 D   0.0  0.0   0:00.89 flush-8:0
 4040 root      20   0 17484 3756 2956 S   0.0  1.6   0:00.37 smbd
 4045 root      20   0  9688 2908 2248 S   0.0  1.3   0:00.59 sshd
 4053 root      20   0  4152 1612 1208 S   0.0  0.7   0:00.07 bash
 4061 root      20   0     0    0    0 S   0.0  0.0   0:00.78 kworker/0:2
 4064 root      20   0  9688 2916 2248 S   0.0  1.3   0:00.86 sshd
 4067 root      20   0     0    0    0 D   0.0  0.0   0:01.30 kworker/0:0
 4071 root      20   0  4156 1608 1204 S   0.0  0.7   0:00.04 bash
 4078 root      20   0  3864 1048  876 D   0.0  0.5   0:00.02 apt-get

@State_Flux

i had simmilar issue related to swap. Swap partition was mounted but not used by system.

swapon -f fixed the page size. After reboot everything was just fine and PLEX was able to index all my media.

Btw. even without swap, memory was never fully utilized on my devicebut the device was just laggy.

However, you are mentioning that you have plenty of free ram, so it also might be something else

Thank you for you help,

everything seemed OK with my swap but I tried a swapon -f anyway which didn’t change anything. I think I will have to reinstall the system - seems all my playing around messed it up pretty badly. :wink:

Still better than the original firmware :wink:

State_Flux wrote:

 

Still better than the original firmware :wink:

Yeah! But samba’s speed… :frowning:

I am using debootstrap if possible. Mostly if I am not sure about the software i am installing.

This might help you to prevent some future re-installs of the system

Debootstrap works fine. Also possible to install chroot (Yes, in v4 firmware. I make new script for that. See in G.Drive folder. But not tested properly.)

Fox_exe wrote:


State_Flux wrote:

 

Still better than the original firmware :wink:


Yeah! But samba’s speed… :frowning:

Out of curiosity, post your current smb.conf. I think samba may have a hard time saturating gigabit on this sort of device (not enough CPU). What sort of client are you using? What speeds are you seeing?

greekpub wrote:

What speeds are you seeing?

Samba v3 + default conf = ~35 MB/s

Samba v4 + default conf = ~40MB/s

Samba v4 + Tuning = 45-50 MB/s

Samba v4 + Comcerto/WD Patches + Tuning = 60-80 MB/s

Samba v4 + Comcerto/WD Patches + Tuning + PageSize=64kb = 80-105 MB/s

Samba v3 + Tuning + PageSize=64k = 50-70 MB/s

Fox_exe wrote:


greekpub wrote:

What speeds are you seeing?


Samba v3 + default conf = ~35 MB/s

Samba v4 + default conf = ~40MB/s

Samba v4 + Tuning = 45-50 MB/s

Samba v4 + Comcerto/WD Patches + Tuning = 60-80 MB/s

Samba v4 + Comcerto/WD Patches + Tuning + PageSize=64kb = 80-105 MB/s

Samba v3 + Tuning + PageSize=64k = 50-70 MB/s

That’s really odd. I noticed that WD is applying the following socket optiosn in their stock smb.conf file:

socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=2048000 SO_SNDBUF=2048000

In the samba community these are generally considered voodoo and unneeded for a modern kernel. See Jeremy Allison’s comments in this mailing list thread:  https://marc.info/?l=samba&m=139714587027299&w=2. And discussion of the samba documentation here:  https://marc.info/?l=samba-technical&m=136912391412060&w=2

The fact that the above socket options seem to affect performance indicates that something is broken. Maybe incorrectly tuned network stack. Although it still may be the case that WD’s developer(s) simply pulling old ‘performance parameters’. Another example is adjusting the “min receivefile size”. These only affect the behavior of smbd when processing SMBWriteX requests. Since most of us are using SMB2_write, there is very little chance this parameter actually does anything.

All that being said, I’m not sure what the proper course of action is. The network stack may be in need of some manual tuning rather than samba. Maybe try a newer / different kernel that is less broken. :cry:

Also note that samba4 supports server-side copy for Windows 8+ clients and robocopy in Windows 7. This makes moving files / directories within the samba server almost instantaneous. Are you using samba 4.1.x or samba 4.0.x? There are some speed improvements in SMB2 in the 4.1.x branch. But then again 80-105MB/s is really good for this sort of device using samba.