August 12, 2012

Detailed NAS-tiness

  

The problem

Looking for a way to upgrade the capacity of the My Book Live Duo (MBLD) 4TB to 6TB, I tried to swap the 2 x 2TB disks for 2 x 3TB hdds. The MBLD uses mdadm as its raid tool, and its use is pretty well documented on the web. As with most raid systems, the recommended way was to replace the disks one by one, letting the system reinitialize the disks and the later grow the raid array. Unfortunately, when I did this with the 3TB disks, the maximum size of the array was still stuck at either 2TB (raid1 mode) or 4TB (raid0 mode). The grow option with mdadm said the maximum size was already reached. Using the raid mode conversion or the factory reset on the web UI still only maxed out at 2TB with the 3TB disks.

That began 48 hours of trial and error (mainly because of the reinitializing/rebuilding of the array – took about 6 hours each time) and now at the end of the 48 hours, I have 3TB (raid1)/6TB (raid0) on my MBLD 4TB system.

Below are the steps I took. I’m pretty sure some of them can be left out, and probably someone knows a 3 step way of doing this, but this is how I got it done and for those who don’t know a way, I hope it works for you too.

Disclaimer

I accept no responsibility or liability if anything in the steps I’ve outlined, communicated or alluded to in any way, through any comments, views or statements of any form, bricks, incapacitates, renders unuseable or damages your device (whatever device it may be). By reading these instructions and carrying them out in whole or in part, you accept full responsibility for the outcome, whatever outcome that might be and absolve me, the website owner, the owner of the machine and all parties directly or indirectly related to this website and me from any liability whatsoever.

In other words, if you break what you’re working on, its ALL on YOU!


Pre-requisites

The guide below assumes very heavily that you have UNIX experience and you know at least what ssh is and how to do it using one of the many clients available or through another UNIX/MAC machine’s cli (if you don’t know what cli means, then I’d advise against continuing).

Enabling SSH

  • Boot the MBLD and access it from the web UI.
  • Add the “/ssh” to the end of the URL (ie: http://<MBLD_IP>/UI/ssh) to access the SSH settings
  • Enable ssh

Initializing the new drives

  • Shut down the MBLD and remove ONE drive and replace it with the higher capacity drive
  • Boot up the MBLD – the led will be yellow but you can still access it over SSH and the web UI
  • The web UI will have a red ‘i’ icon with the message that a drive is being reinitialized – let it continue
  • When it has finished initializing the disk, reboot the MBLD and repeat the last 3 steps for the 2nd hard drive (whole thing can take a few hours)
  • After the 2nd higher capacity disk has been reinitialized, reboot the device to make sure it comes up correctly.
  • The web UI should still say you only have 4TB (raid0/spanning mode) or 2T (raid1) even though you are now using the higher capacity drives.

Removing the raid partitions

  • Use PuTTy (or any other ssh client) to ssh to the MBLD as root, using the password ‘welc0me’
  • Check for the raid mount using ‘df -h’ it should be /dev/md3 mounted to /DataVolume (one with the largest storage)
  • Unmount /dev/md3 with ‘umount /dev/md3’
  • Check which partitions make up the raid using ‘mdadm -D /dev/md3’ – you should see 2 partitions, /dev/sda4 and /dev/sdb4
    # mdadm -D /dev/md3
    /dev/md3:        
            Version : 1.2  
      Creation Time : Sat Sep 15 10:40:58 2012     
         Raid Level : linear     
         Array Size : 3897997296 (3717.42 GiB 3991.55 GB)   
       Raid Devices : 2  Total Devices : 2    
        Persistence : Superblock is persistent    
    
        Update Time : Sat Sep 15 21:44:03 2012          
              State : clean 
     Active Devices : 2
    Working Devices : 2 
     Failed Devices : 0  
      Spare Devices : 0           
    
               Name : MyBookLiveDuo:3  (local to host MyBookLiveDuo)
               UUID : 7d229761:df1a7961:f3f1f7dd:388be367
             Events : 173
    
        Number   Major   Minor   RaidDevice State
           0       8        4        0      active sync   /dev/sda4
           1       8       20        1      active sync   /dev/sdb4
  • Use ‘parted’ and select /dev/sda then print the partition info using ‘p’
  • You will see that the last partition is /dev/sda4
    # parted /dev/sda
    GNU Parted 2.2
    Using /dev/sdaWelcome to GNU Parted! Type 'help' to view a list 
    of commands.
    (parted) p
    Model: ATA WDC WD30EZRX-00D (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 2000GB 1996GB                primary raid 
    (parted)
  • As can be seen, even though you are using a higher capacity drive, the partition is still only 2TB in size
  • Use ‘rm 4’ to remove /dev/sda4
  • Repeat the last 4 steps, running ‘parted’ on /dev/sdb (instead of /dev/sda)
  • Now you would have removed both /dev/sda4 and /dev/sdb4 from disks

Creating correctly sized raid partitions based on 3T hdds

  • Reboot the MBLD – the led will stay yellow (may turn red), but you can still access it
  • Use PuTTy to ssh into the MBLD again
  • If you do ‘mdadm -D /dev/md3’ now, it will say there is no such raid device (since you removed the 2 partitions /dev/sda4 and /dev/sdb4 that comprised the raid)
  • Run ‘parted /dev/sda’
  • Do ‘mkpart 4 4624MB 3T’ and ‘set 4 raid on’
  • When you do ‘p’ now you will see the 3TB size for the /dev/sda4 partition
    4      4624MB  3001GB  2996GB                  primary  raid
  • Repeat the last 3 steps, running ‘parted’ on /dev/sdb (instead of /dev/sda)
  • Both /dev/sda4 and /dev/sdb4 should now be correctly sized
  • Format /dev/sda4 using ‘mkfs.ext4 -b 65536 -m 0 /dev/sda4’
  • Repeat the last step for /dev/sdb4 (instead of /dev/sda4)

Recreating the raid array with the new partitions

  • Now create the raid array using ‘mdadm –create /dev/md3 –level=mirror –raid-devices=2 /dev/sda4 /dev/sdb4’
  • The above step creates a raid1 mirror setup, to create a raid0 stripe setup, change ‘–level=mirror’ to ‘–level=linear’
  • Format the raid array using ‘mkfs.ext4 -b 65536 -m 0 /dev/md3’
  • Once completed you should test that its ok by doing ‘mount -t ext4 /dev/md3 /DataVolume’
  • If the above mounts correctly, then you’re all set – reboot the MBLD and you should have a 3TB size visible with raid1 setup.

UPDATE:

Just like I said, there is an easier way (not 3 steps though) to do this and if you’re comfortable with UNIX and the command line (like I expect you to be before doing any of the above) and you have a Ubuntu box lying around, you can try out the quick and easy way here. I’m told it works, but I haven’t tried it out myself yet, so, try at your own risk!

Comments (0)

Leave a comment...

To leave a comment on this post, please login by clicking one of the following.