[GUIDE] Debrick a MyBookLive DUO

I am a not too proud owner of the bricked MBLD 4T (power outage during the firmware upgrade process). Currently I am doing the backup of my data from one of the NAS disks with IcyBox and Total Commander Disk Internal Reader plugin to one of my old USB disks. It will take several hours to complete, but that is the way it is.

I will try the Guide 1 path once I have my data backed up. The way I see it I can still go down the alley no. 2 if the first one does ends well. I will post the results of the process here if it is OK with you.

This is a short diary of my steps in the attempt to recover bricked MBLD. I hope that somebody that will find him/herself in similar situation will be able to make some use of it.

BACKGROUND
The problem started when there was a short power interruption while I was updating the firmware of my MBLD to the latest version. (I know, I should have had an UPS, but I did not. Maybe now I will buy one.)

When the electrical power has returned the MBLD was starting up with the white LED on (it might seems to be violet) and it was not accessible at all (bricked). I have tried with several reboots, but nothing has changed. (sigh) I was kindly pointed to this thread and I have decided to give this option a try.

STEP 1 (DATA BACKUP/RECOVERY)
A friend borrowed me a Icy Box IB-110StU3-B docking station. I have connected it to my laptop, plugged in one of the SATA drives and fired up DiskInternals Reader plugin for Total Commander. I could have used the programs suggested in STEP 1, however I am used to do all of file manipulations with Total Commander. I had to copy around 700GB of data to old external USB drives and it took me several hours to finish STEP 1.

STEP 2 (DEBRICK PREPARATION)
I have had 7zip already installed on my computer, so I have skipped that step.
I have downloaded SystemRescueCd and burned iso to new DVD (it is small enough to fit on CD).
I have downloaded debrick script from Mediafire.
And downloaded LATEST MBLD firmware (as of 3 March 2013) from  http://download.wdc.com/nas/ap2nc-024105-034-20130215.zip

Afterwards I have extracted “rootfs.img” as suggested (Hint: The extraction of the “rootfs.img” might take a while, so be patient) and put the debrick.sh and rootfs.img on a newly FAT32 formated 8GB thumbdrive.

STEP 3 (PREPARING TO BOOT THE SYSTEM RESCUE CD)
I have prepared thumbdrive with rootfs.img and debrick.sh and connected the IcyBox SATA dock, to my laptop. I did not unplugged the laptop drive (I have to be careful, I know).

STEP 4 (BOOTING THE SYSTEM RESCUE CD AND DEBRICKING THE HARD DRIVE)
I have booted from System Rescue CD without problems and started gparted. It showed following drives:
SATA disk /dev/sdb
USB thumbdrive /dev/sda

STEP 5 (DEBRICKING DISK A)
I have used the device labels as were detected by gparted, and the debrick.sh script finished without any problems. Very nice job!

Then I have put the SATA disk back into MBLD, and started ssh session without any problems (admin password was reset, but all the data seems to be on the disk).

Then I have tried to recreate RAID 1 array and run into first problem:

MyBookLiveDuo:~# mdadm --create -e 0 --verbose /dev/md3 --level=raid1 --raid-devices=2 /dev/sda4 /dev/sdb4
mdadm: super0.90 cannot open /dev/sda4: Device or resource busy
mdadm: /dev/sda4 is not suitable for this array.
mdadm: super0.90 cannot open /dev/sdb4: Device or resource busy
mdadm: /dev/sdb4 is not suitable for this array.
mdadm: create aborted

I have checked if there might be a rebuild process already running and there was one (as it is stated in the User manual). The MBLD is now currently in the process of rebuilding the array which ought to last for 7 to 15 hours. LED is green and blinking. Data on public volume is all there and I will have to recreate the users and their shares, but this will not be a problem if the rebuild process finishes successfully.

It seems that GUIDE 1 is viable option, but I will be able to confirm this tomorrow.

Great job nfodiz! Thank you!

