Welcome! Log In Create A New Profile

Advanced

NSA325 - OpenWRT - rebuild RAID1

Posted by pom 
pom
NSA325 - OpenWRT - rebuild RAID1
January 22, 2022 05:54AM
Hi,

I'm a total beginner when it comes to linux. In the last couple of weeks i've installed OpenWRT on my NSA325v1 and its up and running and i'm happily playing with LuCI.

My problem is that i havent been able to "rebuild" my RAID1 setup whilst protecting my data. I dont believe this is difficult but as i said i'm very new to Linux. I've played around with fdisk, lsblk, mdadm and tried to figure out and follow various instructions from different website but am now stuck.

My basic understanding is that i need to rebuild the Array using mdadm and mount the disk.
I would really appreciate any help or guidance.

So the current state of play is mdadm --examine returns:

root@OpenWrt:/mnt# mdadm --examine
mdadm: No devices to examine

lsblk returns:
root@OpenWrt:/mnt# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 502M 0 part
└─sda2 8:2 0 1.8T 0 part
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 502M 0 part
└─sdb2 8:18 0 1.8T 0 part
mtdblock0 31:0 0 768K 1 disk
mtdblock1 31:1 0 512K 0 disk
mtdblock2 31:2 0 126.8M 0 disk
ubiblock0_1 254:0 0 2.5M 0 disk /rom

fdisk - l returns:
root@OpenWrt:/mnt# fdisk -l
Disk /dev/mtdblock0: 768 KiB, 786432 bytes, 1536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock1: 512 KiB, 524288 bytes, 1024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock2: 126.75 MiB, 132907008 bytes, 259584 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/ubiblock0_1: 2.46 MiB, 2580480 bytes, 5040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM001-9YN1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xbb72aeee

Device Boot Start End Sectors Size Id Type
/dev/sda1 63 1028159 1028097 502M 83 Linux
/dev/sda2 1028160 3907024064 3905995905 1.8T 20 unknown

Partition 1 does not start on physical sector boundary.


Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM008-2FR1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x4c525090

Device Boot Start End Sectors Size Id Type
/dev/sdb1 63 1028159 1028097 502M 8 AIX
/dev/sdb2 1028160 3907024064 3905995905 1.8T 20 unknown

Partition 1 does not start on physical sector boundary.
Re: NSA325 - OpenWRT - rebuild RAID1
January 22, 2022 10:29AM
Why are you asking that here? The OpenWrt forum seems more appropriate.

Anyway, in contrast to Debian OpenWrt is a very minimal OS targeting routers. So any functionality which is not found on a basic router, is not installed.

I think you have to install kmod-md-raid0, kmod-md-raid1 and blockd. And then you should be able to assemble the array
mdadm --assemble /dev/md0 /dev/sda2 /dev/sdb2
Re: NSA325 - OpenWRT - rebuild RAID1
January 23, 2022 06:21PM
Quote

mdadm --assemble /dev/md0 /dev/sda2 /dev/sdb2

or if you don't know what the array looks like
mdadm --assemble --scan

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: