I experienced an issue under FreeBSD 6.2-STABLE between GBDE and GMIRROR,
where a BDE encrypted swap causes the mirror to be rebuilt every single
time the system is rebooted. I believe the problem is hiding somewhere
around the point where gbde gets stopped/unloaded during shutdown, which
probably writes some little data back on disk AFTER gmirror stops syncing
the providers. This way, when the system is booted gmirror finds the
providers being out of sync, and it triggers itself to rebuild the
secondary provider from the primary.
This has been tested and proven on multiple systems for consistency.
A swapoff before shutdown does not eliminate the problem. I had to comment
out the swap.bde line from fstab, boot the system this way so that a bde
encrypted swap didn't get created/loaded and then the mirror stopped
rebuilding itself after reboot. Using GELI to encrypt the swap space
does not produce this problem.
Until this issue with GBDE and GMIRROR gets fixed, a note or comment
in the handbook should be placed, practically for both GBDE
"Chapter 18.17.3" and GMIRROR "Chapter 19.4 or 19.4.1", warning users
that using bde to encrypt swap inside a gmirror may produce this problem
and for the time being this can be quickly solved by using geli instead
Until gbde gets fixed, use geli to encrypt your swap space inside a gmirror.
How-To-Repeat: My systems had two physical disks of the same type. One single FreeBSD
slice spanning the entire disk, and separate partitions for /, swap,
/var, /tmp and /usr in this order. Only the swap space was encrypted.
Encryption and mirroring was set up according to the handbook and man
pages, no extra settings or options were used.
This does not sound i386-specific.