RAID 1 on a MY BOOK LIVE DUO (PROJECT FUN)

My project is to get a RAID 1 array up and running on this MY BOOK LIVE DUO with a pair of 4TB hard drives (the device is the 6TB model). The impetus for this project is the long dormant MY BOOK LIVE DUO gathering dust since the WD GREEN hard drives up and died, or rather down and died. I'm hopeful that I can get this up and running with more functionality than the terrible WD interface.

Getting the first drive, dev/sda, up and running is easy enough. Following the excellent example video on the MY BOOK LIVE DUO page is what I'm working towards in terms of functionality. (1st Question) If the Firmware install build is the same as the Firmware upgrade do we skip that sysupgrade ? So the first drive is up and then we can create a third partition with gpart
Now the Second disk in the enclosure, ??? safest way to 'copy' the zero drive dev/sdawith the dd command (bs=64) (is the dd command limited to under 2TB? use cat instead?) to the dev/sdb? Or repeat the initial process of the dev/sda drive for the dev/sdb drive?

Am I over complicating the raid, is there a luci interface to turn raids on? I've been trying to nail it down a luci raid 'button' and I can't seem to research a definitive answer.
Lets say we can't just flip a button and we need to create a raid array via the command line. Can we simply raid the whole disc? Or, what seems more likely, again safer, we create a raid array for each partition?

Before I can start to build a RAID 1 array, I have to install the mdadm package and then kmod-md-raid1 package? Or are they already built in?

I'll get started on this and report back and maybe answer some of my own questions. Any insight is appreciated. I'm a brand new parent so time compression looms large am usually interrupted mid thought by that new dynamic. Thanks in advance MZA

Putty into the DUO, gdisk dev/sda3 created. I can't seem to figure out the command line in ssh to get the /dev/sda3 to get to the fstab. Also Can't install blkid. Strange, mkfs.ext4 /dev/sda3, didn't work for several hours and suddenly, out of frustration/insanity it sudenly worked... i don't get it, does it need time to compile or some other such?

Hi MZA.. I'm new here and am trying to do the same thing you're attempting. I appear to have gotten a bit farther than you and will tell you what I did in the hopes it can help you.

I'm also hoping someone else can help me get past the problem I've encountered.

I've got RAID1 up and running on 2 3TB drives but the RAID partition does not persist after a reboot - I have to re-create it. But it is important to note the data stored on the RAID partitions is not lost after the reboot.