Thanks for the reply, it looks as though the MBL might just rebuild the array on its own with no loss of data. That was my thinking, but I wanted to cover my behind as I don’t have a unit to test with. Let me know how you make out and I will amend the guide to take out the step to create an array in Guide 1

Rebuild of RAID 1 array has finished over night. LED is solid and green and after the reboot both disks are in good condition. The data is on the disk, but I will have to recreate the users and shares (that’s not a problem).

I can confirm: GUIDE 1 is a viable and great way how to debrick MBLD and retain the user data.

@nfodiz: BIG thank you for the script and great tutorial! 

1 Like

Thanks again MKranjc and please let me know if recreating the users and shares gives you any problems. It works flawlessly on a MBL but I am only guessing it SHOULD work on the DUO too.

I will update the guide after I get your final feedback

1 Like

No problem at recreating users and shares either.

However, after the fresh install of the system other settings have to be set again (time zone, workgroup name, email for alerts and notifications, time machine backups and so on). But this is not a problem :slight_smile:

Just curious if someome who has run the script with the DESTROY flag could post output from the following command in PuTTY

swapon -s

There was an issue with the MyBookLive script. When it was run with the destroy flag, it breaks the drives SWAP

You could also SSH in and issue
top

If the swap shows as 0 and the swap used shows as 0 (top left) then we need to fix the issue. With the MBLD the command to fix SWAP may be different

My guess is
mkswap /dev/md2
followed by a reboot should fix this issue but I need someone to verify /dev/md2 is a raid swap

Guide updated

fusecat confirmed that the swap wasn’t working after a DESTROY debrick

He tried my suggested commands and they worked

Thanks again fusecat!

Hi,

I want to install the MBLD OS on a new empty hard drive and I have some basic questions.

  1. Is it ok that my new hard drive is empty and formatted to NTFS?

  2. Do I need SystemRescueCd if I can connect hard drive via SATA to Linux PC?

  3. Can I use steps described in GUIDE 2 to install the OS on this new empty hard drive?

  4. I know that MBLD is working even with one drive connected (tested myself). So should I first install OS only on one drive then connect it to MBLD and switch the unit on? Or should I install OS on both drives then connect them both to MBLD and switch the unit on?

Thanks

Herokolco wrote:

Hi,

I want to install the MBLD OS on a new empty hard drive and I have some basic questions.

  1. Is it ok that my new hard drive is empty and formatted to NTFS?
    The script SHOULD repartition the drive but if you get errors I would delete the NTFS partition so you just have UNALLOCATED space
  1. Do I need SystemRescueCd if I can connect hard drive via SATA to Linux PC?
    No, as long as you know what you are doing with your Linux PC, you can go that route. The commands might differ slightly though.
  1. Can I use steps described in GUIDE 2 to install the OS on this new empty hard drive?
    You can but ONLY if you don’t have any data you need on disk B because the Quick Factory Restore step will wipe the data volume clean.
  1. I know that MBLD is working even with one drive connected (tested myself). So should I first install OS only on one drive then connect it to MBLD and switch the unit on?

If following Guide 1 with a raid data volume I would say that is the way to go as it wil rebuild the data volume

Is there data you want to save on disk b? Is your data volume in RAID or SPAN mode?

 

  1. Or should I install OS on both drives then connect them both to MBLD and switch the unit on?

This is untested by anyone as far as I know and I don’t own a DUO so I can’t test

Thanks

Please keep this thread updated with any progress you make and I will make changes to the guide as needed. You may also want to contact the other posters in this thread via PM for some help as well.

As a last resort, I also have some virgin images of a MBLD for both disk a and b that you could dd copy back to the drives. You would then have to upgrade back up to the current firmware.

i’ve just debrickted MBLD

but swap dont want to work

MyBookLiveDuo:~# mkswap /dev/md2

/dev/md2: No such file or directory

and if

MyBookLiveDuo:~# mkswap /dev/md3

/dev/md3: Device or resource busy

I closely followed the manual

I believe /dev/md3 is your datavolume so don’t try to make a swap there.

I’m guessing you followed guide 2?

