Sonntag, 6. September 2020

Debian on WD My Cloud Home single-bay (MCH) - part 1

 It's been almost ten years that I've been using a (few) WD MyBookLive (MBL) as my home server. In the end I used it for pure NAS tasks (Samba) only. The original 3TB became too small a couple of months ago, and I started looking for a larger harddisk.

 At that time the price for an 8TB NAS drive would be about 220€. Hence my surprise when I found an offer of a new WD NAS called My Cloud Home with an 8TB (WD RED CMR drive) for just 199€. Even if I would only use the disk it would still be cheaper - I guess that's the benefit of WD, being a harddrive manufacturer...

 Reading the specs also got me interested (4xCortex-A53@1.4GHz, 1GB RAM) - quite a bit more beefy than my old MBL. What I read about the software was rather irritating, so I didn't even bother with setting up the original software. Instead I put my hopes on a post I found in the Russian 4PDA forum (use Chrome and translate to English). Without opening the device, the procedure would install Debian Stretch and OpenMediaVault onto the device.
 The image works quite satisfactory, but coming from an unknown source it was clear for me that I need to replace it with my own. Also I would want the recent Debian Buster on it. As before on the MBL debootstrap is my weapon  of choice. Due to the nature of the boot process, repartitioning the disk is not recommended and we're limited to two 839MB plus one 2147MB partitions. The resulting RootFS therefore has to be split into root, /var, and /usr - exactly the files that are required for the original install method above. Only this time it is going to install our Debian Buster basic install instead of OMV.
apt-get install debootstrap
debootstrap buster /mnt http://ftp.debian.org/debian
cp /etc/network/interfaces /mnt/etc/network/interfaces
cp /etc/fstab /mnt/etc/fstab

cd /mnt/
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
chroot .

