Install Debian on WD My Cloud home

I did the following (on a single bay, running the OMV install) for installing a clean Debian Buster (typing from memory):

apt-get install debootstrap
debootsrap 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/

I placed the resulting archive files onto the USB stick in the /omv directory and let the update script do its magic.

(The separation of / /usr /var is necessary because those directories get mounted by the boot procedure - you won’t be able to change this. The fstab is pretty useless for these)

2 Likes

The thing about NFS is that you would have to use a user-space NFS server since the Kernel seems to lack NFS support.

That brings me to my big problem about this shiny new device… compiling a kernel is easy but packaging it is a bit more of a hassle. I already downloaded the GPL archive provided by WDC https://downloads.wdc.com/gpl/GPL_MCH_6.6.1-123_20191114.tar.xz

Quite a bit of reading to do there… :wink:

Thanks you. This should also work for single bay right?

I am working with a single bay (don’t have a Duo) :slight_smile:

That’s was very useful. Did you use a particular linux distro to do so?

Sorry, I actually did it on the system (running OMV).
I’m afraid you would have to have an Arm64 architecture to prepare it somewhere else, as I am chrooting into the bootstrap (in order to install SSH).

Off topic questions - stock android (because here are experts): I saw that wd discovery mount my cloud home drive as network drive (like smb)… Do you know which protocol and the link wd discovery use?

@Vismo, WebDav or SMB via OpenVPN tunnel.

Thx you, so we don’t have any chance to manually mount it :unamused:

sorry guys , I ruined my HDD data partition and lost my back up files . can someone share the recovery files for MCH single bay plz

Unfortunately I don’t have them right now, but are they the same for everyone or contain device specific data like 3 digit code?

I do not know but now my mch doing weird thing after leaving it running for few hours the faded light becomes bright and hangs . After rebooting it it looses ssh and omv and no partion 24 sataa24 i have to reinstall the recovery usb and manually formating partition 24 then manually maunting it then again doing the same problem i dont know if this caused by the HDD or the device itself

Can I reformat the whole disk

fyi there is now a revised version for the DUO. Looks like the upgrade procedure has changed, but some of the files may come in handy on the single bay as well

http://4pda.ru/forum/index.php?showtopic=467828&view=findpost&p=96905118

Same thing for Android and iOS?

I have been trying to build my own kernel as I want some more network filesystems (CIFS, NFS) and possibly much more. I compiled natively on the device using GCC6 from Jessie (while running Buster).

I build my own rescue-rootfs (and applied the correct padding).
I applied the padding also to the dtb and the kernel image. Using the rescue method via USB I can boot my kernel fine, but as soon as I write it to disk I get locked out.

I am applying the Kernel (padded to 1110241024 bytes) to /dev/sataa8
and the dtb padded to 1024*1024 bytes to /dev/sataa6

I am not sure what the fwtable.bin is about and how I would create that file - any help is greatly appreciated!

Hello, your problem is exactly fwtable.bin. This file stores the kernel, rootfs and dtb addresses, size, checksums, and partition schemes (maybe something more). You can not change kernel or rootfs without recalculating the checksums and put it on the fwtable. I´m sorry but i don´t know how to do it, for what i follow on 4pda forums looks like is something simple for programmers or developers (all the info is on the bootloader source, i think that boot_cmd.h file or something similar), forth32 on pda is the guy that create and edit those files, i try to talk to him but i think that he only anwer to russian, he never talked to me, or share in any way how to edit the fwtable, in fact he recently make an installer for the MHCD (My device) and inside is an utility that he created to edit the fwtable (don’t work on the home of 1 disk, because the home duo has all the init files on an emmc, not on the disk). I resort to change my bootloader and deactivate the checksum comprobation so i can change the kernel or rootfs every time that i want before forth 32 decided to make a MHCD installer. You can try to talk to him, he is the only one for what i know that knows or understand how to edit the fwtable file.

Thanks for your answer!
I am following the 4pda forum discussion as well, but haven’t found any mention of how exactly the checksums of the fwtable are to be calculated.
I think our best bet is to get the uBoot compiled - that will very likely provide all the tools - but I haven’t found a working compiler/toolchain yet.

Hello, if you want to compile u-boot, western digital put everything there, you need to install openssl-1.0-dev (1.2 doesn’t work) and remove all the words “defined” from all the pearl scripts. But after compiling there is nothing that can help you for editing fwtable. When I get home i tell you exactly what file and lines from the source have something to do with the checksum, if you understand about programming maybe you manage to edit that file.