Alright, I think I found the problem.
TL;DR: The MBL Duo fails to boot if two drives are present and only the the drive on the left ("drive A" in the manual) contains OpenWrt. It boots fine with two drives and OpenWrt only on the right drive ("drive B"), and it boots fine from a single drive. It should also boot if OpenWrt is on both drives, but I couldn't test that to confirm.
Here's what's happening (and someone please CMIIW if I bungled this up):
- drive 0:1 is the drive in the bay on the right side (called "drive B" in the manual), with two disks present, it gets assigned
/dev/sda
- drive 1:1 is the drive in the bay on the left side (called "drive A" in the manual), with two disks present, it gets assigned
/dev/sdb
- yes, WD enumerates them in reverse in both their manual and the original firmware
- the MBLD uboot script tries to boot off 1:1 first, and upon failure tries to boot from drive 0:1
- a single drive (naturally) always gets assigned
/dev/sda
regardless of what bay it is in
OpenWrt tries to mount its boot partition at /dev/sda2
. From /boot/boot.scr in its first partition:
setenv boot_args 'setenv bootargs root=/dev/sda2 rw rootfstype=ext4'
Now if two drives are present and only drive 1:1 ("drive A" on the left) being assigned /dev/sdb
contains OpenWrt, the boot partition would be on /dev/sdb2
, so naturally the mounting of /dev/sda2
fails:
[ 1.089282] VFS: Cannot open root device "sda2" or unknown-block(8,2): error -6
[ 1.096588] Please append a correct "root=" boot option; here are the available partitions:
[ 1.104913] 0800 1465138584 sda
[ 1.104917] driver: sd
[ 1.111008] 0801 1465135104 sda1 c61c1c84-01
[ 1.111010]
[ 1.117359] 0810 488386584 sdb
[ 1.117362] driver: sd
[ 1.123450] 0811 8192 sdb1 5452574f-01
[ 1.123451]
[ 1.129800] 0812 262144 sdb2 5452574f-02
[ 1.129801]
[ 1.136150] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,2)
However, as long as the drive it tries to boot OpenWrt off of is assigned /dev/sda
, everything is fine. This is the case for a single drive, and for two drives if only the drive on the right contains OpenWrt.
This puzzles me. It should also work if both drives contain OpenWrt. In this case it would still boot off /dev/sdb, but since /dev/sda2 also contains an OpenWrt boot partition it should be able to just mount that one and be none the wiser. Again, I could not test this case because I didn't have a second spare drive handy, so I can't tell why it would fail for you.
I could imagine a fringe case though: If you accidentally put the image for the My Book Live Single on a drive, I found that it boots fine in either bay of a My Book Live Duo. The hardware apparantly is so close to identical that it works. However, it doesn't work with another drive present.
(As for the reversed enumeration in WD's manual, I can only assume this is done to not confuse people used to reading and numbering things left to right. Since the boot script in uboot does a sata init
before checking every single drive to boot off, this would shave a few seconds off the boot process when people only populate "drive A" first. As for what the original firmware mounts as its boot partition, I never looked into the original firmware, but I assume it keeps its boot partition in a RAID between the two drives to circumvent the problem.)