Let me try to answer your questions in order (but take some of what I say with a bit of skepticism as I might be wrong - as I'm new to OpenWRT on MyBook Live).

Question #1: " If the Firmware install build is the same as the Firmware upgrade do we skip that sysupgrade ?"

Yes. I believe that the sysupgrade tar file is for people who have a previous version loaded onto their MBL. You shouldn't need to load it if you're loading OpenWRT for the first time.

Your next answers are going to come in the following descriptions of what I've done.

I loaded the factory firmware onto both drives and put them both into the enclosure.

Once the MBL is booted and you've been able to connect to it via ssh you'll need to create partitions for /dev/sda3 and /dev/sdb3. As suggested somewhere - to leave room for possible future upgrades - I started these partitions at the 1G point, after the boot and system partitions. However, since these partitions are larger than 2TB, you'll need to use gdisk to create them. Once they're created and filesystems exist on them, you should also use gdisk to create a hybrid MBR (also for use in case of future upgrades). You can follow the instructions in that YouTube video to make ext4 file systems on /dev/sda3 and /dev/sdb3. (FWIW, I installed samba4 instead of samba3-6.)

Here's what I have after this partitioning and hybrid MDR creation has been done:

# gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.4

Partition table scan:
  MBR: hybrid
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with hybrid MBR; using GPT.
Disk /dev/sda: 5860533168 sectors, 2.7 TiB
Model: WDC WD30EZRX-00M
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 9523AF7A-****-****-****-93A85EFE82C6
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 1556446 sectors (760.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
1  8192  24575   8.0 MiB     8300  Linux filesystem
2  32768  557055   256.0 MiB   8300  Linux filesystem
3  2097152  5860533134   2.7 TiB     8300  Linux filesystem
# gdisk -l /dev/sdb
GPT fdisk (gdisk) version 1.0.4

Partition table scan:
  MBR: hybrid
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with hybrid MBR; using GPT.
Disk /dev/sdb: 5860467633 sectors, 2.7 TiB
Model: WDC WD30EZRX-00S
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): F29BC134-****-****-****-53971D02967A
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 5860467599
Partitions will be aligned on 2048-sector boundaries
Total free space is 1556446 sectors (760.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
1  8192  24575   8.0 MiB     8300  Linux filesystem
2  32768  557055   256.0 MiB   8300  Linux filesystem
3  2097152  5860467599   2.7 TiB     8300  Linux filesystem

Once the two partitions exist you can assemble them into a raid partition via:
madm -v --create /dev/md0 /l1 -n2 /dev/sda3 /dev/sdb3

Then, (sorry - I don't know if this step is truly necessary as ext4 filesystems already exist on both /dev/sda3 and /dev/sdb3), create an ext4 filesystem on /dev/md0:
mke2fs -t ext4 /dev/md0

Then mount it wherever you want. I mounted it on /mnt/raid:
mount /dev/md0 /mnt/raid

Once you've exported these mount points using the luci samba app and 'confirmed' the mount points in luci, your raid drives are ready to be used.

However, after a reboot f the MBL - if your mileage is the same as mine - /dev/mdo won't be mounted and you'll need to re-assemble the raid via the 'mdadm --create' command and re-mount it.

The good news is, as I said above, that no files are lost even though /dev/md0 needs to be recreated.

But if anyone else knows how to ensure that /dev/md0 persists and gets re-mounted after a reboot, please let me know.

I hope this helps.

Your raid disks are now useable

1 Like

Oops, typo.

In the posting immediately preceding this one, the mdadm command to assemble the raid should be:

mdadm -v --create /dev/md0 -l1 -n2 /dev/sda3 /dev/sdb3

Yes it can be done. And easily. I got everything up and running and then hit the LUCI button 'GENERATE CONFIG' to save the configuration. Works on reboot. DONE.

Browsing around and reading the various posts I came to realize that this site is not for the novice, not even close. As I puttzed around with this box and made progress, the questions changed and left my earlier assumptions bare. To the novice: take good notes on what you're doing, save your SSH logs, they yell at you what you have done wrong and in what order you did it wrong. Thank you @Takimata for giving me the kick in the seat to rely on myself to FIGURE IT OUT.

I know it's a little bit too late, but you can find very detailed instructions on raid config, and how to make it permanent in this topic.

I am new with OpenWrt 21.02.01 on a My Book Live Duo. I successfully created a RAID 1 data partition and now i wish to create RAID 1 for sda1 and sda2 (boot- and root partition) also. Is this possible?

hmm, the md superblock 0.9 or 1.0 is needed I think. This is because these older superblock versions have the metadata at the end. So the uboot's ext2load command that loads the kernel and devicetree file will work as usual. For this you would have to resize the boot and root partitions a tiny bit.

What is more complicated now is that from what I know the "in-kernel md autodetection" has been removed. This is may or may not be an issue though. It depends how easy it is to swap the drives in the bays. But to get this water tight, one would probably have to run mdadm in an initramfs.

(Instead of having the same boot+kernel on both, it might be better to have the previous boot+rootfs sticking around on the other driver. This would have made the recovery for bricked openwrt 21.02(.0) much easier since it would just be a drive swap and you would be back with 19.07)

Thank you very much for your answer.
I think you are right with your assumtion about the md superblock version 0.9.
I will add the kernel log at the end of this message.
Do you have a proposal about the resizing of the root and boot partition and filesystem sizes? I will follow additional proposals to bring this feature hopefully up and running.
I am an experienced Linux user, but currently i have to learn some things about the u-boot loader, OpenWRT early boot process and probably OpenWRT building skills.

[    0.000000] printk: bootconsole [udbg0] enabled
[    0.000000] Linux version 5.4.154 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16325-88151b8303)) #0 Sun Oct 24 09:01:35 2021
[    0.000000] Using PowerPC 44x Platform machine description
[    0.000000] -----------------------------------------------------
[    0.000000] phys_mem_size     = 0x10000000
[    0.000000] dcache_bsize      = 0x20
[    0.000000] icache_bsize      = 0x20
[    0.000000] cpu_features      = 0x0000000000000120
[    0.000000]   possible        = 0x0000000040000120
[    0.000000]   always          = 0x0000000000000120
[    0.000000] cpu_user_features = 0x8c008000 0x00000000
[    0.000000] mmu_features      = 0x00000008
[    0.000000] -----------------------------------------------------
[    0.000000] Top of RAM: 0x10000000, Total RAM: 0x10000000
[    0.000000] Memory hole size: 0MB
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] On node 0 totalpages: 65536
[    0.000000]   Normal zone: 576 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 65536 pages, LIFO batch:15
[    0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line: root=/dev/sda2 rw rootfstype=squashfs,ext4 console=ttyS0,115200
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 251696K/262144K available (6436K kernel code, 236K rwdata, 744K rodata, 180K init, 229K bss, 10448K reserved, 0K cma-reserved)
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xfffdf000..0xfffff000  : fixmap
[    0.000000]   * 0xd1000000..0xfffdf000  : vmalloc & ioremap
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
[    0.000000] UIC0 (32 IRQ sources) at DCR 0xc0
[    0.000000] UIC1 (32 IRQ sources) at DCR 0xd0
[    0.000000] UIC2 (32 IRQ sources) at DCR 0xe0
[    0.000000] UIC3 (32 IRQ sources) at DCR 0xf0
[    0.000000] random: get_random_u32 called from 0xc07059e4 with crng_init=0
[    0.000000] time_init: decrementer frequency = 800.000008 MHz
[    0.000000] time_init: processor frequency   = 800.000008 MHz
[    0.000020] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0xb881274fa3, max_idle_ns: 440795210636 ns
[    0.010286] clocksource: timebase mult[1400000] shift[24] registered
[    0.016603] clockevent: decrementer mult[ccccccef] shift[32] cpu[0]
[    0.022897] pid_max: default: 32768 minimum: 301
[    0.027562] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.034803] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.046859] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.056534] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.065967] NET: Registered protocol family 16
[    0.070921] DMA: preallocated 256 KiB pool for atomic allocations
[    0.078989] 256k L2-cache enabled
[    0.082330] PCIE0: Port disabled via device-tree
[    0.087528] PCI: Probing PCI hardware
[    0.105313] SCSI subsystem initialized
[    0.109752] libata version 3.00 loaded.
[    0.114693] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.125469] clocksource: Switched to clocksource timebase
[    0.131515] thermal_sys: Registered thermal governor 'step_wise'
[    0.131730] NET: Registered protocol family 2
[    0.142057] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.149710] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.157984] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.165580] TCP bind hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.172568] TCP: Hash tables configured (established 2048 bind 2048)
[    0.178944] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.185398] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.192434] NET: Registered protocol family 1
[    0.196742] PCI: CLS 0 bytes, default 32
[    0.204422] dw_dmac 4bffd0800.dma: DesignWare DMA Controller, 2 channels
[    0.216038] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.227781] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.302555] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.310774] GPIO line 473 (Enable Reset Button, disable NOR) hogged as output/low
[    0.318985] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.327421] printk: console [ttyS0] disabled
[    0.331679] 4ef600300.serial: ttyS0 at MMIO 0x4ef600300 (irq = 33, base_baud = 462962) is a TI16750
[    0.340645] printk: console [ttyS0] enabled
[    0.348917] printk: bootconsole [udbg0] disabled
[    0.362155] loop: module loaded
[    0.365291] Loading iSCSI transport class v2.0-870.
[    0.376487] sata-dwc 4bffd1000.sata: id 0, controller version 1.91
[    0.383889] scsi host0: sata-dwc
[    0.387465] ata1: SATA max UDMA/133 irq 40
[    0.391715] sata-dwc 4bffd1800.sata: id 0, controller version 1.91
[    0.399210] scsi host1: sata-dwc
[    0.402688] ata2: SATA max UDMA/133 irq 41
[    0.407565] libphy: Fixed MDIO Bus: probed
[    0.411673] PPC 4xx OCP EMAC driver, version 3.54
[    0.416789] MAL v2 /plb/mcmal, 1 TX channels, 1 RX channels
[    0.422565] RGMII /plb/opb/emac-rgmii@ef601500 initialized with MDIO support
[    0.429765] TAH /plb/opb/emac-tah@ef601350 initialized
[    0.435210] /plb/opb/emac-rgmii@ef601500: input 0 in rgmii mode
[    0.441267] libphy: emac_mdio: probed
[    0.449628] eth0: EMAC-0 /plb/opb/ethernet@ef600c00, MAC 00:90:a9:be:fc:b1
[    0.456503] eth0: found Broadcom BCM50610 PHY (0x01)
[    0.461551] i2c /dev entries driver
[    0.465118] booke_wdt: powerpc book-e watchdog driver loaded
[    0.485767] NET: Registered protocol family 10
[    0.491948] Segment Routing with IPv6
[    0.495712] NET: Registered protocol family 17
[    0.500198] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    0.513112] 8021q: 802.1Q VLAN Support v1.8
[    0.517356] drmem: No dynamic reconfiguration memory found
[    0.523314] usb-regulator GPIO handle specifies active low - ignored
[    0.755680] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    0.761955] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    0.769168] ata1.00: ATA-9: WDC WD30EFRX-68AX9N0, 80.00A80, max UDMA/133
[    0.775868] ata1.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 1/32)
[    0.785137] ata1.00: configured for UDMA/133
[    0.789813] scsi 0:0:0:0: Direct-Access     ATA      WDC WD30EFRX-68A 0A80 PQ: 0 ANSI: 5
[    0.799069] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB)
[    0.806816] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    0.812570] sd 0:0:0:0: [sda] Write Protect is off
[    0.817369] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    0.822531] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.844975] ata2.00: ATA-9: WDC WD30EFRX-68AX9N0, 80.00A80, max UDMA/133
[    0.851742] ata2.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 1/32)
[    0.862025] ata2.00: configured for UDMA/133
[    0.866671] scsi 1:0:0:0: Direct-Access     ATA      WDC WD30EFRX-68A 0A80 PQ: 0 ANSI: 5
[    0.875941] sd 1:0:0:0: [sdb] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB)
[    0.883687] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    0.889316] sd 1:0:0:0: [sdb] Write Protect is off
[    0.894124] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    0.899478] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.909538]  sda: sda1 sda2 sda3
[    0.915017] sd 0:0:0:0: [sda] Attached SCSI disk
[    0.973490]  sdb: sdb1 sdb2 sdb3
[    0.978058] sd 1:0:0:0: [sdb] Attached SCSI disk
[    0.982817] md: Waiting for all devices to be available before autodetect
[    0.989598] md: If you don't use raid, use raid=noautodetect
[    0.995726] md: Autodetecting RAID arrays.
[    1.034796] md: invalid raid superblock magic on sda1
[    1.039850] md: sda1 does not have a valid v0.90 superblock, not importing!
[    1.058411] md: invalid raid superblock magic on sda2
[    1.063461] md: sda2 does not have a valid v0.90 superblock, not importing!
[    1.070555] md: invalid raid superblock magic on sda3
[    1.075600] md: sda3 does not have a valid v0.90 superblock, not importing!
[    1.120423] md: invalid raid superblock magic on sdb1
[    1.125471] md: sdb1 does not have a valid v0.90 superblock, not importing!
[    1.144642] md: invalid raid superblock magic on sdb2
[    1.149688] md: sdb2 does not have a valid v0.90 superblock, not importing!
[    1.156786] md: invalid raid superblock magic on sdb3
[    1.161837] md: sdb3 does not have a valid v0.90 superblock, not importing!
[    1.168780] md: autorun ...
[    1.171574] md: ... autorun DONE.
[    1.185138] EXT4-fs (sda2): warning: mounting unchecked fs, running e2fsck is recommended
[    1.205693] EXT4-fs (sda2): mounted filesystem without journal. Opts: (null)
[    1.212795] VFS: Mounted root (ext4 filesystem) on device 8:2.
[    1.219382] Freeing unused kernel memory: 180K
[    1.223893] Run /sbin/init as init process
[    1.324861] init: Console is alive
[    1.328496] init: - watchdog -
[    1.343780] random: fast init done
[    1.370270] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    1.407406] usbcore: registered new interface driver usbfs
[    1.412982] usbcore: registered new interface driver hub
[    1.418351] usbcore: registered new device driver usb
[    1.441240] dwc2 4bff80000.usbotg: 4bff80000.usbotg supply vusb_d not found, using dummy regulator
[    1.450311] dwc2 4bff80000.usbotg: 4bff80000.usbotg supply vusb_a not found, using dummy regulator
[    1.561835] dwc2 4bff80000.usbotg: DWC OTG Controller
[    1.566923] dwc2 4bff80000.usbotg: new USB bus registered, assigned bus number 1
[    1.574346] dwc2 4bff80000.usbotg: irq 36, io mem 0x4bff80000
[    1.580936] hub 1-0:1.0: USB hub found
[    1.584901] hub 1-0:1.0: 1 port detected
[    1.595942] usbcore: registered new interface driver usb-storage
[    1.602544] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    1.612461] init: - preinit -
[    1.774053] eth0: link is down
[    1.786911] random: procd: uninitialized urandom read (4 bytes read)
[    4.221732] eth0: link is up, 1000 FDX, pause enabled
[    4.226834] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    5.872332] mount_root: mounting /dev/root
[    5.894212] EXT4-fs (sda2): re-mounted. Opts: (null)
[    5.899398] mount_root: loading kmods from internal overlay
[    5.915145] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[    5.923023] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[    6.776216] block: attempting to load /etc/config/fstab
[    6.794010] block: extroot: not configured
[    6.821381] EXT4-fs (sda1): warning: mounting unchecked fs, running e2fsck is recommended
[    6.850534] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
[    6.859244] urandom-seed: Seeding with /etc/urandom.seed
[    6.898244] procd: - early -
[    6.901194] procd: - watchdog -
[    7.085346] random: crng init done
[    7.455591] procd: - watchdog -
[    7.466156] procd: - ubus -
[    7.520792] procd: - init -
[    8.136204] kmodloader: loading kernel modules from /etc/modules.d/*
[    8.217866] device-mapper: ioctl: 4.41.0-ioctl (2019-09-16) initialised: dm-devel@redhat.com
[    8.327746] xt_time: kernel timezone is -0000
[    8.393634] kmodloader: done loading kernel modules from /etc/modules.d/*
[    8.461393] urngd: v1.0.2 started.
[   10.301970] md: md127 stopped.
[   10.317619] md: kicking non-fresh sdb3 from array!
[   10.341572] md/raid1:md127: active with 1 out of 2 mirrors
[   10.358754] md127: detected capacity change from 0 to 2999383949312
[   12.113911] EXT4-fs (md127): mounted filesystem with ordered data mode. Opts: 
[   12.397134] eth0: link is up, 1000 FDX, pause enabled
[   12.414938] br-lan: port 1(eth0) entered blocking state
[   12.420201] br-lan: port 1(eth0) entered disabled state
[   12.425673] device eth0 entered promiscuous mode
[   13.397546] br-lan: port 1(eth0) entered blocking state
[   13.402787] br-lan: port 1(eth0) entered forwarding state
[   13.412204] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready