How I replace the HDD of mycloud gen2

You downloaded the two files from GitHub? What specific link did you use? What directions were you using to perform the unbrick?

Others have backed up the files that are typically used to unbrick a second generation single bay My Cloud (P/N ends with “-10”). Note: you generally only format /dev/sda3 to EX4 (mkfs.ext4 /dev/sda3).

https://wd.hides.su/fox_exe/WDMyCloud-Gen2/
Unbrick directions: https://wd.hides.su/fox_exe/WDMyCloud-Gen2/_Unbricking_en.txt
uImage-wdrecovery: https://wd.hides.su/fox_exe/WDMyCloud-Gen2/Developing/uImage-wdrecovery
uRamdisk-wdrecovery: https://wd.hides.su/fox_exe/WDMyCloud-Gen2/Developing/uRamdisk-wdrecovery

Some general information on how to revert from OS5 back to OS3.