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

Thanks again for your great work!

I have a question related to the toolchain to build the system. I’m trying to compile aria2c for WDMyCloud Gen2. However, the official toolchain only contains a gcc ver 4 while aria2c requires gcc > 4.5. I tried to build my own toolchain with buildroot 2018-02 version. I started from cortex-a9 armv7 and added NEON FPU. I didn’t add other VFP. For the libraries, I tried both uclibc and glibc.

With the toolchain I get, I can compile simple helloworld and aria2c statistically successfully. But only helloworld runs successfully on WDMyCloud. Aria2c has “segment fault”.

I checked your ftp and find in http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen2/Debian/Dev/helpmebuild.sh, there is a line

CROSS_COMPILE=“$CUR_DIR/…/cc-armada370/bin/arm-unknown-linux-gnueabi-”

So I wonder if you build your own toolchain? Is it possible for you to share your configuration file for the toolchain? Thank you!

Nope. Its a default toolchain from WD sources.
Or you can use toolchain from DSM sources.
Or install binutils-arm-linux-gnueabi

Hi!

I have to say you that I am really happy to have found this page and I think that you are helping to the people to truly use their devices (I have to admit that the WD software does not seem very good to me).

I have three questions.

  1. Is this still compatible with the latest version (I have a WD My Cloud Gen2 of 4TB with the original firmware 2.30.181)?

  2. How does the ChrootedDebian’ app work? I know what is the chroot command for, but I would like to know if this is well implemented in the WD My Cloud and if it is stable …

  3. If I only install apps in the normal firmware, can I update it as normal?

Thanks you very much :slight_smile:

Hi!

I am back with more questions about this great repository :wink:. I’ve been trying to install some apps like PhpMyAdmin, Joomla, MediaWiki and Wordpress, but I have the same problem with each of them:

  • How can I connect to MySQL? I have seen that the NAS already has a MySQL server installed, but I don’t know the password or how to connect to it.

Thanks :blush:

EDIT: I answer my own question. The default login and password for the MySQL that is already installed is “admin” and “admin”.

Thank you so much for your reply!

So you believe I should try another one? I’m interested mostly in a “dropbox” or “gdrive” experience mostly. But because most of the users are regular people I thought own/nextcloud would be the best option because of the graphical design.

You think nginx would do the trick? I really appreciate your answer @troolie

Regards

@ZeryOs

Well, it does for me as I described in my previous message. I use nextcloud mostly as centralized backup for my android devices (there are several android clients to do all sort of things: create shared tasklists, backup phonebook, copy files from and to the phone, centralized agenda and so on). If I’m lazy or don’t wanna map a samba share, I can also access my public shared folder from nextcloud’s web interface.
Like I said, nginx makes it workable, at least when you don’t throw several concurrent users at it. Then again, it also depends what visualization plugins you add to your nextcloud. For example, do you want it to integrate viewers for office documents so you can view the content from any device? Well, there’s a plugin for that, but it takes more memory to use it and to small ARM CPU will have to process the job. Whereas you could simply download the file and use some program on your computer to view the file (more work for you, less for the mycloud).
YMMV. A lot. I’m happy with it though and you probably would be too.

I went with nextcloud cause we use owncloud at work. I didn’t research much about alternative products but I’m pretty sure nextcloud is the best and most advanced opensource project you can find for a personal cloud. I kinda wanted to document its installation (I even setup a wikimedia on the mycloud to keep track of that kind of stuff) but it takes more time than I can spare at the moment.

First of all, thanks @Fox_exe for the hard work. I really appreciated.

My device is a Gen 1 and I was doing some experiments that lead me to a problem now.

After installing clean_debian 64k the repos were not working so I decided to move it back to clean_debian Jessie but when I try to re-run autoinstall it said that mdadm was not working proberly.

When I tried to run root@mycloud: mdadm it always answer with ‘Killed’.

root@MyCloud:~# mdadm
Killed

Full Log:

root@MyCloud:/data/shares/Public# ./install.sh
=============================================
Ok, lets go...
Stop all processes...
forked-daapd: no process found
Stopping periodic command scheduler: cron.
./install.sh: line 44: wdAutoMountAdm.pm: command not found
Recreate mdraid partitions:
/dev/md0 exist! Deleting...
./install.sh: line 58:  2093 Killed                  mdadm --stop ${upgradeDevice} 2> /dev/null
./install.sh: line 58:  2094 Killed                  mdadm --wait ${upgradeDevice} 2> /dev/null
Restoring raid...
./install.sh: line 61:  2097 Killed                  mdadm ${currentRootDevice} --remove ${Disk}1 > /dev/null 2>&1
./install.sh: line 62:  2098 Killed                  mdadm --wait ${currentRootDevice} 2> /dev/null
./install.sh: line 63:  2099 Killed                  mdadm ${currentRootDevice} --add ${Disk}1 > /dev/null 2>&1
./install.sh: line 64:  2100 Killed                  mdadm --wait ${currentRootDevice} 2> /dev/null
./install.sh: line 65:  2101 Killed                  mdadm ${currentRootDevice} --remove ${Disk}2 > /dev/null 2>&1
./install.sh: line 66:  2102 Killed                  mdadm --wait ${currentRootDevice} 2> /dev/null
./install.sh: line 67:  2103 Killed                  mdadm ${currentRootDevice} --add ${Disk}2 > /dev/null 2>&1
./install.sh: line 68:  2104 Killed                  mdadm --wait ${currentRootDevice} 2> /dev/null
=============================================
Current device: /dev/md1
Upgrade device: /dev/md0
Upgrade part: /dev/sda1
Current raid status:

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

md0 : active raid1 sda1[0]
      1999808 blocks [2/1] [U_]

unused devices: <none>
=============================================
Creating new mdraid volume...
./install.sh: line 80:  2106 Killed                  mdadm ${currentRootDevice} -f ${upgradePart}
./install.sh: line 81:  2107 Killed                  mdadm --wait ${currentRootDevice}
./install.sh: line 83:  2109 Killed                  mdadm ${currentRootDevice} -r ${upgradePart}
./install.sh: line 84:  2110 Killed                  mdadm --wait ${currentRootDevice}
./install.sh: line 86:  2112 Killed                  mdadm --zero-superblock --force --verbose ${upgradePart}
./install.sh: line 89:  2115 Killed                  mdadm --create ${upgradeDevice} --verbose --metadata=0.90 --raid-devices=2 --level=raid1 --run ${upgradePart} missing 2> /dev/null
./install.sh: line 90:  2116 Killed                  mdadm --wait ${upgradeDevice}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Something wrong: /dev/md0 not exist !!
!! Exiting now.                                !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I tried to reinstall mdadm but unfortunately with the 64k repo not working I wasn`t able to doit. Now i am stuck, I still have access to ssh, mounting and unmounting and everyting but I cant reinstall debian.

Thanks in advance.

The depot for 64k is here : http://anionix.ddns.net/dists/jessie-64k/main/binary-armhf/
You have to start over from the original firmware, otherwise it will not work.
In mycloud ssh :
wget http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen1/Recovery/Boot%20recovery%20from%20HDD/boot-md0.env
dd if=boot-md0.env of=/dev/sda7
reboot.
You should go back to the original firmware, from here you can restart the script.

Option 2
You erase your disk and install the image I just uploaded, with clean debian jessie 4k and rootfs 10Gb :

I just came to post it and share, just follow the instructions for installation.

ps : I have fail and remove /dev/sda2 from the raid, I just kept /dev/sda1 and /dev/md1 with the same partitioning order as the original.


Thanks for the reply @Tony_Le_moine

I did try the first option but it didnt`t seem to work

In mycloud ssh :
wget http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen1/Recovery/Boot%20recovery%20from%20HDD/boot-md0.env
dd if=boot-md0.env of=/dev/sda7
reboot.

after reboot I lost ssh access and it seems like it is bricked, is there anything else to be done after it?

Thanks

You have this solution:
http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen1/Recovery/Readme-en.txt

Or you open your MyCloud and you follow these tutorials:
http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen1/Replace%20HDD%20-%20English.txt

Another faster solution, but you still have to open it: [GUIDE] Debrick a completely dead MyCloud

To open it without damaging it: How to open a WD My Cloud Case - YouTube

2 Likes

Thanks @Tony_Le_moine the restore works properly.

Hey @Fox_exe, I did a lot of reading on the web and in your gdrive folder but I am still not sure how to fix the problem with “packages held back” on GEN1 devices.

Could you explain what I have to do to update? I am running kernel 3.2.68.

I tried dist-upgrade and manually installing the held back packages but it always bricks my device.

V4 firmware is built with a non-standard 64k page size. So any upgrades from standard repositories are likely to brick your device.

Ok, so if I understand correctly, nginx is substitution for OMV?

If that’s the case, could you please walk me into the details? Any guide I could follow. This is my first experience into setting-up any “server-type” device so any help would be really appreciated!

Thanks again!

Ok as I understand, Nginx es a webserver.

What I need it mostly is for an small team to share files not much of editing really.

So i did what you asked:

  • Downloaded Nextcloud Archive (currently 13.0.1 version)
  • Unzip it into my webroot (under /var/www/nextcloud/ (created a folder)

When you speak about chown / chmod it is unclear what permissions should them be. Could you specify please?
About the database, how do I access to it?
How do I create a self-signed certificate / public certificate?
What should the vhost config should look like?
What parameters in pool.d?


Could you give me a hand with this? I’m really trying to make it work and willing to learn.
I’d be so thankful If your could help me on this one based on your experience @troolie

Regards!

What I wrote previously wasn’t meant to walk you through the process. I’m well aware many things aren’t explained cause it would require me to redo a good part of it or dig for info again (it was 6 months ago and I don’t install nextcloud every week). Now:

  • the permissions needed are written in the official nextcloud doc. Somewhere in there is a warning saying that some folders shouldn’t be accessible from the web. Or I did that cause nginx doesn’t support .htaccess files. Anyway, it all starts here; Installation — Nextcloud 13 Administration Manual 13 documentation
  • For the database, you access it from the command line. In my case, I ran mariadb then once inside:
    CREATE USER cloud_admin IDENTIFIED BY ‘your_password’;
    CREATE DATABASE nextcloud;
    GRANT ALL PRIVILEGES ON nextcloud.* TO ‘cloud_admin’@‘%’ IDENTIFIED BY ‘your_password’;
    GRANT ALL PRIVILEGES ON nextcloud.* TO ‘cloud_admin’@‘localhost’ IDENTIFIED BY ‘your_password’;
    FLUSH PRIVILEGES;
    exit
  • For a public cert, you buy it from verisign and the likes (that’s when you want to run a public server and you don’t want your users to be met with “invalid/untrusted certificate” error when they visit). For a self signed certificate, I used openssl on my computer: openssl dhparam -out dh4096.pem 4096
    You will refer to this pem file from the vhost config file (of course you’ll have to move that file somewhere on the mycloud first).
  • There’s a vhost file example (it doesn’t work with debian stretch, though) here: Nginx configuration — Nextcloud 13 Administration Manual 13 documentation
  • there’s only one file in pool.d, that’s www.conf. I can’t remember exactly what I had to mess with in there. I believe it was: listen = /run/php/php7.0-fpm.sock
    Maybe I added it or modified it, and maybe there was something else (could have been optional stuff). All I can tell you still is that it’s gotta match the fastcgi_pass unix:/run/php/php7.0-fpm.sock; in the nginx vhost file. Otherwise nginx will try to access CGI using 127.0.0.1:9000 and that will fail because of some system permission.

That’s all I can remember without digging for hours.

1 Like

Yeah i figured that you where more trying to warn me then to show me and I’m sorry I took the other path but is just something I believe I need in my cloud, so first of all thanks!

I’ve done some research and if something works fine, I believe I should make a full tutorial or guide of the process for others to follow in case are looking for something like that. Do you also have the Gen2 Mycloud? Thanks again @troolie

Regards!

Yes, my device is Mycloud 2nd Gen running standard debian stretch.

I just realize the command I gave you to create a certificate isn’t all of it. That one is for the Diffie-Hellman secured key exchange that happens before SSL/TLS connection is established. You also need to generate the RSA .key and .crt files that will be used to encrypt traffic:
openssl req -x509 -newkey rsa:2048 -keyout yoursite.key -out yoursite.crt -days 3650 -nodes -sha256

That will create a certificate valid for 10 years.

1 Like

I followed this guide: How to create a self-signed Certificate

Following that I was able to create one, though still need to figure out how it works and I havent managed to run/install Nextcloud yet so don’t know how it will work.

I’ll take what you gave me to make another certificate for 10 years. Dude, thanks for real!

When I remove the hard drive from my WD MyCloud Gen 1 (3 TB) can I just plug it into a Mac or Linux Computer and access the files? The restore process via DHCP, TFTP and PING doesn’t seem to work this time.

Although this is the third time I am restoring the device this time the DHCP requests don’t show up. The LED stays yellow and I can’t connect.