1 Like

You may need to create the swap raid array from SSH and reboot

mdadm --create -e 0 --verbose /dev/md2 --level=raid1 --raid-devices=2 /dev/sda3 /dev/sdb3reboot

 After reboot see if you can make swap on /dev/md2 now

mkswap /dev/md2
reboot

 If not what do you see if you type?

mdadm --detail /dev/md2
1 Like

nfodiz wrote:

You may need to create the swap raid array from SSH and reboot

 

mdadm --create -e 0 --verbose /dev/md2 --level=raid1 --raid-devices=2 /dev/sda3 /dev/sdb3reboot

 After reboot see if you can make swap on /dev/md2 now

mkswap /dev/md2
reboot

 If not what do you see if you type?

mdadm --detail /dev/md2

 

Thank you man! I don’t know how to please you. Thanks again for your help!!!

PS yes i followed guide 2

Thank you for answering to my questions.:wink:

I took out and formatted both of my MBLD hard disks to NTFS, so they are perfectly clean now and I don’t want to save any data on disk B. But at the moment I am writing both disks with zeros (full erase) using WD Data Lifeguard utility to have RAW space on them as you suggested. My data volume was in RAID 1 (mirrored) mode, but does it matter now?

I basically want to know if I install MBLD OS on one RAW hard disk and then connect it back to the unit will MBLD work? So when I connect the second disk later should MBLD initialize it automatically? Or do I need to write OS on the both hard disks and only then connect them to MBLD at the same time?

Thank you.

But at the moment I am writing both disks with zeros (full erase) using WD Data Lifeguard utility to have RAW space on them as you suggested. My data volume was in RAID 1 (mirrored) mode, but does it matter now?

No, but you may need to format the drive again and delete all partitions. I should have said unallocated space, my apologies. All you have to do is use disk manager to delete all partitions on the disk and you should be good to go.
I’m not sure how the script would handle RAW space

I basically want to know if I install MBLD OS on one RAW hard disk and then connect it back to the unit will MBLD work?

Not sure on this, but if you try this, please report back your findings

So when I connect the second disk later should MBLD initialize it automatically?

It will if there is an OS on the second drive for sure. I’m not sure if it will initialize a blank hard drive or not, but again if you try this, report back your findings

Or do I need to write OS on the both hard disks and only then connect them to MBLD at the same time?

Yes, this is the route I would go at this point


At this point I am gonna say yes, let’s write the os to both disks following guide 2, then put them back in the enclosure and boot up. Once booted up, do a quick factory restore. Post back once you have completed these steps and tell me if everything is working. If not, we may need to manually create some arrays for your datavolume and swap as shown below…

To create a datavolume array in raid1 (Note you MAY need to do a quick factory restore after this command again)

mdadm --create -e 0 --verbose /dev/md3 --level=raid1 --raid-devices=2 /dev/sda4 /dev/sdb4

  OR to create a datavolume array in span mode (Note you MAY need to do a quick factory restore after this command again)

mdadm --create -e 0 --verbose /dev/md3 --level=linear --raid-devices=2 /dev/sda4 /dev/sdb4

 To create your swap if it is missing

mkswap /dev/md2
reboot

If this command complains that /dev/md2 is missing you will need to create the array manually through SSH

mdadm --create -e 0 --verbose /dev/md2 --level=raid1 --raid-devices=2 /dev/sda3 /dev/sdb3reboot

After the drive has fully rebooted try the following command again

mkswap /dev/md2
reboot

Once the MBLD reboots, SSH back into the drive and check to make sure your swap is active

swapon -s

It should look something like this

Filename Type Size	Used	Priority
/dev/md2 partition	500544	896	-1

 To check the status of your datavolume array

mdadm --detail /dev/md3

widowmaker wrote:



Thank you man! I don’t know how to please you. Thanks again for your help!!!

PS yes i followed guide 2

