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


#1457

After add pathes (Improved slice) - upto 80MB/s

Hello @Fox_exe,
what patch do you speak? and how to apply it?


#1458

See samba sources provided by WD (firmware source code).
Simple find same version of Samba, compare and extract all changes (make patch).


#1459

Hello,

I purchased a gen2 My Cloud single bay 4TB a few days ago. It is still in its virgin state, I did not configure anything except passwords and SSH access. I decided I want to install OMV on it, maybe also NextCloud and Omeka, along with TimeMachine and other backups (should the memory allow for it). This means, I might need to install a full Linux on it. But before I do, I would like to make sure, that I understood the architecture of the device. I would be very glad, if somebody could comment on this, or even better, walk me through the device architecture and the available options.

As I see it, the gen2 My Cloud device looks like this:

  • Marvell Armada 375 (ARMv7, dual core, 32bit, Linux armhf architecture)
  • 512MB RAM
  • 256MB Flash Rom
  • 4 TB HDD
  • 1Gbit/s (model unknown to me, I guess it will be from Marvell as part of the SOC)

Disk layout, after boot, is:

root@WDMyCloud /etc # blkid -o list
device                         fs_type             label       mount point                        
--------------------------------------------------------------------------------------
/dev/loop0                     squashfs                        /usr/local/modules
/dev/sda1                      linux_raid_member               (in use)       
/dev/sda2                      ext4                            /mnt/HD/HD_a2
/dev/sda3                      ext4                            /boot
/dev/sda4                      ext4                            /mnt/HD_a4
/dev/sda5                      ext4                            (not mounted)
/dev/sda6                      ext4                            (not mounted)
/dev/sda7                      ext4                            /usr/local/config
/dev/md0                       swap                            <swap>

So, /dev/sda[1-7] are partitions on the internal 4TB HDD.

  • I understand, that the data partition (the NAS as exposed to the users on the network) is /dev/sda2.
    What are the other partitions (except /dev/sda3, that contains the boot images) good for?

  • Especially, what is with /dev/sda5 and /dev/sda6? Both are ‘not mounted’ but consume each 1GB of capacity.

  • Where is the bootloader located? I mean, physically. Is it on the MBR of /dev/sda or is it on the flash-disk?

  • Is LILO in use? Not sure, how this is on embedded devices. I read, that U-Boot combines stage 1 and stage 2.

  • /dev/md0 seems to be physically located at /dev/sda1, which as a Linux swap filesystem and is mounted as a RAID1 device, consisting of a single partition. I wonder why they did it this way, rather than just having an ordinary swap partition.

  • Is /dev/loop0 a Ram Disk? Or is it on the internal flash?

