Instalation with raid 1

Started by Luc3k, February 01, 2021, 12:01:35 PM

Previous topic - Next topic
February 01, 2021, 12:01:35 PM Last Edit: February 01, 2021, 12:03:37 PM by Luc3k
I've installed OPNsense with two disks which are working with raid 1 (GEOM Mirror). One of disks is almost new (hs 5000 hours of work), but second has 49000 hours of work. I'm planing to replace the second drive with a new one.
Can I ask for little help/instructions/tutorial how replace old disk and rebuild disk array (raid 1)?

Please post the output of
gmirror status
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

February 01, 2021, 09:09:00 PM #2 Last Edit: February 01, 2021, 09:12:40 PM by Luc3k

root@Lan14:~ # gmirror status
           Name    Status  Components
mirror/OPNsense  COMPLETE  ada0 (ACTIVE)
                           ada1 (ACTIVE)



root@Lan14:~ # gmirror list
Geom name: OPNsense
State: COMPLETE
Components: 2
Balance: split
Slice: 4096
Flags: NONE
GenID: 0
SyncID: 1
ID: 584546050
Type: AUTOMATIC
Providers:
1. Name: mirror/OPNsense
   Mediasize: 1000204885504 (932G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e6
Consumers:
1. Name: ada0
   Mediasize: 1000204886016 (932G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: DIRTY
   GenID: 0
   SyncID: 1
   ID: 2830495722
2. Name: ada1
   Mediasize: 1000204886016 (932G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   State: ACTIVE
   Priority: 1
   Flags: DIRTY
   GenID: 0
   SyncID: 1
   ID: 4007642130

February 01, 2021, 10:02:24 PM #3 Last Edit: February 01, 2021, 10:05:27 PM by pmhausen
So they are mirroring the whole disk. That makes replacement pretty easy.
Assuming the disk to be replaced is ada1 ...

gmirror remove OPNsense ada1

shutdown system, replace disk, boot again, assuming the new disk is ada1 again

gmirror insert OPNsense ada1


Depending on your system it might be necessary to enforce the new disk is ada1 by switching the cabling if necessary. Possibly the system won't boot if ada0 does not present a proper MBR or UEFI boot environment. So if the disk to be replaced is ada0 you might have to adapt a bit.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

February 01, 2021, 10:47:00 PM #4 Last Edit: February 01, 2021, 11:07:15 PM by Luc3k
The disk I want to replace is ada1.
Should I install the boot manager on the ada1 disk after rebuilding?

The procedure will re-mirror the entire content of ada0 onto ada1. Including the boot manager etc. That's why I said it's good OPNsense mirrors the entire disk.

There are other possible setups since GEOMs are stackable. So you could theoretically mirror individual partitions. But that's not the case here. Just go ahead.  ;)
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Thank you for your help. Everything rebuilt well. Now I should disconnect one of the disks and check if everything starts up properly :-)