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

Step 2 OK?
Need network connection to WDMC - 1gbps (Inportant. 100mbps not work)

I connected the MyCloud directly to the Computer via ethernet.

Should I be using a my normal Network (Gigabit Router) like always?

Hey there!
Finally, I’ve been able to get the device to boot with Debian Jessie (fan is quiet after boot). But I can’t connect to the device with SSH or telnet. If I remove the HDDs the MyCloud goes into Busybox and I can connect via telnet.

When the MyCloud boots normally, I use NMAP (Portscanner) to check if any ports are open/services are running.

Result:

Nmap scan report for 192.168.2.103 [host down, received no-response]
Read data files from: /usr/bin/…/share/nmap
Nmap done: 1 IP address (0 hosts up) scanned in 0.81 seconds
Raw packets sent: 2 (56B) | Rcvd: 0 (0B)

If I can connect with telnet, this is the result:

Completed Parallel DNS resolution of 1 host. at 18:50, 0.03s elapsed
Initiating SYN Stealth Scan at 18:50
Scanning PC192-168-2-103 (192.168.2.103) [65535 ports]
Discovered open port 23/tcp on 192.168.2.103

So it seems to me the network doesn’t come up in the installed Debian Jessie.
Conclusion: Some settings in the Rootfs must be wrong. I don’t have time to look more closely at the problem (would need to attach both RAID disks to another PC…). I think I’ll use them in a traditional home server from now on. Maybe find some future use for the enclosing…

@Andreas_Breitbach, You talnk about WDMC Mirror? This thread for 1-disk devices (Gen1/Gen2).
In any case - In Busybox and System MAC’s are different (Busybox uses randmom MAC or preconfigured in kernel / static)

Hey!

Just wanted to report back real quick: I successfully debricked my device with lots of help from Fox. I am now running Clean Debian with only SMB and NFS installed (no OMV). Everything is working great at the moment I got amazing Samba speeds with Fox’s config (90 MB/s read) and browsing shares is at least 3-4 times faster than with stock WD firmware. No log spam, no indexing,samba discovery works on Mac OS X etc.


###The only thing that is not working: drive sleep.

  • crontab -e is empty
  • cron.hourly is empty
  • moved log2ram cronjob to cron.daily
  • moved fake-hwclock to cron.daily
  • dirty writeback time changed to 60s

###I installed hdparm and the steady.sh script from this thread to watch the status.

  • the drive will not got to sleep by itself for hours of no access
  • spin down time is set to 20 min in /etc/hdparm.conf
  • drive will go to sleep when command hdparm -Y /dev/sda is issued but will spin up again after a minute.

steady.sh log

2017-02-26 14:12:40 reboot
2017-02-26 14:12:40 active/idle
2017-02-26 14:47:14 reboot
2017-02-26 14:47:14 active/idle
2017-02-26 17:16:21 reboot
2017-02-26 17:16:21 active/idle
2017-02-26 18:42:09 reboot
2017-02-26 18:42:09 active/idle
2017-02-26 19:01:21 reboot
2017-02-26 19:01:21 active/idle
2017-02-26 23:19:30 reboot
2017-02-26 23:19:30 active/idle
2017-02-26 23:21:23 standby # command issued
2017-02-26 23:22:23 active/idle
2017-02-26 23:59:10 reboot
2017-02-26 23:59:10 active/idle
2017-02-27 12:04:53 reboot
2017-02-27 12:04:53 active/idle

/etc/hdparm.conf

/dev/sda {
spindown_time = 240
}

/etc/fstab

#####Default mounts for WDMyCloud
/dev/root / ext3 noatime,nodiratime,commit=60,errors=remount-ro 0 1
/dev/sda3 none swap sw 0 0
tmpfs /tmp tmpfs rw,size=64M 0 0

#####Data partition
/dev/sda4 /data ext4 noatime,nodiratime,commit=60,data=writeback,barrier=0,nobh,errors=remount-ro 0 0

changes are highlighted in bold


###IOTOP

  • I installed iotop to monitor disk writes
  • I only see writes from kjournald wich should all stay in ram because I have log2ram installed. and some reads from iotop itself of course.

I’m confused? I can’t find info on log2ram. But if as you stated that the kjournal writes to ram. If the system
powers off or reboots. How can it use the data that was written to ram? It is no longer available. Are you
sure that is what log2ram does?

Hey, you can find some info on log2ram here.
I am using this because ramlog does not work on Debian Jessie.
I am thinking it writes from ram to disk on shutdown? Not sure if I understand.
The reboots were just to make sure everything is using my latest file edits. As you can see in the log the drive ran for 12 hours without reboot.

2017-02-26 23:59:10 active/idle
2017-02-27 12:04:53 reboot

One would expect that writting from ram to disk on shutdown would work. But
what happens if the system has a power failure or crashes etc. How can the
filesystem be corrected.

Well, we are talking about log files. I am fine if they are lost on power failure. My priority is to get the drive to sleep at the moment, the rest works as intended for first time since i bought this device :joy:

That is correct. But the Kjournal is not a log as you are thinking. A journaling filesystem has a dedicated area
on disk that contains information about every change made to the filesystem. If the system crashes and the
filesystem is damaged the journal is used to correct the problems with the filesystem. This is an over simplification of the process. When I was looking into why the disk would not go to sleep. I found that there were several problems keeping the disk from going to sleep. The smb process was updating the atime of a couple of different files every few seconds. Mounting the root filesystem with noatime and nodiratime helped with that problem.
You say that you can put the disk to sleep but it wakes up in a short time frame. My experience with sleep is with the released firmware on the gen1 system. My system sleeps 83% of the time. I used a program called btrace to trace the I/O to see what disk writes were being issued. Then you need to determine what that I/O is writting. In my testing most of the time it was writting to the journal. I found with this process that smb was updating the atime on a file called /tmp/browse.dat every few seconds. I also found that smb was also updating the atime of the smbpasswd file.
Since you are not running the WD firmware but are running a standard Debian release I’m not sure what could be causing the system to wake up or not go to sleep.

hdparm -B 127 -S 120 /dev/sda

For drive auto-sleep in 10 min.

find / -cmin -10 -not -path "/proc/*" -not -path "/sys/*"

For find what changed on disk (What file wakeup hdd)

Okay, looks like I was completely wrong on what ksystemd does. Lots of useful information, thanks! I will check if I can move the browse.dat to RAM as well.

Thanks for the commands. The first one seems to be wrong though?
The second works like a charm and will help me investigate :slight_smile:

root@MyCloud:~# hdparm -B 127 -S 120 /dev/sda

/dev/sda:
 setting Advanced Power Management level to 0x7f (127)
 HDIO_DRIVE_CMD failed: Input/output error
 setting standby to 120 (10 minutes)
 APM_level	= not supported

You don’t need to move browse.dat. The fact that the root filesystem is mounted with noatime and nodiratime corrects the problem with browse.dat.

Okay thanks for the info. I finally found out that my log2ram service isn’t even working. What is anybody else here using instead of ramlog on Debian Jessie?

I got a little closer on my journey to a well-sleeping MyCloud :grin:

I try to document my steps here so others can hopefully benefit from this. Here is what I did since my last post:

  • I installed log2ram correctly. It was installed to a wrong directory which resulted in the service failing. It now shows up under df -h as log2ram 40M 660K 40M 2% /var/log
  • I followed this guide which creates a symlink for /var/cache/samba in /var/run/

Now the drive is going to sleep by itself. A bit too often for my taste but I think will do some more testing.

2017-03-01 00:09:33   standby
2017-03-01 00:10:33   active/idle
2017-03-01 00:59:35   standby
2017-03-01 01:17:36   active/idle
2017-03-01 01:27:36   standby
2017-03-01 02:09:44   active/idle

2017-03-01 02:19:44   standby
2017-03-01 06:25:51   active/idle

2017-03-01 06:45:52   standby
2017-03-01 06:52:52   active/idle
2017-03-01 07:02:52   standby
2017-03-01 07:18:53   active/idle

2017-03-01 07:37:53   standby
2017-03-01 11:34:06   active/idle

2017-03-01 11:45:06   standby
2017-03-01 12:36:07   active/idle
2017-03-01 12:46:08   standby
2017-03-01 13:25:10   active/idle
1 Like

I know this is a bit off topic… but does anyone know if the WD MyCloud 3TB (G1) is running SATA III or SATA II ?

Sata-2. But compatable with Sata-3 HDD’s.

@Fox_exe, great work!

I could not find information on how to build the file “debiab-jessie-firmware” by myself. Is there any tutorial for developers on how to build the debian firmware myself?

Thank you

Base image - from Debootstrap (Im use tutorials for RaspberryPI).
Plus few modifications and additional packages for run on our device (Kernel modules, openssh-server etc…)
Result fimware builded by “mkimage” tool from WD GPL source code achive (Firmware header explain, all other - can be found in wd source archive))
“Initrd” - From “Buildroot” tool (Plus custom startup script).