[HOW-TO] Re-install with GEOM_MIRROR for swap
-
Hi!
Just installed pfSense 2.4.2 on a new Firewall and chose to mirror the swap partition which resulted in a GEOM_MIRROR. Both ZFS and the swap are hosted on two SATA-DOM devices with ZFS in a MIRROR.
After some testing I wanted to re-install pfSense to make a clean installation, and when repartitioning the drives as a new ZFS mirror I I ended up with this:
https://imgur.com/a/zrU3X gpart: geom 'ada0': File existsWhatever I tried I didn't succeed to re-install because the GEOM_MIRROR was mounted during install.
So, how did I solve this?
I figured that I could hash out the mount in /etc/fstab, reboot and then destroy the GEOM_MIRROR withgmirror stop swap gmirror destroy swap
I then rebooted again from USB and successfully installed a new clean pfSense system.
So basically I did this:
1. Boot as normal
2. Press 8 to access shell
3. vi /etc/fstab
4. Comment out the /dev/mirrir/swap
5. Reboot
6. press 8 to access shell
7. gmirror stop swap && gmirror destroy swap
8. Reboot with USB
9. Re-installHope it helps someone out there.
TO THE DEVS
I think that you should automatically unmount any drives that are mounted in the installer to be able to skip the above steps. Please fix this "bug" in the upcoming releases. -
Thank you so much for posting! You helped me. I had to perform some additional steps and am also posting in case it helps another poor soul:
Setup: ZFS-Auto; RAID Type: Mirrored; Number of Drives: 2; Swap Mirrored: Yes; Other options left as default.
Problem: Attempting a fresh install of pfsense 2.4.3 on x86 hardware. Same error as reported by: enoch85 gpart: geom ‘ada0’: File exists
Same settings were used for the initial and then refresh install.
I learned that the problem is that I had to manually delete all of the existing ZFS partitions (why can't the installer do this?). Annoyingly, if you try to delete or destroy a mounted partition the error message gpart gives you is: Device busy, which is really unhelpful. I could delete the all partitions except for the swap ones (because the installer mounts them). Adding OPs commands resolved this for me. The full suite of commands I had to use to allow me to reinstall were:
gmirror stop swap gmirror destroy swap gpart delete -i1 ada0 gpart delete -i2 ada0 gpart delete -i3 ada0 gpart delete -i4 ada0 gpart delete -i1 ada1 gpart delete -i2 ada1 gpart delete -i3 ada1 gpart delete -i4 ada1 gpart destroy ada0 gpart destroy ada1
-
Just wanted to say THANK YOU for listing out these commands. Worked perfectly in fixing my "gpart: geom 'ada0': File exists" problem.
-
Created an account to just say THANK YOU SO MUCH!
Confirmed the above worked for me just like @stewarrh
-
Thx very much to both. Its my first installation in baremetall and fail.
I had created the mirror and encrypted the disks and the swap and the error "gpart: geom 'nvd0': File exists" appeared when trying to reinstall.
I have been able to delete the partitions.