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

Hi Fox,

just to confirm
I have downloaded teh firmware for EX2 unpacked it and i got 4 files

  • config.tgz
  • rootfs.cfs
  • uImage.bin
  • uRamdisk.bin

the MTD devices on WDMyCloud-Ex2 not the ultra are the following

  1. mtdblock0
  2. mtdblock1
  3. mtdblock2
  4. mtdblock3
  5. mtdblock4
  6. mtdblock5
  7. mtdblock6

to restore I should do the following

  1. ssh to my EX2 with the DSM firmware and do the following
  2. dd if=uImage.bin of=/dev/mtdblock1
  3. dd if=uRamdisk.bin of=/dev/mtdblock1
  4. dd if=root.cfs of=/dev/mtdblock3
  • any update on the steps above needed
  • Question : how do I create the ubifs Partion on /dev/mtdblock5 to put the config file

Yes, all is right.
I think Ubifs already present, but contains wrong or damaged configs. Just mount it and extract config.tar.gz into it.

ubiattach /dev/ubi_ctrl -m 5 -O 2048
mkdir /mnt/config
mount -t ubifs ubi0:config /mnt/config

There is example of creating ubifs image (and test in Nand emulator). Not for our device, but there is all useful commands:

thanks for your reply one last question
Ubiattach command is not available on DSM version any idea how to get it on DSM
also when i try to mount the ubifs i get the following error
mount: unknown filesystem type ‘ubifs’

is it possible to use this revert method
======== REVERT =========
dd if=/dev/zero of=/dev/mtdblock1
reboot -f

After this WDMC runs in “Rescue” mode. Go to webgui and upload original firmware file (.bin)

@diaahussein

It seems like you figured it out, however, I am not able to trigger the Safe Mode, because the /dev/mtdblock4 is corrupted.

Could you please hand me a copy of it? It would be much appreciated.

Thanks again, Jack

Hi Jack
My Box is EX2 not EX2 Ultra
I am not sure if the copy from it will work on your box they have deferent HW
my recommendations is to get the correct image for your Box EX2 Ultra
HW Specifications

Ok…
Dump partition (dd) and open it on PC (Ubuntu/Debian + apt install mtd-tools), update, then - reupload back to WD.

I installed this: http://4pda.ru/forum/index.php?showtopic=467828&view=findpost&p=87961189, it worked. I did the debian and OMV update. Unfortunately, now I only have SSH access. OMV does not start. Reloading does nothing. Please help. How Restore my Wd My Cloud Home?

Dear Fox!

Thanks again for your help, I really appreciate that.
I have now dd’ed uImage.bin to mtdblock1, uRamdisk.bin to mtdblock2, rootfs.cfs to mtdblock3, and executed the following commands on mtdblock5:
ubiformat on /dev/mtd5, then i have created an ubifs volume with the name config, that fills the whole device, and extracted config.tgz onto it.

Still, the device does not boot.

Any pointers?

UPDATE: I have it, thanks to this:

Method works with any MyCloud EX2 Ultra

@thejack, Please, dumpt the 5th partition and upload here (For easy flash if someone have same problems).
I make my own dumps, but can’t test: https://fox-exe.ru/WDMyCloud/WDMyCloud-Mirror-Gen2/Original/

https://github.com/dswv42/wd_my_cloud/blob/main/misc/EX2_Ultra_mtdblock4.bin

This is the one you need to flash :wink:

Cool. I analyse this file and get some interesting info:
Header contains same data as Firmware file (model code, version, build version, something like CRC32)
And two files: uImage + uRamdisk
If i’m right - we can write this two files in mtd1 and mtd2 and device will boot into recovery (Force recovery mode)
All files and some info here: https://fox-exe.ru/WDMyCloud/WDMyCloud-Mirror-Gen2/Dev/WD-Recovery/

I successfully installed Debian 9 and OMV 4 on my WD My Cloud Mirror Gen2, see

I currently running kernel 3.10.70.

