[GUIDE] Attaching external storage to MBLD

If you are like me, you have filled your MBLD and are debating whether to get another Duo, change the disk sizes in the Duo, or attach an external drive via USB to the Duo. I chose to attach a  WD MyBook Essential 6Tb drive to my MBLD via the USB port.  The MBLD recognized the external storage easily and I transferred over about 1.5Tb of data.  For maintenance reasons, my MBLD rebooted itself at some point. Thereafter, the external storage was inaccessible.

I tried to access the external storage data via direct connection to Windows. Nothing. Direct connection to Ubuntu. Nothing. Direct connection to Mac. Nothing.  The only response I got was from Windows that the external storage drive now needed to be formatted.  I spoke with WD support about the issue. They basically admitted that when the drives are initially formatted at the factory, that sometimes the formatting structure is not very healthy. Great.  My data was all lost. WD told me to format the drive again using Windows, and to do a full format - not the quick method.  So I hooked up the drive to a Windows PC and it took 75 hours to format the 6Tb drive. 

While this 75 hours was transpiring, I read that a major drawback of using a NTFS (Windows) formatted external drive with the MBLD is that when a NTFS drive isn’t properly ‘ejected’, it corrupts the file system. That’s clearly a big risk with a MBLD that can power down for many reasons.  To lose 6Tb of data because of a power failure with the MBLD powering down, is too big of risk. 

Thankfully there is a better option than NTFS, though too bad WD ships the external drive formatted NTFS.  The solution is to use the same formatting as the MBLD, Linux formatting - either ext3 or ext4 - your choice. You should know that ext4 and ext3 cannot be read by a Windows PC wihout the help of special software.  For me that is not important since my external storage was always going to be attached to the MBLD.

 You can do much of the work from the command line in Putty on the MBLD, or you can attach the drive to a Linux PC and do it that way.

If you want to do it from the command line with Putty, then you should first ‘eject’ the drive from the MBLD using the Dashboard.  Do not unplug the drive from the MBLD. The ‘eject’ function simply unmounts the drive from the MBLD OS.

 The first step is to find out the address of the attached storage. It will be /dev/XXX .  Mine was /dev/sdc/   Yours will probably be the same, but you need to verify beforehand. Start with the command to list all the drives and find your address

MyBookLiveDuo:~# parted (parted) print all

If you are using a LInux PC, then you can use fdisk command or gparted.  MBLD doesn’t have fdisk installed, though it does have sfdisk installed. An even easier way to find your address is via  FeaturesPack Manager - if you have it installed. In the System_Conf->MyBook_Infos->Disk, all the disks and addresses are listed.

There is a problem with disks > 2Tb. They need a special partition table called GPT.  GPT stands for GUID partition table format (GPT). We do it like this:

MyBookLiveDuo~# parted /dev/sdc
GNU Parted 2.1
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) print
Error: /dev/sdc: unrecognised disk label

(parted) mklabel gpt

(parted) print
Model: Unknown (unknown)
Disk /dev/sdc: 5909GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags

Now we must create the actual partition. Make sure that you specify the range of the partition properly. In my case it was 0GB 5909GB.  You get the values from the prior action. See the listing above.

MyBookLiveDuo~# parted /dev/sdc

(parted) mkpart primary 0GB 5909GB

(parted) print
Model: Unknown (unknown)
Disk /dev/sdc: 5909GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
 1 1049kB 5909GB 5909GB primary

 Next step is to format the partition. I chose ext4 as my format system. You could choose ext3 also.

MyBookLiveDuo~# mkfs.ext4 /dev/sdc1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
360644608 inodes, 1442550528 blocks
72127526 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
44024 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544

Writing inode tables: 3955/44024
Writing inode tables: 5022/44024
Writing inode tables: 7218/44024
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 23 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

You will notice that 5% of the space is reserved for super users. That is too much. We need to reduce it to zero.

MyBookLiveDuo~# tune2fs -m0 /dev/sdc1

 You are done.   If you did this with the MBLD from the command line in Putty, then you need to exit Putty, unplug the drive from the MBLD, and replug it back in to the MBLD. This is so that the MBLD will re-mount the drive. Takes about 5 minutes for this.  From the dashboard you can change the name of the attached storage in the Shares section.

Or if you want to mount the external drive using Putty, don’t exit Putty and don’t eject the drive.  Instead do this:

MyBookLiveDuo~# mkdir /var/media/NAMEYOUWANTFORDRIVE

MyBookLiveDuo~# mount /dev/sdc1 /var/media/NAMEYOUWANTFORDRIVE

MyBookLiveDuo:~# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 5.0M 0 5.0M 0% /lib/init/rw
udev 10M 1.5M 8.6M 15% /dev
tmpfs 5.0M 0 5.0M 0% /dev/shm
rootfs 1.9G 1.2G 667M 64% /
tmpfs 100M 6.9M 94M 7% /tmp
ramlog-tmpfs 20M 20M 0 100% /var/log
/dev/md3 1.9T 980G 872G 53% /DataVolume
/dev/sdc1 5.3T 59M 5.1T 1% /var/media/NAMEYOUWANTFORDRIVE
1 Like

Thanks for sharing. 

I’m sure that this will help other users on the community. 

Please note that when you create a guide for procedures that are not supported by WD, it’s always good to create a disclaimer at least saying to the users that they will be doing this on their own risk.

Thanks for sharing.
I’ve had the same issues with USB and after all I decided not to use it anymore, but with your guide I will try again.