MyCloud HD replacement again

Hello Pals,

Seeking for help, please…
I got a 3Tb MC, and I need to get the internal 3TB HD for other NAS application as RAID array.
Since I have an old 1TB from the other NAS, so I was thinking to put this 1TB in this MC for a backup service.

I did find some instruction and how-to to replace the HD, and I did follow the instruction to conduct the configs and the works. …unfortunately, I can not make it, so here I am crying for some helps…

  1. I don’t have the virgin image, so I downloaded the GPL package from WD support, it comes in zip file, and I don’t know how to deal with this(seems no more image files from WD??)… So I make my own images from the original 3TB HD by every partition, except the partition#4 since it is the data storage. I conducted dd “if=/dev/sda of=/DataVolume/shares/Public/mycloud.img bs=1M count=5000”

  2. I followed the instruction I found in this community, everything looks goods, except when I conduct “mount /dev/md0 /mnt/hdd” in the terminal … it shows:

mint mnt # mount /dev/md0 /mnt/hdd
mount: wrong fs type, bad option, bad superblock on /dev/md0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

mint mnt # ^C
mint mnt # dmesg | tail
[ 1833.133033] JBD2: IO error -5 recovering block 23 in log
[ 1833.133036] EXT4-fs error (device md0): ext4_map_blocks:593: inode #8: block 197124: comm mount: lblock 24 mapped to illegal pblock (length 1)
[ 1833.133333] jbd2_journal_bmap: journal block not found at offset 24 on md0-8
[ 1833.133335] JBD2: bad block at offset 24
[ 1833.133337] JBD2: IO error -5 recovering block 24 in log
[ 1833.133340] EXT4-fs error (device md0): ext4_map_blocks:593: inode #8: block 197125: comm mount: lblock 25 mapped to illegal pblock (length 1)
[ 1833.133639] jbd2_journal_bmap: journal block not found at offset 25 on md0-8
[ 1833.133641] JBD2: bad block at offset 25
[ 1833.155349] JBD2: recovery failed
[ 1833.155354] EXT4-fs (md0): error loading journal
mint mnt # ^C

What did I do wrong? or what did I miss?
MC Firmware = 04.xxxx

Anyone would help me out, please…I’ve stayed up for too many days…

Thanks in advance…

TCP

There are a variety of “unbrick” methods that can be used when removing the existing My Cloud hard drive and using another drive as a replacement.

I used the procedure (below) that I detail in the following thread to first use a 250GB, then ultimately use a 1T drive in a My Cloud enclosure that initially had a 4T drive. The procedure below includes a URL to download the original_v3.04.01-230.tar.gz file used when pushing the image files to the various partitions. Note: I had to do the GTP fix procedure mentioned in those direction otherwise I was unable to properly upgrade to the v4.xx.xx firmware.

https://community.wd.com/t/unbrick-then-firmware-upgrade-equals-no-dashboard/136666

How to unbrick, replace or restore original WD My Cloud single hard drive firmware:

These basic directions assume you have a 4GB or larger USB flash/pen drive, a computer with SATA connectors or some form of external SATA enclosure/docking station, basic knowledge of how to boot PC using a boot disc, basic knowledge of how to use Linux.

Note: Use and proceed at your own risk!!!