What is the latest kernel I can use?

https://fox-exe.ru/WDMyCloud/WDMyCloud-Mirror-Gen2/Dev/Kernel-4.15.0-plus/

1 Like

Thanks.

So I only need to unpack libs-4.15.0+.tar.xz and bring uImage and uRamdisk in place?

Yep.
libs - to rootfs
uImage and uRamdisk - to mtdblock’s 1 and 2.

1 Like

Hi all,

I’ve OMV working flawless, but I would like to change the harddrives for higher capacity. Is there any way to migrate the OS to the new drives? I can replicate the data inside, is not too much.

Thanks

Well, I moved all files to the harddisk, extracted the tar

root@wdmc:/tmp/Kernel-4.15.0-plus# tar -xf libs-4.15.0+.tar.xz -C /

cleared out the mdblocks

dd if=/dev/zero of=/dev/mtdblock1
dd if=/dev/zero of=/dev/mtdblock2

and finally

root@wdmc:/tmp/Kernel-4.15.0-plus# dd if=uImage of=/dev/mtdblock1
7235+1 records in
7235+1 records out
3704603 bytes (3.7 MB, 3.5 MiB) copied, 1.71092 s, 2.2 MB/s
root@wdmc:/tmp/Kernel-4.15.0-plus# dd if=uRamdisk of=/dev/mtdblock2
5234+1 records in
5234+1 records out
2679902 bytes (2.7 MB, 2.6 MiB) copied, 1.26184 s, 2.1 MB/s

but the system does not boot again.

Well, s**t…
OS can’t find something in kernel (i think). Need check bootlog (uart console).

This is exactly the problem - I don’t have this UART device.

I managed to do a rescue boot from USB and I did copy the kernel 4.14 files in place.

The box is now booting in rescue mode, I have telnet access and my disk devices look like this

/ # cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md124 : active raid1 sda3[0]
      484386752 blocks [2/1] [U_]
      bitmap: 4/4 pages [16KB], 65536KB chunk

md125 : active raid1 sda1[0] sdb1[1]
      498624 blocks [2/2] [UU]

md126 : active raid1 sda2[0] sdb2[1]
      3499968 blocks [2/2] [UU]

md127 : active raid0 sdb3[0]
      7810025984 blocks 512k chunks

It is no longer md0, md1, md2 - is this my problem now?

I corrected this by doing

/ # mdadm -S /dev/md126
mdadm: stopped /dev/md126
/ # mdadm --assemble --verbose /dev/md0 /dev/sda1 /dev/sdb1
mdadm: looking for devices for /dev/md0
mdadm: /dev/sda1 is identified as a member of /dev/md0, slot 0.
mdadm: /dev/sdb1 is identified as a member of /dev/md0, slot 1.
mdadm: added /dev/sdb1 to /dev/md0 as 1
mdadm: added /dev/sda1 to /dev/md0 as 0
mdadm: /dev/md0 has been started with 2 drives.
/ # mdadm --assemble --verbose /dev/md1 /dev/sda2 /dev/sdb2
mdadm: looking for devices for /dev/md1
mdadm: /dev/sda2 is identified as a member of /dev/md1, slot 0.
mdadm: /dev/sdb2 is identified as a member of /dev/md1, slot 1.
mdadm: added /dev/sdb2 to /dev/md1 as 1
mdadm: added /dev/sda2 to /dev/md1 as 0
mdadm: /dev/md1 has been started with 2 drives.

but after reboot the device names are changed again.

So I cannot get further:

/ # init 2
# Loading, please wait...
# Mounting filesystems...
mount: mounting sysfs on /sys failed: Device or resource busy
mount: mounting proc on /proc failed: Device or resource busy
# Check disk and init
### Press any key to stop and run shell... (2)mdadm: No arrays found in config file or automatically
# /dev/md1 not exist!
# Runing a shell...
ifup: interface lo already configured
ifup: interface eth0 already configured

How to solve the md___ name problem?