Install Debian on WD My Cloud home

Hello, if you installed debian+omv on your device, the data directory has not android files, only debian. if i remember correctly (I’m not home and had no access to a pc), the debian installer format data partition to use as usr(on linux). Basically the installer do the following: format system_b, cache and data partitions to use it as root, var and usr respectively. Make backups of everything, and change kernel, rootfs (initram), dtb and fwtable to their respective partitions. So you cannot touch that partition, its vital for the system

Hi @zeusjan
this is what the Windows Explorer shows on /data, which is on root/sharedfolders. What do I need them for? The rest of your instructions is beyond me, I’m afraid.

I’ve checked the rc file and seems easy to flash backup. As I got the script mount partitions, backup them, wipe them and than move files into partitions.

You installed openmediavault or ENTWARE? I think I can not help you because i don’t have the cloud home (I have the duo), what i can tell you is that your device has a lot of partitions, some are for backups, maybe that is one of them, if you installed entware, then is normal that you have the android files (you still had android) but if you installed openmediavault, in theory you cannot have thise files, only on backup files, but maybe i’m wrong, the structures of cloud home and cloud home duo are different

@zeusjan

Talking for MCH single bay

echo create filesystems
make_ext4fs -L debian /dev/sataa20
make_ext4fs -L var    /dev/sataa21
make_ext4fs -L usr    /dev/sataa22

This is for debian, but do you know which was the stock one?

The “installer” also change /dev/sataa24/data (/dev/sataa24 is mounted as /mnt/data) permissions to 777

chmod -R 777 /mnt/data/data

Does someone know the original permission?

Seems that the “installer” doesn’t make a backup of /dev/sataa21 (mounted as /mnt/var) before wiping it. Should I suppose that was empty and not necessary for restoring android?

Does someone even know the drive path where stock firmware put files sent over smb (and permissions if possible)?

Those are backups from the previous installation.

Also for anyone new tryimg it and want to preserve the data in Plex directory, move the files over to a non encypted location like samba/share.
The installation removed the files from Plex directories and created a new dir called restsdk for me. All the file names are changed and extensions removed.
Now only if someone can figure how to decrypt those.

The script for reverting seems good at me, want to test it later. But for know I don’ t know how to repack rescue.root.sata.cpio.gz_pad.img. For extracting it I’ve used Online Archive Converter - FreeFileConvert (rescue.root.sata.cpio.gz_pad.img > rootfs.cpio > files). If someone tell me how to repack I can test the “recover” script.

Thank you.

Just to conclude this issue I deleted the whole stuff (some needed chmod -777) with no adverse effects. Now looking forward to finding a good use for this 2nd NAS…
Thanks to all who responded!

I would think you will need to first create a cpio file

ls | cpio -ov > rootfs.cpio

Then create the img file using gzip and renaming it.

Personally, I just installed the OMV version, removed all the extra stuff including OMV, upgraded to buster.
Ram usage is down to 30mb used and 120mb cached when idle. As good as clean install.
To add, I even removed samba and most of the utilities before upgrading. I will test it after installing them again.

1 Like

Good news, just got Android back but doing all things manually from telnet using rescue files.

I’ve founded the command for unpacking:

zcat rescue.root.sata.cpio.gz_pad.img | cpio -idmv

For repacking I’ve used:

find . | cpio -o -c | gzip -9 > zcat rescue.root.sata.cpio.gz_pad.img

After trying to boot from usb I got a reboot a nothing seems to be changed. I don’t know if there is a problem with the script or with repacking.

What files did you push to get stock android system back?
I tried using it for few days, but Plex transcode does not work which is one of the main reasons I bought this.

Important: I’m not an expert and the following message isn’t an “how to” or a “guide” and may not work. I’m not sure commands are 100% correct. This may brick your device and void warranty. You also may lose all your data. Do at your own risk.

Before doing so I’ve made backup of all partitions.

I haven’t tested Plex right now but I’ve restored my WD My Cloud Home (not Duo) by doing:

I’ve booted the device using rescue files and then connected to it using telnet.

Wiping partitions:

make_ext4fs -L root   /dev/sataa20
make_ext4fs -L var    /dev/sataa21
make_ext4fs -L usr    /dev/sataa22

Mounting partitions (I don’t remember if these commands require “busybox” before “mount …”):

mount /dev/sataa18 /mnt/config
mount /dev/sataa20 /mnt/root
mount /dev/sataa21 /mnt/var
mount /dev/sataa22 /mnt/usr
mount /dev/sataa24 /mnt/data

