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

Hello everybody,

i was happy to find this topic here, for installing a new OS on the WD box.
unforturnately i made something wrong, and dont know how to fix my issue.
i would like to ask u how i can get out of this and get my box running again.

WD My Cloud 2 TB, 1 bay, Gen 1

I installed the Debian clean system, everything was working fine, but couldnt install the OMV.
So i installed the image with the OMV preinstalled, and there the problem came.

That was the last output i got from it:

root@MyCloud:/home# ./install.sh

Ok, lets go…
Stop all processes…
forked-daapd: no process found
[ ok ] Stopping cron (via systemctl): cron.service.
./install.sh: line 44: wdAutoMountAdm.pm: command not found
Recreate mdraid partitions:
Restoring raid…

Current device: /dev/md1
Upgrade device: /dev/md0
Upgrade part: /dev/sda1
Current raid status:

Personalities : [linear] [raid0] [raid1] [raid10]
md1 : active raid1 sda1[1] sda2[0]
1999808 blocks [2/2] [UU]

unused devices:

Creating new mdraid volume…
mdadm: set /dev/sda1 faulty in /dev/md1
mdadm: hot removed /dev/sda1 from /dev/md1
Installing new data…
Done! Cleanup…
Reboot to take effect…
root@MyCloud:/home# Not writing utmp record, assuming that systemd-update-utmp is used.
Rebooting.
packet_write_wait: Connection to 192.168.1.10 port 22: Broken pipe

UPDATE: and i get now a solid white LED as status

I hope somebody knows how to help me.
thank your very much.

  • laonex

If you can ssh in still, i would ssh in and take a look at / share the debian boot log. If you can’t ssh in I would try booting from Fox’s usb boot drive and telnet in to recover and try again.

Hello acole, thanks for your reply. I can´t SSH it anymore. Fox´s USB Boot drive also doesn´t work.
I as well tryed the Recovery.zip with the DHCP method, also doesn´t work.

Does it help if I connect the HDD directly to my PC to somehow prepare the existing partitions on the HDD with a new OS of the WD firmware?

@laonex, Yes, its possible: Firmware stored on HDD. Just follow this instruction:
https://ftp.anionix.ru/WDMyCloud/WDMyCloud-Gen2/_Unbricking_en.txt
(“Alternative way” on end of instruction. Replace /dev/sda to Your disk letter!)

First of all: great work, thanks for your efforts in opening up the wdmc.
I have a WD My Cloud Mirror Gen2 and I am still unsure after having read this thread and some other ressources:
Does Debian Jessie work properly on this device? If yes: can I install OMV on Jessie on a WD My Cloud Mirror Gen2? Thanks for your help!
Best regards, Marina

I am currently running Debian Jessie on my Gen2 My Cloud, which works perfectly! However I would to start afresh; is it possible at all to do a clean install of Debian Jessie from an existing installation of Debian Jessie? Thanks for all of your work!

rm /linuxrc

After that - device will boot to “minios” (Recovery). In this recovery you can do with HDD all what you want (Format rootfs and reupload debian for example)

1 Like

Worked a treat, thank you for the guidance! :slight_smile:

DSM on wd my cloud gen2 is stable or unstable?
I see on anionix.ru it has problem with 4 file overwrite, but here at forum the 1st post i see it is stable.
My Cloud gen2 affected too with low copy speed, and problems with batch file copy (more thousand), what i experienced with gen1?

What is the best solution for my cloud gen2? Original fw with app hack, or other firmware?

Gen1 - Stable. All work good.
Gen2 - Sometime few files are damaged and idk why… So - its “Unstable”. (Maybe its because i use old kernel from 5xxx build, but DSM6 is 8xxx)

Hi I installed Clean OS (Debian) on my MyCloud 3GB (GEN1) and then OVM 3 afterwards. Everything is working smoothly except that I get hardcore log spam from systemd service and guess what: the drive won’t spin down aka. no sleep aka. what mycloud is best at.

  • The drive is set to spin down after 10 mins in OVM drive config