• Download original_v3.04.01-230.tar.gz to a flash drive: https://drive.google.com/file/d/0B_6OlQ_H0PxVQ2l5MTNvQk1xSUU
• Used Ubuntu Live/Boot CD: http://www.ubuntu.com/download/desktop
• To avoid damaging non WD My Cloud hard drives remove or disconnect them from the computer.
• Backup any data on your My Cloud as these directions may result in the erasure of all data on hard drive.  
• Insert USB Flash/Pen drive containing the file original_v3.04.01-230.tar.gz (or it's extracted contents) into PC before booting with Linux Live/Boot CD
• All terminal commands run from Root user or Sudo. For purposes of this guide Sudo was used.
• After booting with Live/Boot CD open terminal window by typing: 
[ctrl] + [alt] + [t]
Then type:
sudo apt-get update 
sudo apt-get install mdadm parted

To install new/used hard drive start with step 1. 
To repair existing bricked WD My Cloud hard drive start with step 13.

Note: Starting from step 1 will erase hard drive contents. If hard drive contains important data, backup hard drive before proceeding.

1. Find the My Cloud hard drive name (sda, sdb, sdd, sdc, sde, etc.) by typing:
sudo fdisk -l 
or 
sudo parted -l

Note: For these basic directions "sdb" is used. 

2. If you get GTP errors running fdisk or parted then try the following command:
sudo gdisk /dev/sdb

Then type "o" then type "w" to fix GTP errors.

3. Run parted utility:
sudo parted /dev/sdb

4. Type "print" to see what partitions exist on hard drive.

5. If any partitions exist, remove each of them by typing "rm 1" (where 1 - number of partition)

6. Create new table:
mklabel gpt
mkpart primary 528M 2576M
mkpart primary 2576M 4624M
mkpart primary 16M 528M
mkpart primary 4828M -1M
mkpart primary 4624M 4724M
mkpart primary 4724M 4824M
mkpart primary 4824M 4826M
mkpart primary 4826M 4828M
set 1 raid on
set 2 raid on

Type "quit" to exit parted.

7. Format data partition:
sudo mkfs -t ext4 /dev/sdb4

8. Reboot computer, boot back to Linux Live CD. From command line run: 
sudo apt-get update 
sudo apt-get install mdadm parted.

9. Run sudo fdisk -l or sudo parted -l and note the drive names just incase the /dev/sd* location changed.

10. Create main RAID partition, type: 
sudo mdadm --create /dev/md0 --level=1 --metadata=0.9 --raid-devices=2 /dev/sdb1 /dev/sdb2

11. Wait for RAID creation to complete, type:
sudo watch cat /proc/mdstat 

Wait to 100%. Then type:
[ctrl] + [c] for close.

12. Stop auto-loaded raid, type: 
sudo mdadm --stop /dev/md0

If /dev/md0 not found type the following to find RAID mount point: 
sudo ls /dev 
or
sudo grep md

13. Start normal raid (must be /dev/md0), type: 
sudo mdadm -A /dev/md0 /dev/sdb1 /dev/sdb2

14. Using terminal window navigate to USB Flash/Pen drive location. Example: /media/ubuntu/<drive name> If the contents of file original_v3.04.01-230.tar.gz have not been previously extracted on the USB Flash/Pen drive, type:
sudo tar xvfz original_v3.04.01-230.tar.gz

15. Upload backup images to WD's hdd:
sudo dd if=kernel.img of=/dev/sdb5
sudo dd if=kernel.img of=/dev/sdb6
sudo dd if=config.img of=/dev/sdb7
sudo dd if=config.img of=/dev/sdb8
sudo dd if=rootfs.img of=/dev/md0

16. A Note: If for what ever reason the My Cloud fails to boot (white LED), or problems with upgrade to newer firmware failing/not working (ex. UI fails to load) try the following alternative step.
sudo mdadm --stop /dev/md0

sudo dd if=kernel.img of=/dev/sdb5
sudo dd if=kernel.img of=/dev/sdb6
sudo dd if=config.img of=/dev/sdb7
sudo dd if=config.img of=/dev/sdb8
sudo dd if=rootfs.img of=/dev/sdb1
sudo dd if=rootfs.img of=/dev/sdb2

17. Shutdown PC from terminal window by typing: shutdown -p -H 0 Or use "Logout" from menu.

18. Disconnect hard drive from computer/external connector and connect to WD My Cloud circuit board. Then connect power to the My Cloud circuit board to turn on WD My Cloud. Boot process may take 5-10 min or longer. LED light should change from White to Blue.

Note: If the WD My Cloud fails to boot with either a solid white or red LED, then reattach hard drive to PC/docking station, reinsert USB Flash/Pen drive, boot back into Linux, go back to step 13, then proceed to step 16 to push the three "img" files to their respective partitions, shut down PC and try booting the hard drive again with the WD My Cloud circuit board. 
If the drive still fails to boot (white or red LED), the GTP entry probably needs to be repaired. If that is the case try step 2 above to rebuilt the GPT entry (will probably erase drive contents) and then perform the rest of the subsequent steps. If step 2 doesn't work then start from scratch at step 1. Backup any files if needed from sdb4 (the mountable ext4 partition containing the shares) prior to starting from step 1.

19. After WD My Cloud boots to Blue LED, access the Dashboard with web browser (http://wdmycloud/). Proceed through initial access screen then enable SSH on the Settings -> Network -> Network Services section. Often the capacity will be incorrectly listed, fix by selecting Quick Restore (or Quick Factory Restore) from the Settings -> Utilities section. The device will reboot and rebuild the system files.

20. After factory restore has been performed and WD My Cloud boots, restore any settings (like Static IP) as needed and update the firmware if needed. Be patient. If there was existing data on the hard drive it may take the WD My Cloud OS a long time to scan/catalog the files.

Notes:
How Linux sees drive contents of a 250GB drive:
Number  Start   End     Size    File system     Name     Flags
 3      15.7MB  528MB   513MB   linux-swap(v1)  primary
 1      528MB   2576MB  2048MB  ext3            primary  raid
 2      2576MB  4624MB  2048MB  ext3            primary  raid
 5      4624MB  4724MB  99.6MB                  primary
 6      4724MB  4824MB  101MB                   primary
 7      4824MB  4826MB  1049kB                  primary
 8      4826MB  4828MB  2097kB                  primary
 4      4828MB  250GB   245GB   ext4            primary

Hello Bennor,

Thanks for the guides and instructions! I can get the machine back now.
The WebGui was showing V04.xxx firmware available for update. without any doubt, I went for a update.

And now MC shows “0 GB”, which I can not fix it by other post mention - running " pt-get update && atp-get upgrade"

what is the next I shall do? please…

Bennor,

I had the machine reset and now it works well…
I can have a nice sleep today!

Thank you

The solution as you apparently discovered to the incorrect storage figure is to perform a reset. The directions posted above do indicate performing a reset in step 19 to solve the exact problem you experienced.

DO NOT RUN apt-get or apt-upgrade on V4 firmware MyClouds.

These commands will try to install from standard Debian repositories, which are built using a 4K page size. The MyCloud uses a non-standard 64K page size build.

apt-get and apt-upgrade on a V4 firmware device is likely to brick it again…

Yeah that should be in big flashing bold letters both on the My Cloud and on this forum. :laughing:

Seems we’ve had a rash of posts lately where people did an apt-get / apt-upgrade and were left wondering why their My Cloud stopped working.

Perhaps WD should modify the SSH option/information to include the warning that trying to use apt-get / apt-upgrade will possibly brick the device.

I’m not sure why they leave it in the build*; is there a way of using it with a 64K repository? If not, it’s just wasted disk space and downright dangerous…

* laziness? ineptness?

Nice to see the forum preview shows the asterisk properly. Shame the final version doesn’t…

+1, somewhere WD should specify these devices do not have a full blown Linux version.

Well, guys, you know what…I did conduct this thread before I reset the machine…(with SSH enable on the WebGui, and login the machine for executing the thread…)

I am not good with Linux base, so I don’t even know what the command for…just blindly following the instruction to get machine back (well, my concern is to get machine working)…from the terminal that shows something like there’s no such command in the system…so maybe the WD OS I have does not support this command, or maybe god does bless me…I am lucky enough!

You guys did induce another worry on my machine…the page size…Shall I ignore this issue or shall I have a check?
If I had to check, would you guys be so kind to advise me how? please.

It’s a virgin not hosting the data yet, I shall make sure it is free from problem to save further hard work on recovering the data I feed in.

Sincerely,

TCP

Aha…what a lucky dummy I was … I was putting “apt-get update && atp-get upgrade” as a single command!
No doubt, the machine did not take the execution.

Lucky me!