I’ve got some errors when mounting some partitions, I’ve solved by creating needed folders in /mnt/ where I had to mount partitions.

Restoring partitions backed up before installing debian (backup should be in /mnt/data/oldsystem-backup):

busybox dd if=/mnt/data/oldsystem-backup/01-fwtable.backup of=/dev/sataa1
busybox dd if=/mnt/data/oldsystem-backup/04-rootfs_b.backup of=/dev/sataa4
busybox dd if=/mnt/data/oldsystem-backup/08-kernel_b.backup of=/dev/sataa8
cp /mnt/data/oldsystem-backup/bootConfig /mnt/config/bootConfig
busybox dd if=/mnt/data/oldsystem-backup/11-afw_b.backup of=/dev/sataa11
busybox dd if=/mnt/data/oldsystem-backup/06-fdt_b.backup of=/dev/sataa6
tar -C /mnt/root -xvf /mnt/data/oldsystem-backup/system_b.backup.tar
tar -C /mnt/usr -xvf /mnt/data/oldsystem-backup/data.backup.tar

PS: I saw that if I move my own files to something like (I don’t rember the exact path) /mnt/data/samba/share/public, when I reboot the device with android I can see files using local samba (smb to nas local ip).

1 Like

Perfect. Thank you. I thought those were the files but was not sure. Thanks for confirming.

I’ve an hypothesis that we can just switch back to system_a by restoring only bootConfig (in this case we keep debian files) but not sure about that.

Hello, i was busy, if you are still interest on editing the rootfs file, you need to add zeros to make it of a exact file size (4194304), i use this script that godex from 4pda forum make:

#!/bin/sh
roofs_dir=root_fs_dir
needed_file_size=4194304
outputFile=rescue.root.emmc.cpio.gz_pad.img
#put in archive root fs dir
echo “creating rootfs”
(cd “rootfs”; find . | cpio -o -H newc | gzip) > ${outputFile}

#add null date to the end to get needed size (hack)
outputFile_size=$(wc -c < ${outputFile})
need_add_to_the_end=$((${needed_file_size} - ${outputFile_size}))
dd if=/dev/zero of=${outputFile} count=${need_add_to_the_end} seek=${outputFile_size} bs=1

2 Likes

Thanks you so much. Right now I feel comfortable with Android. Looking forward for installing a debian buster

1 Like

Hi @Cloudhome,

Could you please let us know the steps to remove OMV and to have the device updated to Debian Buster? I’m really seriously considering this option, but I would like to know how you did it in order to not make any mistake…

Thanks in advance! Is really appreciated.

Before you do that, I have to warn you that it should still be debian install should still be considered as alpha and there are stability issues. Also if you plan to run Plex, go back to android. Debian does not support HW transcoding for arm which is a big reason I bought this device.

removing OMV and others should be pretty straight forward using apt. I removed a bunch of stuff. Below are some I can remember but not a comprehensive list.
aptitude, avahi, collectd, monit, NetworkManager, nfs, nginx, php, python, quota, smartmontools, vim, containerd, docker (original dev might have tried to install docker) but obviously there are missing libraries.

Careful while removing them (read the auto removals part before hitting Y) as some of them will try to remove resolvconf which will cause it to not get an ip anymore.

To install buster, all I had to do is to update the sources file from stretch to buster and update/upgrade.
One note of caution, keep cleaning up the /var/cache and /var/lib/apt directories as there is limited space on the var mount. Also try upgrade first and then try full-upgrade. If you try full directly, it would not be able to download all the pacakges at once, again the space limitation.

I have to say, if you are planning to just use it as a storage, you might be better off leaving the system as is and remove the extras from omv menu. If you are a plex user, go back to android. :slight_smile: cheers.

Hi,

Thanks a lot for the detailed explanation…

So basically, my intention is to just use it as a NFS “server”, but nothing else than that. Because of that, I think, having a simple but updated system should be more than fine… No need for extra stuff, just the OS and NFS running…

In that case, @Cloudhome , do you think it’s a good option? Or would you keep the 9 version as it’s coming on the original image?

Regards.

well the easiest way would be to remove the packages from the OMV frontend and leave the OMV running. OMV itsself takes very less resources compared to the other apps. if you just leave OMV and samba/nfs running, you will probably end up with 50-100mb ram usage which should be good incase you ever wanted to use the ui.

upgrade to buster will break some parts of OMV. so its upto you if you want to upgrade depending on your use.
but be sure to remove/add all the packages you want from OMV gui before upgrading. Once upgraded, some functionality will break like adding new repo from frontend. Atleast they did for me.