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
tar cfz /srv/dev-sataa24/21-var.tar.gz var/
tar cfz /srv/dev-sataa24/22-usr.tar.gz usr/
 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.

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
  4. Love this guide. I am very excited for your further guide regarding the kernel :)

    AntwortenLöschen