Thank you for reporting back, it is because of users like you that I am able to update the guide should other users run into similar problems :slight_smile: It’s very hard for me to support this guide without the help of other users because I don’t have a MBLDUO to test on, so I am using my knowledge from the MBL and from serveral users here to help out the best I can.

Hello . i use the guide 2 to setup MBLD,new empty drives,i only install A drives ,and put it back.

after restore the factory settings (quick and full all tryied),but there still have a smart fail error message .

i search some meeage on the forums, is this caused by samrt diable ? i use smartctl -s on … to enable the /dev/sda and /dev/sdb…is this correct? the script can’t auto enbale the drives samrt?

i found the script can’t format the /dev/sda4…after install and  full factory restore. use SSH back to check the drives,

i use “parted” to check is drives partition is ready…sda4 still don’t have the file system(should be ext4?) please help to check ,is this normal? after i rebuild the raid1.then go normal as below

Number Start End Size File system Name Flags
3 15.7MB 528MB 513MB linux-swap(v1) primary raid
1 528MB 2576MB 2048MB ext3 primary raid
2 2576MB 4624MB 2048MB ext3 primary raid
4 4624MB 2000GB 1996GB ext4 primary raid

stevevev wrote:

i search some meeage on the forums, is this caused by samrt diable ?

Yes

 

i use smartctl -s on … to enable the /dev/sda and /dev/sdb…is this correct?

Yes

 

The script can’t auto enbale the drives samrt?

The OS should be enabling this by itself on boot. I have seen this reported a few times by people who used a similar debrick script on the single drive MBL. Not sure why this happens to a very small amount of people

 

i found the script can’t format the /dev/sda4

The script should create an EXT4 filesystem to your DataVolume partition without issue

mkfs.ext4 -b 65536 -m 0 $diskData

 

i use “parted” to check is drives partition is ready…sda4 still don’t have the file system(should be ext4?)

Yes EXT4 is correct for sda4 and sdb4

 

please help to check ,is this normal?

No as the script specifically creates an EXT4 filesystem to that partition

mklabel gpt
mkpart primary 4624M -1M
set 4 raid on
quit

mkfs.ext4 -b 65536 -m 0 $diskData

 

Were the drives formatted to any filesystem prior to running the debrick script? I’m wondering if the script has trouble creating the EXT4 filesystem on the DataVolume because it is a RAW partition? With the single drive, it has been suggested to format the drive to ANY filesystem and then delete all partitions so all you are left with is UNALLOCATED space.

 

After i rebuild the raid1.then go normal as below

Number Start End Size File system Name Flags
3 15.7MB 528MB 513MB linux-swap(v1) primary raid
1 528MB 2576MB 2048MB ext3 primary raid
2 2576MB 4624MB 2048MB ext3 primary raid
4 4624MB 2000GB 1996GB ext4 primary raid

Yes this looks perfect if you have a 4TB MBLDUO

 

By the looks of things, you are back up and running now. Are there any changes I need to make to the guide?

Please try to be specific as possible as I don’t own a MBLDUO so can’t reproduce your steps

Thanks :slight_smile:

First of all I would like to thank nfodiz for a great guide! You are doing a great job and helping lots of people!

Here are the results of installing fresh OS on two empty drives on MBLD. I will try to describe all steps in detail. This may be helpful for people who don’t have advanced technical knowledge. And I want to apologize for my bad English beforehand!

During preparation I did everything like nfodiz wrote except two things. I didn’t use Download SystemRescueCd, because I have only two SATA cables in my PC. I used USB thumb drive formatted to FAT32 with Linux Live CD (version Ubuntu 12.10 ) instead of it. If somebody is interested how to create one then you can check this link: http://www.linuxliveusb.com/

And I didn’t use USB thumb drive to copy “debrick.sh” and “rootfs.img” to it. I just put those two files in a folder on my hard drive with Windows and I could later access that folder from Linux and mount it from terminal. Be careful when you do this, because as nfodiz mentioned before if you mess up drive letters in Linux terminal you can erase your hard drive with Windows by accident.

