Re: Debian on WD MyCloud EX2 Ultra April 09, 2020 08:12PM |
Admin Registered: 13 years ago Posts: 18,997 |
Quote
Flashing by using "dd" in linux or "nand write" in u-boot doesn't matter. The key is you need to overwrite "bootcmd", because with stock uboot it always boots at 0xa00000 0xf00000 <<< and kernel 5.5.3 doesn't work with these 2 addresses.
Re: Debian on WD MyCloud EX2 Ultra April 10, 2020 05:03AM |
Registered: 4 years ago Posts: 8 |
Thanks for your useful information.Quote
bodhi
Don't use dd to flash binary to NAND flash. nand write should be used whether in u-boot or in Debian. For NAND, dd most the time it is OK, but use nand write any way to be foolproof. For SPI flash, never to use dd in Linux, must use flashcp.
Re: Debian on WD MyCloud EX2 Ultra April 10, 2020 10:40AM |
Registered: 4 years ago Posts: 43 |
#!/bin/busybox ash # init-script for WD Mycloud Mirror gen2 & Ex2 ultra # Boots from partition labeled "rootfs" /bin/busybox mkdir -p /dev /mnt/root /mnt/key /mnt/config /mnt/config/initrd /proc /root /usr/sbin /usr/bin /sbin /bin /sys /run /bin/busybox --install -s export PATH=/bin:/sbin:/usr/bin:/usr/sbin # Mount the /proc and /sys filesystems. mount -t proc none /proc mount -t sysfs none /sys mount -t devtmpfs none /dev # Adding mdev support echo /sbin/mdev >/proc/sys/kernel/hotplug mdev -s exec 0</dev/console exec 1>/dev/console exec 2>/dev/console exec setsid cttyhack /bin/ash
cryptsetup luksOpen $cryptdev cryptroot --key-file luks.key umount /mnt/config 2> /dev/null umount /sys 2> /dev/null umount /proc 2> /dev/null umount /dev/pts 2> /dev/null umount /dev 2> /dev/null exec switch_root -c /dev/console /mnt/root /sbin/init
hexdump -C -s 0x02000000 -n 18 -v /dev/mem
Re: Debian on WD MyCloud EX2 Ultra April 11, 2020 01:15PM |
Registered: 4 years ago Posts: 43 |
Re: Debian on WD MyCloud EX2 Ultra April 13, 2020 07:00AM |
Registered: 4 years ago Posts: 43 |
Quote
About using BTRFS:
It should be BTRFS over LUKS directly, managing both volumes and raid instead of EXT4 over LUKS over RAID.
Also take a moment to understand what is better between LUKS over RAID or RAID over LUKS.
mkfs.btrfs /dev/sda /dev/sdb -d raid1 -m raid1 -L raid1_drive cryptsetup luksFormat /dev/sda cryptsetup open /dev/sda cryptlvm btrfs device add /dev/mapper/cryptlvm /mnt/root btrfs device remove /dev/sda /mnt/tmp
Re: Debian on WD MyCloud EX2 Ultra April 13, 2020 10:31AM |
Registered: 6 years ago Posts: 50 |
Re: Debian on WD MyCloud EX2 Ultra April 13, 2020 12:43PM |
Registered: 4 years ago Posts: 43 |
Quote
Cant you share your initrd?
Re: Debian on WD MyCloud EX2 Ultra April 13, 2020 03:55PM |
Registered: 4 years ago Posts: 8 |
Re: Debian on WD MyCloud EX2 Ultra April 15, 2020 01:45PM |
Registered: 4 years ago Posts: 43 |
Quote
In order to offload disk encryption on the CESA unit, you will need to specify to cryptsetup the following cipher: aes-cbc-essiv:sha256. Therefore the command to create your encrypted disk should looked as follow:
sudo cryptsetup -v -y -c aes-cbc-essiv:sha256 luksFormat /dev/sda1
You can verify running
cryptsetup benchmark
user # cryptsetup benchmark • Tests are approximate using memory only (no storage I0). PBKDF2—shal 215224 iterations per second for 256—bit key PBKDF2—sha256 317365 iterations per second for 256—bit key PBKDF2—sha512 150311 iterations per second for 256—bit key PBKDF2—ripemd160 161022 iterations per second for 256—bit key PBKDF2—whirlpool 23744 iterations per second for 256—bit key argon2i 4 iterations, 83132 memory, 4 parallel threads (CPUs) for 256—bit key (requested 2000 ms time) argon2id 4 iterations, 87954 memory, 4 parallel threads (CPUs) for 256—bit key (requested 2000 ms time) • Algorithm 1 Key 1 Encryption 1 Decryption aes—cbc 128b 83.1 MiB/s 85.1 MiB/s serpent—cbc 128b N/A N/A twofish—cbc 128b N/A N/A aes—cbc 256b 76.4 MiB/s 78.2 MiB/s serpent—cbc 256b N/A N/A twofish—cbc 256b N/A N/A aes—xts 256b 62.2 MiB/s 63.3 MiB/s serpent—xts 256b N/A N/A twofish—xts 256b N/A N/A aes—xts 512b 58.4 MiB/s 59.5 MiB/s serpent—xts 512b N/A N/A twofish—xts 512b N/A N/A
cryptsetup -v --type luks --cipher aes-xts-plain64 --key-size 512 --hash sha512 \ --iter-time 2000 --use-random --verify-passphrase luksFormat /dev/md0
cryptsetup -v --type luks --cipher aes-cbc-essiv --key-size 256 --hash sha256 \ --iter-time 2000 --use-random --verify-passphrase luksFormat /dev/md0
Re: Debian on WD MyCloud EX2 Ultra April 16, 2020 03:36AM |
Registered: 4 years ago Posts: 43 |
Quote
Could you tell me the average Read/Write speed when LUKS is used (e.g. with scp, ftp).
debbootstrap --arm=armhf --include=net-tools buster rootfs chroot rootfs passwd
Re: Debian on WD MyCloud EX2 Ultra April 16, 2020 03:40AM |
Admin Registered: 13 years ago Posts: 18,997 |
Re: Debian on WD MyCloud EX2 Ultra April 16, 2020 03:58AM |
Registered: 4 years ago Posts: 43 |
Quote
linux-image-5.5.3-mvebu-tld-1_1.0_armhf.deb
linux-headers-5.5.3-mvebu-tld-1_1.0_armhf.deb
zImage-5.5.3-mvebu-tld-1
config-5.5.3-mvebu-tld-1
linux-dtb-5.5.3-mvebu-tld-1.tar
linux-5.5.3-mvebu-tld-1.patch
Re: Debian on WD MyCloud EX2 Ultra April 16, 2020 04:33AM |
Admin Registered: 13 years ago Posts: 18,997 |
>Quote
linux-image-5.5.3-mvebu-tld-1_1.0_armhf.deb
> linux-headers-5.5.3-mvebu-tld-1_1.0_armhf.deb
> zImage-5.5.3-mvebu-tld-1
> config-5.5.3-mvebu-tld-1
> linux-dtb-5.5.3-mvebu-tld-1.tar
> linux-5.5.3-mvebu-tld-1.patch
>
>
Quote
Latest released rootfs: Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2 (10 Sep 2019)
Quote
Note: If this is your first time installation, then you need rootfs Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2 (this has kernel 5.2.9-mvebu-tld-1 already installed). Please scroll down to the 10 Sep 2019 section to install this rootfs. After you've booted the box with this rootfs, you can proceed to install the latest kernel.
Re: Debian on WD MyCloud EX2 Ultra April 16, 2020 07:59AM |
Registered: 4 years ago Posts: 43 |
/ # cryptsetup benchmark # Tests are approximate using memory only (no storage I0). PBKDF2—shal 215578 iterations per second for 256—bit key PBKDF2—sha256 316217 iterations per second for 256—bit key PBKDF2—sha512 150657 iterations per second for 256—bit key PBKDF2—ripemd160 161022 iterations per second for 256—bit key PBKDF2—whirlpool 23710 iterations per second for 256—bit key argon2i 4 iterations, 84084 memory, 4 parallel threads (CPUs) for 256—bit key (requested 2000 ms time) argon2id 4 iterations, 89275 memory, 4 parallel threads (CPUs) for 256—bit key (requested 2000 ms time) # Algorithm 1 Key 1 Encryption 1 Decryption aes—cbc 128b 31.8 MiB/s 33.4 MiB/s serpent—cbc 128b N/A N/A twofish—cbc 128b N/A N/A aes—cbc 256b 25.3 MiB/s 26.6 MiB/s serpent—cbc 256b N/A N/A twofish—cbc 256b N/A N/A aes—xts 256b 31.5 MiB/s 31.7 MiB/s serpent—xts 256b N/A N/A twofish—xts 256b N/A N/A aes—xts 512b 25.8 MiB/s 25.5 MiB/s serpent—xts 512b N/A N/A twofish—xts 512b N/A N/A / # modprobe marvell_cesa [ 440.149497][ T6276] marvell—cesa f1090000.crypto: CESA device successfully registered / # cryptsetup benchmark # Tests are approximate using memory only (no storage I0). PBKDF2—shal 217727 iterations per second for 256—bit key PBKDF2—sha256 313569 iterations per second for 256—bit key PBKDF2—sha512 151004 iterations per second for 256—bit key PBKDF2—ripemd160 161418 iterations per second for 256—bit key PBKDF2—whirlpool 23744 iterations per second for 256—bit key argon2i 4 iterations, 85714 memory, 4 parallel threads (CPUs) for 256—bit key (requested 2000 ms time) argon2id 4 iterations, 88399 memory, 4 parallel threads (CPUs) for 256—bit key (requested 2000 ms time) # Algorithm 1 Key 1 Encryption 1 Decryption aes—cbc 128b 83.3 MiB/s 85.1 MiB/s serpent—cbc 128b N/A N/A twofish—cbc 128b N/A N/A aes—cbc 256b 76.6 MiB/s 78.3 MiB/s serpent—cbc 256b N/A N/A twofish—cbc 256b N/A N/A aes—xts 256b 59.5 MiB/s 63.4 MiB/s serpent—xts 256b N/A N/A twofish—xts 256b N/A N/A aes—xts 512b 58.4 MiB/s 59.3 MiB/s serpent—xts 512b N/A N/A twofish—xts 512b N/A N/A
Re: Debian on WD MyCloud EX2 Ultra April 16, 2020 02:11PM |
Registered: 4 years ago Posts: 43 |
Re: Debian on WD MyCloud EX2 Ultra April 19, 2020 06:41AM |
Registered: 4 years ago Posts: 43 |
Re: Debian on WD MyCloud EX2 Ultra April 19, 2020 04:49PM |
Admin Registered: 13 years ago Posts: 18,997 |
Re: Debian on WD MyCloud EX2 Ultra April 20, 2020 08:03AM |
Registered: 4 years ago Posts: 43 |
Quote
If you could, edit your post to list the u-boot envs changes (permanently or on the fly during booting). Please make it a more detailed procedure so I can add to the Wiki.
~ # echo gpio > /sys/class/leds/wdmcex2u\:blue\:hdd1/trigger ~ # echo gpio > /sys/class/leds/wdmcex2u\:blue\:hdd2/trigger ~ # echo 1 > /sys/class/leds/wdmcex2u\:blue\:hdd1/inverted //Here 1st blue ligh goes off ~ # echo 1 > /sys/class/leds/wdmcex2u\:blue\:hdd2/inverted //Here 2nd blue ligh goes off ~ # echo ide-disk1 > /sys/class/leds/wdmcex2u\:red\:hdd1/trigger sh: write error: Invalid argument ~ # echo ide-disk1 > /sys/class/leds/wdmcex2u\:red\:hdd1/trigger sh: write error: Invalid argument
Re: Debian on WD MyCloud EX2 Ultra April 20, 2020 11:49AM |
Registered: 6 years ago Posts: 50 |
Re: Debian on WD MyCloud EX2 Ultra April 20, 2020 12:12PM |
Registered: 4 years ago Posts: 43 |
Quote
1) done with the attached patch and "1 -" DTSs. Tested working;
2) done with the attached "2 -" DTSs and rc.local. Tested Working;\
Quote
2nd is a better approach than 1st . Because while 1st is easier, but adding 2 more triggers just for this seems too "cookie cutter" and overkill.
cd linux-stable patch -p1 < gpio_trigger.patch
Re: Debian on WD MyCloud EX2 Ultra April 21, 2020 05:38AM |
Registered: 4 years ago Posts: 43 |
Re: Debian on WD MyCloud EX2 Ultra April 21, 2020 08:09AM |
Registered: 4 years ago Posts: 43 |
apt install build-essential cc mcu_test.c -o mcu_ctl cp mcu_ctl usr/sbin/
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # Available triggers: # none bluetooth-power usb-gadget usb-host timer oneshot disk-activity ide-disk mtd nand-disk heartbeat gpio cpu cpu0 cpu1 default-on panic if [ -e /usr/sbin/mcu_ctl ]; then /usr/sbin/mcu_ctl sys_ready 2>&1 >/dev/null fi if [ -e /sys/class/leds/wdmcex2u\:blue\:hdd1/trigger ]; then echo gpio > /sys/class/leds/wdmcex2u\:blue\:hdd1/trigger echo 48 > /sys/class/leds/wdmcex2u\:blue\:hdd1/gpio fi if [ -e /sys/class/leds/wdmcex2u\:blue\:hdd2/trigger ]; then echo gpio > /sys/class/leds/wdmcex2u\:blue\:hdd2/trigger echo 58 > /sys/class/leds/wdmcex2u\:blue\:hdd2/gpio fi if [ -e /sys/class/leds/wdmcex2u\:red\:hdd1/trigger ]; then echo disk-activity > /sys/class/leds/wdmcex2u\:red\:hdd1/trigger fi if [ -e /sys/class/leds/wdmcex2u\:red\:hdd2/trigger ]; then echo panic > /sys/class/leds/wdmcex2u\:red\:hdd2/trigger fi exit 0
#/bin/bash echo -en "TIME\t\tCPU\tSYS\tHDD\n" while true; do echo -en `date +'%H:%M:%S'` "\t" echo -en $((`cat /sys/class/thermal/thermal_zone0/temp` / 1000)) "\t" echo -en `mcu_ctl tmp_get_c | awk '{print $2}'` "\t" echo -en `smartctl -A /dev/sda | awk '/Temperature_Celsius/{print $10}'` "\n" sleep 2 done
Re: Debian on WD MyCloud EX2 Ultra April 25, 2020 04:14AM |
Registered: 4 years ago Posts: 43 |
root@localhost:~# cat /sys/class/leds/wdmcex2u\:blue\:hdd2/trigger none usb-gadget usb-host rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock usbport timer oneshot disk-activity disk-read disk-write ide-disk mtd nand-disk heartbeat [gpio] default-on flash torch panic f1072004.mdio-mii:00:link f1072004.mdio-mii:00:1Gbps f1072004.mdio-mii:00:100Mbps f1072004.mdio-mii:00:10Mbps
Re: Debian on WD MyCloud EX2 Ultra April 25, 2020 05:24AM |
Admin Registered: 13 years ago Posts: 18,997 |
ls -l /sys/class/leds/wdmcex2u*
echo none > /sys/class/leds/wdmcex2u\:blue\:hdd2/trigger
Re: Debian on WD MyCloud EX2 Ultra April 25, 2020 12:06PM |
Registered: 4 years ago Posts: 43 |
root@localhost:~# ./temperatures.sh TIME CPU SYS HDD 20:08:41 73 20 56 20:08:43 71 20 56 20:08:45 74 20 56 20:08:48 71 20 56 20:08:50 71 20 56 20:08:52 71 20 56
top - 20:13:47 up 2:22, 1 user, load average: 2.08, 2.18, 1.87 Tasks: 97 total, 1 running, 96 sleeping, 0 stopped, 0 zombie %Cpu(s): 2.7 us, 33.2 sy, 0.0 ni, 56.4 id, 3.2 wa, 0.0 hi, 4.4 si, 0.0 st MiB Mem : 999.8 total, 699.9 free, 51.1 used, 248.8 buff/cache MiB Swap: 2048.0 total, 2048.0 free, 0.0 used. 909.7 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3971 zhilov 20 0 79944 14684 11896 S 19.5 1.4 5:58.01 smbd 3913 root 20 0 0 0 0 I 14.6 0.0 0:25.37 kworker/u+ 1522 root 20 0 0 0 0 D 10.6 0.0 22:44.74 md0_resync 1370 root -51 0 0 0 0 S 8.9 0.0 0:50.40 irq/39-f1+ 1371 root -51 0 0 0 0 S 7.6 0.0 0:44.95 irq/40-f1+ 4147 root 20 0 0 0 0 I 5.0 0.0 0:23.10 kworker/u+ 1512 root 20 0 0 0 0 S 2.3 0.0 4:27.77 md0_raid1 613 root 20 0 0 0 0 S 1.7 0.0 0:07.62 kswapd0 1517 root 0 -20 0 0 0 I 1.0 0.0 1:11.73 kworker/0+ 6019 root 20 0 0 0 0 I 1.0 0.0 0:10.81 kworker/u+ 6441 root 20 0 8452 2488 2136 R 1.0 0.2 0:00.22 top 9 root 20 0 0 0 0 S 0.3 0.0 0:21.25 ksoftirqd+ 1513 root 0 -20 0 0 0 I 0.3 0.0 1:15.27 kworker/1+ 1608 root 20 0 0 0 0 S 0.3 0.0 0:02.32 dmcrypt_w+ 3914 root 20 0 10292 5180 4400 S 0.3 0.5 0:00.49 sshd 5800 root 20 0 0 0 0 I 0.3 0.0 0:00.10 kworker/1+
Total DISK READ: 0.00 B/s | Total DISK WRITE: 8.26 M/s Current DISK READ: 0.00 B/s | Current DISK WRITE: 33.56 K/s TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND 3117 be/3 root 0.00 B/s 0.00 B/s 0.00 % 12.24 % [jbd2/dm-3-8] 6512 be/4 root 0.00 B/s 0.00 B/s 0.00 % 1.56 % [kworker/~efficient] 6467 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/~le_power_] 6565 be/4 zhilov 0.00 B/s 8.26 M/s 0.00 % 0.00 % smbd --fo~cess-group 1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init 2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd] 3 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_gp] 4 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_par_gp] 6 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/~H-kblockd] 8 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [mm_percpu_wq] 9 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0] 10 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_preempt] 11 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0] 12 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/0] 13 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/1] 14 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
Re: Debian on WD MyCloud EX2 Ultra April 25, 2020 05:47PM |
Admin Registered: 13 years ago Posts: 18,997 |
Re: Debian on WD MyCloud EX2 Ultra May 09, 2020 05:32AM |
Registered: 4 years ago Posts: 4 |
Re: Debian on WD MyCloud EX2 Ultra May 09, 2020 04:23PM |
Admin Registered: 13 years ago Posts: 18,997 |
fw_printenv
Re: Debian on WD MyCloud EX2 Ultra May 09, 2020 04:27PM |
Admin Registered: 13 years ago Posts: 18,997 |
wood
Re: Debian on WD MyCloud EX2 Ultra May 09, 2020 05:13PM |
> fw_printenv >