System reboot lost the /boot partition
-
Short and skinny. A power blip caused my custom pfSense box to reboot (intel PC) upon reboot it cannot find the /boot partition (on M2 drive). I loaded up the pfSense install iso on a usb drive with rufus, booted it and it can still see the config.xml as part of the recovery procedures. Now for the real problem.
I can't tell if or where the pfsense install is making a copy of config.xml to during the recovery process. I bought a new M2 drive and am just going to do a fresh install but need my config. Read that the config.xml needs to be in a Fat32 partition. But the pfsense iso image isn't Fat32, so I don't know if it ever made an actual copy. No big deal, I'll just boot an ubuntu live usb and mount and make a copy.
With ubuntu I cannot get the BSD partition slice to mount. In my Case it's on /dev/sda with the bsd partition being sda1 that contains ufs slices sda5(root) and sda6(swap). At least best I can tell. I did so many google searches about this that they're gonna start charging me per search.
I tried setting the correct offset, messing around with various options, etc. It always came back as bad magic number and failed to mount. I even tried testdisk to recover any missing partitions. It found about 7 missing partitions, all overlapping each other inside /dev/sda5, I have no idea why. But because of this I couldn't use testdisk to repair the partition table.
I even tried booting a live freebsd but it ended up being just the installer. As of this writing I'm trying nomadBSD to see if I can get the config.xml copied off but waiting for download to finish.
What we know:
- /boot partition is gone, unknown why, probably M2 drive failing.
- We have a new M2 drive to do a fresh install on but the config.xml is needed.
- It is apparently corrupted enough that ubuntu cannot read the drive properly.
- the pfSense installer seems to be able to find the config.xml and "make a copy" of it but unknown if it actually does.
- I can't do a fresh install until I get the config.xml off the old drive and swap in the new drive (only 1 M2 slot)
- testdisk is seeing multiple lost partitions and cannot recover from them. Overlapping like Start 63 End <some high number>, Start 63 End <some higher number>, Start 73 End <whatever> Start 79 End <whatever>, etc. Like the whole partition map is thrown off.
- I used the autobackup service, but since it's fire and forget, I have forgotten it for the better part of 6 months and have no known way of checking if I have any backups. I don't recall any notifications or errors the last 10 or so times I logged into the box though. I just don't want to trust that without being able to verify it.
So the question, what would be my next steps if nomadBSD doesn't work?
P.S.
I can't get the logs posted here because it's local to the console I'm working on. DMESG almost always says there is a bad magic number when mounting and doesn't offer any more insight than that it's probably a corrupted partition. -
If you boot the new Net Installer you can select the config to recover then drop to the shell and do what you like with it. At worst you can just cat it to the command line and copy/paste it from the console.
You should be able to do that with the legacy installer too if you just escape the installer after recovering the config. Or by dropping to the shell and trying to run the recovery script manually:
/root/recover_configxml.sh
.Steve