So I had two clean hard drives 3 TB each without file system (space unallocated on both). I connected them one by one to my PC via SATA and each time booted into Linux from thumb drive. (For those who don’t know you must access your PC’s BIOS first and change boot setup order to boot from USB not from your hard drive with Windows.

Connect first hard drive to PC via SATA, boot into Linux from thumb drive (select Try Ubuntu, not Install Ubuntu!) and check in terminal which drive is assigned to which letter with the following command:

 

sudo fdisk –l

My drive with Windows was /dev/sda, so I typed:

sudo mount /dev/sda1

And it showed me that it is already mounted. After this I mounted folder with debrick.sh" and “rootfs.img”. 

Now you will have to install mdadm package, because it is not installed on Live CD.

sudo apt-get install mdadm

When it is was installed I typed (Because my empty hard drive was assigned to /dev/sdb. Attention! Your hard drive can be assigned to a different letter! For example: /dev/sdc or /dev/sdd):

./debrick.sh rootfs.img /dev/sdb destroy

After debrick process is completed you shut down PC, disconnect the first hard drive, connect the second hard drive and repeat everything (you will even have to install even mdadm package again).

When hard drives were ready I placed only one of them into MBLD and booted it for test (Don’t forget to switch of the power cable when you connect or disconnect hard drives from MBLD!). LED on MBLD was red, but I could access its dashboard. Drive status in dashboard was “Bad”. RAID and status of both hard drives was shown as failed in storage. NB I was offered to upgrade to the latest (which is currently 02.41.05)  automatically, but I canceled it. You will be offered to upgrade firmware each time you enter MBLD dashboard, but I don’t advise you to do it unless the drive is 100% ready. So I did a quick factory restore via dashboard, but nothing changed after reboot.

After this I placed both hard drives into MBLD and booted it. The LED was still red. I was still able to access dashboard. I did a quick factory restore via dashboard again. Now the LED wasn’t red anymore. It was yellow and I could access dashboard and drive status there was shown as “initializing”. Soon LED became green.
After this I connected to MBLD via PuTTY and typed:

mdadm --create -e 0 --verbose /dev/md2 --level=raid1 --raid-devices=2 /dev/sda3 /dev/sdb3
reboot

(mkswap /dev/md2  wasn’t created in the beginning)

After MBLD rebooted I connected to MBLD via Putty again and typed:

mkswap /dev/md2
reboot

Now after new reboot when I typed in PuTTY:

swapon –s

And got the following output (only Used had a different value):

Filename  Type  Size Used Priority
/dev/md2    partition 500544 896 -1

Everything seemed to work, but when I tried to do a short diagnostic test I got the following message: Internal server error. Retry your last operation if the error persists, contact WD Support for assistance. Drive status in dashboard became “Bad”, LED  color became red and I got alert that drive SMART check failed.

I found the following thread how to enable support on My Book Live. Thanks to nfodiz again for provided solution!
http://community.wdc.com/t5/My-Book-Live/Enabling-S-M-A-R-T-support-on-WD-My-Book-Live/td-p/548280

So I typed the following commands in PuTTY:

smartctl -s on /dev/sda
smartctl -s on /dev/sdb
reboot

After reboot I was able to complete quick diagnostic test. Drive status in dashboard became “Good” and LED green! Btw the drive is in striped mode (RAID 0) at the moment. So I guess it is setting RAID 0 by default as written in its manual.

It seems that MBLD is working fine now. I can access dashboard and MBLD shares via LAN.

In addition, please check the output from ‘parted’ command below:

MyBookLiveDuo:~# parted

GNU Parted 2.2
Using /dev/sda
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) p
Model: ATA WDC WD30EZRX-00A (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start        End          Size          File system        Name     Flags
 3             15.7MB   528MB    513MB     linux-swap(v1)  primary  raid
 1             528MB    2576MB  2048MB  ext3                     primary  raid
 2             2576MB  4624MB  2048MB  ext3                     primary  raid
 4             4624MB  3001GB  2996GB                               primary  raid

Thanks!

2 Likes