Up-to-date firmware for WD My Cloud Ex2 Ultra
The sequence is: 1) Update u-boot. It is needed to adjust load addresess for new Kernel and Ramdisk. See UBoot folder for details. 2) Update kernel with compiled uImage file. See Kernel folder for details. 3) Update ramdisk with compiled uInitrd file. See Ramdisk folder for detials. 4) Set rootfs - the actuall Debian system. See Rootfs folder for detials.
This custom firmware supports full disk encryption on WD MyCloud Ex2 Ultra NAS
wget https://raw.githubusercontent.com/vzhilov/WDMC-Ex2-Ultra/master/uImage (--no-check-certificate in case of error?) dd if=/dev/zero of=/dev/mtdblock1 dd if=uImage of=/dev/mtdblock1
wget https://raw.githubusercontent.com/vzhilov/WDMC-Ex2-Ultra/master/uInitrd dd if=/dev/zero of=/dev/mtdblock2 dd if=uInitrd of=/dev/mtdblock2
#
usb start fatload usb 0:1 0xa00000 uImage fatload usb 0:1 0xf00000 uInitrd bootm 0xa00000 0xf00000
reboot -f
mdadm --create /dev/md0 --level=1 --raid-devices=2 --run /dev/sda /dev/sdb
mdadm --create /dev/md0 --level=1 --raid-devices=2 --run /dev/sda missing mdadm --manage /dev/md0 --add /dev/sdb
sudo cryptsetup -v -y -c aes-cbc-essiv:sha256 --iter-time 2000 --use-random luksFormat /dev/md0 cryptsetup luksOpen /dev/md0 cryptlvm nohup dd if=/dev/urandom of=/dev/mapper/cryplvm &
cat nohup.out
will show you the progress.lvm pvcreate /dev/mapper/cryptlvm lvm vgcreate MyVolGroup /dev/mapper/cryptlvm lvm lvcreate -L 1024MB MyVolGroup -n swap -Zn lvm lvcreate -L 4096MB MyVolGroup -n root -Zn lvm lvcreate -l +100%FREE MyVolGroup -n data -Zn
lvm vgscan --mknodes
mkswap /dev/MyVolGroup/swap swapon /dev/MyVolGroup/swap mkfs.ext4 /dev/MyVolGroup/root mkfs.ext4 /dev/MyVolGroup/data
mkdir /mnt/root mount /dev/MyVolGroup/root /mnt/root cd /mnt/root wget https://raw.githubusercontent.com/vzhilov/WDMC-Ex2-Ultra/master/debian-stretch-rootfs.tar.xz tar xvf debian-stretch-rootfs.tar.xz rm debian-stretch-rootfs.tar.xz
wget https://raw.githubusercontent.com/vzhilov/WDMC-Ex2-Ultra/master/libs-4.15.0-rc6.tar.gz tar xvf libs-4.15.0-rc6.tar.gz rm libs-4.15.0-rc6.tar.gz
cd / umount /mnt/root sync reboot -f
login: root password: mycloud
The system will boot only if a keyfile "key.luks" is presend on connected USB device with partition label "key". If no keyfile present then connect to the system by ssh on port 2222 with a user root, password root and open partition with the command: "cryptsetup -T 5 luksOpen $device cryptroot".
Run apt upgrade to upgrade to newest Debian
In the root file system put swapon /dev/mapper/MyVolGroup-swap mount /dev/mapper/MyVolGroup-data /mnt/data in rc.local, not in /etc/fstab
Couldn't make reset button to power off, so used cron with eth0 down instead: 0-59 /bin/ip a | /bin/grep -Eq ': eth0:.*state UP' || /sbin/poweroff