apt-get update
apt-get upgrade
apt-get install openssh-server -y --no-install-recommends
apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/apt/archive/*.deb

adduser --home /home/alex --shell /bin/bash alex
passwd alex
passwd

exit
umount /mnt/proc/
umount /mnt/sys/
umount /mnt/dev/

mkdir /new
mv /mnt/usr /new/
mv /mnt/var /new/
mkdir /mnt/usr /mnt/var
cd /mnt
tar cfz /srv/dev-sataa24/20-root.tar.gz *
cd /new/var
tar cfz /srv/dev-sataa24/21-var.tar.gz *
cd /new/usr
tar cfz /srv/dev-sataa24/22-usr.tar.gz *

The resulting files should be copied onto the USB-stick, replacing the originals in the /omv folder.

Now the only challenge is to get a proper Kernel onto the system. That's what I am going to cover in the next post.

22 Kommentare:

  1. Thank you for sharing!
    Is there a way to install Debian on an empty disk drive? I purchased only the case without hard drive.
    Then also the hard drive could be partitioned differently.
    I am looking forward to the next posts.

    And there is a typo in line 2 (bootsrap without t)

    AntwortenLöschen
  2. Now we are all excitedly waiting on your solution for getting a new kernel on the system ;)

    I followed your guide. Should this give me Debian Buster after a restart? Or do I need to install the kernel?

    AntwortenLöschen
    Antworten
    1. Dieser Kommentar wurde vom Autor entfernt.

      Löschen
    2. Hello, on the first post of this forum https://community.wd.com/t/clean-os-debian-openmediavault-and-other-firmwares/93714 you can download different files for the Home Cloud. If the disk is new, you need to format it with the original partitions (you can find it in that post) then you can install debian

      Löschen
    3. Dieser Kommentar wurde vom Autor entfernt.

      Löschen
    4. Dieser Kommentar wurde vom Autor entfernt.

      Löschen
    5. Success! I got it working. Buster with the original kernel. :)
      The following lines created archives for me that had a folder level too much. Instead of having all var folders in the root of the archive (/bin) they were behind a (/var/bin) which was written to the disk and could not be started.
      cd /new
      tar cfz /srv/dev-sataa24/21-var.tar.gz var/
      tar cfz /srv/dev-sataa24/22-usr.tar.gz usr/

      Instead I used
      cd /new
      cd var
      tar cfz /srv/dev-sataa24/21-var.tar.gz *
      cd ..
      cd usr
      tar cfz /srv/dev-sataa24/22-usr.tar.gz *

      Finally I downloaded the files via scp
      scp root@wdnas:/srv/dev-sataa24/20-root.tar.gz /home/me/wdnas
      scp root@wdnas:/srv/dev-sataa24/22-usr.tar.gz /home/me/wdnas
      scp root@wdnas:/srv/dev-sataa24/21-var.tar.gz /home/me/wdnas
      And put them on the USB Stick that I created to install OMV in the first place (replace the files in the OMV folder).
      If you log in via SSH, ssh root@wdnas does not work. Use the user name you chose when you followed the above manual. E.g. ssh alex@wdnas.

      Löschen
  3. Hello, I was trying to bring Debian to the home cloud duo, and i did it (with a least elegant solution as forth32). After that I tried to change the kernel and activate HW acceleration, but currently I have no time. if you are interested, on github there are sources for rtd1395 (in theory also valid for rtd1295). And if you send a mail to the developer of banana pi w2 (rtd1296) he can add you to his fork of openwrt with hw acceleration

    AntwortenLöschen
    Antworten
    1. Hi JAN, where exactly are you hoping for speed improvements due to hw acceleration? I used the WD sources and my SMB speed is saturating the 1GBit/s network interface.

      Löschen
    2. Hello, I mean HW Video Acceleration, for transcoding video. My NAS is working also at full speed and very reliable, but obviously I lost hw transcoding

      Löschen
  4. Love this guide. I am very excited for your further guide regarding the kernel :)

    AntwortenLöschen
  5. Antworten
    1. Hi Andy, what is the issue with OMV? Adding the sources and running "apt-get install openmediavault" didn't work?

      Löschen
    2. Thats the problem when try apt get install omv command only error message

      Löschen
    3. Have you an How TO to adding sources and so on

      Löschen
    4. Yes. OMV install fails when creating the salt environment.
      See post https://community.wd.com/t/install-debian-on-wd-my-cloud-home/250061/157
      Two posts further down is a solution. When I used the file provided here https://community.wd.com/t/install-debian-on-wd-my-cloud-home/250061/159 I finally could install OMV.
      Still it does not fully work. OMV does not find any drives, so you can't create any shares.

      Löschen
    5. ok thanks when any people have au fully work system can he create a new install for mch with omv 5

      Löschen
  6. I just bought one of these devices having used MyBookLive and WD MyCloud but without realising what WD had done in making the Home range ... I now want to go through the software replacement process as well.
    Just wanted to check a couple of things ...

    First ... is the starting point to this booting from a USB stick made from the contents of the download from the linked .7z in the 4pda forum?
    If yes then that still means booting from something where the exact contents of the binary files is unknown (I think).

    Second ... my device is new and has firmware version 7.12.1-170 ... are you (or anyone else) aware if the process still works?
    I don't want to trash the device on day 1

    AntwortenLöschen
  7. I followed your guide on my MyCloud Mirror gen1. I have Debian Jessie installed and working.
    To upgrade to Buster I got until

    tar cfz /srv/dev-sataa24/20-root.tar.gz *

    but that failed since mounting and boot is different on my much older device. Any suggestions ?

    AntwortenLöschen
  8. Hallo,
    leider funktioniert das bei mir überhaupt nicht... :( gibt es die Möglichkeit das fertige Buster+OMV5 zu bekommen?

    AntwortenLöschen
  9. Hello!
    I was able to follow the procedure at the end i have 3 TAR.GZ totally 70Mb,they are compressed much i noticed but to compare with the others are much smaller. is correct?

    I modified the partitions with 3 of 2gb because i didn't have enought space and honestly i dont care at all about the original WD firmware, there is one way to install everything in one partition and if is not enought make one 4GB (20) and the other 2 (21,22) smaller?

    AntwortenLöschen
    Antworten
    1. i tried to follow this procedure at least 5 times, but when i login and i try to do something i receive this:

      E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
      E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

      The login is alex also because root is not working

      Löschen