How to add a hot spare to a GEOM Raid 1

Started by justmehereinBrisbane, September 15, 2025, 07:29:15 AM

Previous topic - Next topic
The system won't crash when one of the drives fails ;-)
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Hi Patrick

Well in that case - lets mirror the swap drive.

Thanking you for all your help so far! :)

Quote from: justmehereinBrisbane on October 01, 2025, 09:39:45 AMswapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/ada0p3       8388608        0  8388608     0%
/dev/ada1p3       8388608        0  8388608     0%
/dev/md98         2097152        0  2097152     0%
Total            18874368        0 18874368     0%

First remove that swap file. It hurts more than it helps since you have "real" swap partitions.

Go to System > Settings > Miscellaneous and remove that check mark from "Add a 2 GB swap file to the system".

Then on a root shell:

swapoff -a
Edit the file /etc/fstab and remove these two lines:

/dev/ada0p3        none        swap    sw        0    0
/dev/ada1p3        none        swap    sw        0    0

Replace them with this one instead:

/dev/mirror/swap        none        swap    sw        0    0
Then these commands:

gmirror label -b round-robin swap ada0p3
gmirror configure -a swap
gmirror insert swap ada1p3
gmirror status
swapon -a
swapinfo

That should do it.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)