Here is the the log entries that I get 24/7: http://pastebin.com/2aUAq47n

Can somebody point out to me how to stop the log spam and get the drive to sleep?

Yeah, need some additional “tuning” for enable sleep mode (HDD wont sleep while something reads/writes).
So, all what you need - search who write/read something on disk and move these folder/files to ram, or just disable this program.
You can find some info on OMV forums (Search instructions for bananaPI or RaspberryPI).

Hey there,

@Fox_exe, really impressive work – knowing what I could do with it, I got a MyCloud Mirror Gen2 at a bargain. I’m an experienced Linux user, but I don’t think I really understand your Howto (at https://ftp.anionix.ru/WDMyCloud/WDMyCloud-Mirror-Gen2/Debian/Dev/_info.txt) to install Debian on the MyCloud. So I thought, I could write a longer one, in German and English. Just to make sure I get your meaning right, this is how I’d install your files on my MyCloud:

  • Attach one HDD to a Desktop PC, partition it:

!!! Replace “/dev/sda” to WDMC disk !!!
Run it for both disks if you need raid and replace “missing” in mdadm command to 2nd disk (/dev/sdb)
parted --script /dev/sda “mklabel gpt
mklabel gpt
mkpart primary 0% 512MB
mkpart primary 512MB 4096MB
mkpart primary 4096MB 100%
set 1 raid on
set 2 raid on
set 3 raid on”

  • Partition the other HDD, using the same instructions for Parted

  • Put the HDDs back into the MyCloud, connect to the device via SSH and run the commands to put the two disks into the RAID array

mdadm --create /dev/md0 --level=1 --metadata=0.9 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm --create /dev/md1 --level=1 --metadata=0.9 --raid-devices=2 /dev/sda2 /dev/sdb2
mdadm --create /dev/md2 --level=1 --metadata=0.9 --raid-devices=2 /dev/sda3 /dev/sdb3

  • Partition the Root filesystem of the RAID:

mkfs.ext4 /dev/md1

  • Download jessie-rootfs.tar.xz, unzip it and put the Tar-file onto the USB-Stick (there’s no unzip utility in the Mycloud Busybox, but untar is there!)

xz -d jessie-rootfs.tar.xz

  • Put jessie-rootfs.tar, uImage and uRamdisk on a USB Stick (formatted with VFAT/FAT32), connect it to the USB port and mount it

mkdir /mnt/root
mount /dev/md1 /mnt/root

  • Copy file from USB stick to /mnt/root and untar

cd /mnt/root
tar xvf jessie-rootfs.tar

  • Run these commands to copy uImage and uRamdisk into flash

dd if=/dev/zero of=/dev/mtdblock1 # “No space” errors - normal.
dd if=/dev/zero of=/dev/mtdblock2
dd if=uImage of=/dev/mtdblock1
dd if=uRamdisk of=/dev/mtdblock2

  • Login with this data and run Debian Jessie

Hostname: WDebian
User: root
Passwd: root

Thanks in advance for your reply!

Andy

Hi Fox,

I’ve been working towards setting up my My Cloud as a lightweight home server, but have hit a brick wall when trying to install Docker. It requires the ‘overlay’ filesystem which was bundled into the Linux kernel from version 3.18, however when running ‘uname -r’ it appears the kernel version installed in your clean Debian distribution is 3.10. When running ‘dpkg --list | grep linux-image’ it doesn’t even appear that a linux-image package is installed. Is it a safe move to install a more recent version of the Linux kernel, and if so do we need the standard armmp or the armmp-lpae version? Thanks for any help! :grin:

Im using this kernel: GitHub - MarvellEmbeddedProcessors/linux-marvell: Marvell Armada Linux kernel (Officiall Marvell. WD uses it too, but older version) + Few patches and DTS file for compatability.
Possible to use latest linux kernel 4.4.x, but i cant make it work in somehow…
Need armhf version (Cortex A9 + Neon, Marvell, armv7l (arch/arm/mach-mvebu + mvpp2 driver for network in kernel tree))

No matter what I try I can’t get tools like ramlog, log2ram to stop the drive from writing. I think I will try to start with Clean Debian now without OMV and focus on drive sleep first and then add everything one by one afterwards (afp,nfs).

Is there a guide to do a reinstall of Clean Debian without having to connect the drive to a pc? I still have full SSH access and everything is working. Can I just use the autoinstall script with Clean Debian + OMV?

Yes.

But better to install ovm, then start “tuning”.
Some info: https://ftp.anionix.ru/WDMyCloud/WDMyCloud-Gen1/HDD%20Spindown%20and%20sleep%20mode.txt

I already tried following this guide but most of it is outdated with Debian Jessie I think.


Edit /etc/fstab, add mount options to /dev/sda4 (Data partition) and /dev/md0 (root):

noatime,nodiratime,commit=60

I added the fstab entries like described


Ramlog already installed in all firmwares. But you can install it manually (Or update preinstalled):

cd /tmp
wget http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb
dpkg -i ramlog_2.0.0_all.deb
rm ramlog_2.0.0_all.deb

  • Ramlog doesn’t work anymore on Debian Jessie (not supported)
  • I tried using Log2Ram
  • I tried installing the OMV flash memory plugin
  • Log files are still being written to HDD all the time

Disable some services:

update-rc.d bootlogd disable
update-rc.d rrdcached disable
update-rc.d collectd disable
update-rc.d monit disable

Also you can change start option in /etc/default/service_name

insserv -v -d

Those commands don’t work anymore on Debian Jessie.

for the first I just get file not found and the others output this:

root@MyCloud:~# update-rc.d monit disable
insserv: warning: current start runlevel(s) (empty) of script monit' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script monit’ overrides LSB defaults (0 1 6).
Sent message type=method_call sender=n/a destination=org.freedesktop.systemd1 object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=Reload cookie=1 reply_cookie=0 error=n/a


Disable unusual cron jobs:

crontab -e

I don’t see any cronjobs listed here. Everything commented out.

Move fake-hwclock to “daily” folder:

mv /etc/cron.hourly/fake-hwclock /etc/cron.daily

I moved this file like described.


Edit samba startup script (add ram folder for tmp files):

nano /etc/init.d/samba

in start-command after first row “deamon…” add this:

mount -t tmpfs tmpfs /var/run/samba
mount -t tmpfs tmpfs /var/cache/samba

in stop-command before “log_end_msg 0” add this:

umount /var/run/samba
umount /var/cache/samba

The file looks different now, I can’t edit it like described.


Increase dirty-writeback-time 5s to 60s

echo 6000 > /proc/sys/vm/dirty_writeback_centisecs

Reboot.

I did both steps like described.


########
Check if all runing normall:

Ramlog

/etc/init.d/ramlog status

If not - read logs:

tail /var/log/ramlog

#ramlog is working with tmpfs? samba-mounts to tmpfs exists?:
df -h

Ramlog doesn’t work like mentioned earlier.


Sorry for the wall of text. I really appreciate your time doing this and I will make sure to donate something for the project ASAP.

Nevermind, I managed to brick the device. No SSH and WebGUI from OMV anymore.

I am now stuck in the restore process at point 6

  1. In DHCP window you can see something like this:
    DHCPREQUEST for 00:90:12:34:56:78 () from interface 192.168.0.1 received
    Host 00:90:12:34:56:78 (Host009012345678) allotted 192.168.0.2 for 36000 seconds
  	DHCPDISCOVER for 00:90:12:34:56:78 () from interface 192.168.0.1 received
  	Host 00:90:12:34:56:78 (Host009012345678) offered 192.168.0.2

I don’t have any entries like that in the DHCP window. The light at the ethernet port is blinking when I ping the device.
I connected the MyCloud directly to PC via Ethernet. That is correct right?