As to what I understand, so far,

  • there is a bootstrap environment, U-Boot, that handles the boot. I assume U-Boot must reside in the system’s flash disk? According to IBM Developer Work’s “Inside the Linux boot process” booting on an embedded device differs from booting on a PC. How does the boot process happen on the factory firmware? Does it happen differently on the CleanOS or Alpine firmware? I would be interested in information, as to where what is.

  • When I install CleanOS or Alpine, will it overwrite the original firmware? (I am going to install Debian, since I want OMV, but, out of curiosity, I would be interested, how the Alpine mod has been engineered as well.

  • How do I remake a modified system into it’s virgin, factory-delivered state?

Currently I like the fact very much, that the data disk does not spin up, when I use the web-admin or the do maintenance via SSH. There seems to be some “lobby” in a RAM Disk or on Flash. Will this be the same, if I install @Fox_exe’s Debian?


#1460

Уважаемый @Fox_exe!
Вопрос по установке stretch на устройство GEN1.
В общем ставится и работает. Одно но - нет сети.

Что делал. Во первых попытался скомпилировать в qemu-static chroot ядро 4.14 (LTS) . Ядро 3.2.68 не собирается новым gcc из stretch, можно пропатчить, по идее, но решил с последним лтс пробовать.
Значит собралось, устройство грузится, погонял тесты не виснет не греется, то есть в принципе работает.
Попытки скомпилировать pfe провалились. И на железе, и на ББ в чруте. Слишком большие отличия версий ядра, наличие в драйвере большого количество вызовов “объявленных устаревшими” функций и заголовочных файлов ядра. Как мог поборолся, что-то поправил просто игнорированием ошибок компилятором (типа типов возвращаемых указателей) где то убрал вызовы старых заголовочных ядра, заменил на новые и т.д. Короче собралось, но как и предполагал не работает - видимо модуль надо переписывать кардинально, это не мой уровень.
Полазил по сети, нашел что-то от comserto на гуглегит, попробовал выдернуть pfe драйвер оттуда, то-же под старые ядра.

Если оставить любое ядро из предыдущих версий (все собранные Вами 3.хх) которые прекрасно работают на жесси, проблема вылезает опять с пресловутым модулем pfe:
лог загрузки модуля (часть)

[ 2714.523977] pfe_firmware_init: request firmware class_c2000.elf failed
[ 2714.530642] pfe_hif_exit
[ 2714.533214] pfe_hif_release_buffers
[ 2714.536864] pfe_hif_free_descr
[ 2714.540000] pfe_hif_lib_exit
[ 2714.543166] pfe_hw_exit
[ 2714.546830] pfe: probe of pfe.0 failed with error -110
[ 2714.553023] initcall pfe_module_init+0x0/0x1f [pfe] returned 0 after 184812 usecs

Не хочет подгружать фирмварь, и следовательно нет сетевого интерфейса.
В загруженных модулях висит:
[root@MyCloud ~]$ lsmod
Module Size Used by
pfe 353617 0
Но сети нет.

В общем, прошу подсказать куда рыть. Пересобирать Ваши ядра не вижу необходимости - все одно придется собирать с тем-же кросс тулчейном, в общем на выходе будет то-же самое.
Что может мешать в stretch грузить модулю pfe фирмварь class_c2000.elf ума не приложу. Ядро то-же, модули и фирмварь на месте, модуль pfe подгружал и через wd-network.sh, и вручную (задавая параметры в modules.conf) и замаскировал запуск сети systemd совсем, запуская все сервисы вручную и в разных вариантах (думал очередность загрузки что-то ломает) - не пойму в чем дело.
Или в стретч что-то с базовыми библиотеками системных утилит несовместимо с этим pfe - не знаю.
Может кто проходил этот путь?
Извиняюсь за многословие.


#1461

@w00zy, по русски лучше на 4pda общяться. Местные не поймут :slight_smile:
В остальном - да. Надо переписывать и основательно (Проще с нуля написать). Но не мой уровень - я всеж не прогер по образованию, хотя и быстро учусь. Если очень хочеться - гугли на тему “Почему не загружается firmawre в linux kernel”. Может наткнешся на похожую ситуацию.


#1462

@amix,

Partition #1: 2ГБ, Swap
Partition #2: [all unused], DataVolume / User data (/mnt/HD/HD_a2)
Partition #3: 1ГБ, Boot (uImage, uRamdisk, image.cfs)
Partition #4: 1ГБ, Cache for Twonky, WDPhotos, iTunes, and some configs (smbm.sml)
Partition #5: 1ГБ, Recovery (Recovery image in RAW/Firmware format)
Partition #6: 2ГБ, ???
Partition #7: 1ГБ, Configs
Device have 1MB SPI Flash, which contains Preloader and u-boot (And store MAC + SN)

  • Preloader - RAW initial system. Something like “BIOS” on PC. u-boot = more like “Grub” or “Lilo” for linux OS, but used in ARM devices only.

All md (raid) devices - legacy from 2/4-disk devices (Mirror / Ex4 / DL4100 etc…)
/dev/loop0 - mounted /boot/boot/images.cfs (Rootfs in RAM disk) - Lagacy too (On 2-disk devices its stored on NAND flash, but in 1-disk devices - on HDD, because NAND chip too small - only 1 MB (512KB for Gen1))

I think - Almost all stuff - legacy from “Open WRT”, provided by Marvell for Developers (Part of DevBoard / DevPackage).

About boot process:
After power on - CPU start execute code from SPI on NAND flash from sector 0.
Its load Preloader (Short code, used only for hardware init. Sometime - for easy firmware preload and Developing).
Then - Preloader run BootLoader (u-boot in our case) from sector 128 of flash.
u-boot re-init hardware and provide basic functions for future boot process - Can boot from hdd/spi/nand/tftp/USB and other stuff. Also provided minimum bash-like command line for all that (Include SH-like scripts).
In normal systems - uboot search boot.cmd on all available sources (hdd/usb/network) and exec them. But in our situation - uboot just start default (Precompiled) boot script.
Int this script:

  1. Wait 5 seconds for “WD Magic Packet”. If got it - starting to boot from network (tftp boot), else
  2. Search uImage/uRamdisk on 3nd partition of HDD. If found - boot it, if not:
  3. Search Recovery image on 5nd partition and boot it. If can’t - just hang (with RED led) or reboot.

Sorry for bad English.


#1463

Ok! There will be time to engage once again I ask on 4pda. На великом и могучем :slight_smile:


#1464

@bmfranky Please tell me how to do it, its been many many years since last time i play with linux :frowning:


#1465

Hello Fox_exe and all the others who are commiting to this project. I am trying to install OMV to my EX2 and I just cant get it to work. I have two 6TB WD Red and want to use it as a Backup nas for my youtube chanel and only run youtube-dl. Thats why I wanted to install omv.
What I did:

  1. installed the debian-jessie-firmware-test from anionix.ru Mirror folder as it was suggested
  2. Cloud came back with both HDD LED in Pink and tried a lot of reset combinations after i dont know which combination I could boot in recovery
  3. Booted up in Recovery mode and reinstalled the original firmware

It was a frustrating long two days and now I am back at start :frowning:
If anyone has a solution for me, everything is appreciated. The doku / instruction on anionix.ru was not very helpful :frowning: maybe some steps are missing, i dont know.

Thank you very much


#1466

Press reset button when HDD leds are blinking for auto-format HDD’s (Warning: Loose all data on HDD’s!)
Or connect via Telnet (Use PuTTY or Minicom) and re-partition HDD’s manually.

Some info about that
Need more info - just tell me where you stuck.


#1467

Hello, so I got OMV running on the Ex2 and did all the steps for configuring the eth0 and did a reboot. After that I couldnt connect anymore :frowning:
I did the whole procedure again and the same after install and setting the eth0 and a reboot, no more connection. It is really frustraiting.
I also always get a connection timout when I am setting an information in omv. Also eth0 is already there when I install omv.
What am I doing wrong?
Do you have a manual for the mirror for manual step-by-step formating the HDDs and setting jessie up?
I want to use it with md2 linear raid. The command for that would be:
mdadm --create --force /dev/md2 --raid-devices=2 --level=linear --run /dev/sda3 /dev/sdb3

Thank you for your help

Update: When I try to reboot I get the two pink LEDs and with an fdisk I get:

Disk /dev/md127: 2199.0 GB, 2199023255040 bytes
2 heads, 4 sectors/track, 536870911 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md127 doesn’t contain a valid partition table

Disk /dev/md1: 3581 MB, 3581935616 bytes
2 heads, 4 sectors/track, 874496 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn’t contain a valid partition table

Disk /dev/md0: 510 MB, 510328832 bytes
2 heads, 4 sectors/track, 124592 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn’t contain a valid partition table

Which is for me impossible as I used them just before the reboot :frowning: I really dont know where it is screwing up the boot. Please help


#1468

@darkeagl, do not use fdisk because he doesnt support GPT! Use gdisk or parted instead.
For linear raid (0) use this command (Metadata=0.9 is important for some reason):

About network probles in OMV - Its config problem - OMV store UUID of network adapter in somewhere (Or something like that), so its works good on my device, but can not work on others.


#1469

Hi, I did as you wrote but now both LEDs are purple again. When I leave the md2 Raid as it is everything is working fine :frowning: Have to start at the beginning again.


#1470

Did you create fs on new raid?
After change raid type - raid will forced to empty state, so need create fs again:

# If something mounted - unmount it!
umount /dev/md2
umount /dev/sda3
umount /dev/sdb3
mdadm --create --force /dev/md2 --level=0 --metadata=0.9 --raid-devices=2 /dev/sda3 /dev/sdb3
mkfs.ext4 /dev/md2
# If mount point presents in fstab - just mound new partition, or change UUID first
mount /dev/md2

#1471

This is what I get after changing your command to level=linear:

Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md2 : active linear sdb3[1] sda3[0]
8589934590 blocks 0k rounding

md0 : active raid1 sda1[0] sdb1[1]
498368 blocks super 1.2 [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
3497984 blocks super 1.2 [2/2] [UU]

did the mounting and everything as you described and after a reboot, 2 pink LEDs and had to restore back to state 0. It is frustrating and I am thinking I will stay at raid1 as it is working with that without a problem. But still weird.


#1472

Can I replace HDD on MyCloud Gen1 on non-WD HDD 4TB ?
Можно ли заменить 2ТБ на 4ТБ , но от другого производителя. Не получается пока. Я не очень разбираюсь , но могу установить Дебиан на устройство. Можно ответить по-английски.
Happy New Year!!


#1473

Yes.
Use GParted or Partition Wizard Home for copy disk-to-disk, then extend bigger partition.


Да. Воспользуйся GParted или Partition Wizard Home чтобы скопировать диск один-в-один, затем увеличь самый большой раздел до максимума.


#1474

Hey Guys!

With help from @Fox_exe I managed to setup debian on my Ex2 Ultra.

I just have 2 problems:

  • Fan control (fan always on low)
  • Drive sleep (they do not go to sleep)

Anyone got a solution for this?

Thanks for your help!


#1475

mcu_ctl can set fan speed, but need write simple script for control temperature automatiaclly.
Also - check /etc/rc.local you can find some interesting things.


#1476

Hello, Fox_exe.
Can You help to install GoodSync on Clean Debian.
This app is working on original firmware (4.05.00-320). The app site GoodSync for Western Digital MyCloud NAS
On last firmware I can install this version 9.9.67 of app Link on file from my G Drive
I have last ver. 10.7.2 and just some installer file ( I dont know how to install them)
My G Drive GS folder.
Last installers are here, official site.
Installation on official firmware is here [[APP] GoodSync for WD My Cloud. Backup and file synchronization]([APP] GoodSync for WD My Cloud. Backup and file synchronization)
And finally the problem . File not found .
Installer .run can not see existing files of app.

Files are in the folder , but installer can not see them.

Where is mistake?
Thank you.

Successful Installation looks like this