Project

General

Profile

Actions

Bug #9533

closed

XG-7100 FAT config restore not working post-install

Added by Clinton Cory over 5 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Category:
Backup / Restore
Target version:
Start date:
05/17/2019
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.4.4_2
Affected Architecture:

Description

With the recent pfSense releases, it's possible to restore a configuration by copying the config.xml to a FAT partition - in this instance, I'm using the third partition on the USB installer for this. This is true for 2.4.4_p3 as well.

Systems without an integrated switch that I've tested work without issue but the XG-7100 does not restore the config.xml on the FAT partition when booting with the USB drive present post-install. If I select the reboot option in the pfSense shell and select the R option to re-root, the config will restore without issue.

I suspect the issue may be that the switch isn't fully initialized yet when the recovery step occurs. Looking at the output during boot, it looks like the configuration is loaded, updated, and backups are checked after the USB drive is initialized and later on in the boot process, the switch, VLANs, and LAGG is configured - which makes me think the recovery config is rejected as invalid because the referenced items are not yet valid. The fact that re-rooting restores the recovery config without issue makes me suspect that the switch was already configured so the recovery config is considered valid. Otherwise perhaps the USB drive isn't initialized in time for the recovery to occur when first booting.

ugen0.2: <innostor USB 3.0> at usbus0
umass0 on uhub0
umass0: <innostor USB 3.0, class 0/0, rev 3.00/0.01, addr 1> on usbus0
da0 at umass-sim0 bus 0 scbus5 target 0 lun 0
da0: <IS917 innostor 1.00> Removable Direct Access SPC-4 SCSI device
da0: 400.000MB/s transfers
da0: 966MB (1978368 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>
...... done.
Initializing.................. done.
Starting device manager (devd)...done.
Loading configuration......done.
..................Updating configuration..............done.
Checking config backups consistency...done.
Setting up extended sysctls...done.
padlock0: No ACE support.
aesni0: <AES-CBC,AES-XTS,AES-GCM,AES-ICM> on motherboard
coretemp0: <CPU On-Die Thermal Sensors> on cpu0
coretemp1: <CPU On-Die Thermal Sensors> on cpu1
coretemp2: <CPU On-Die Thermal Sensors> on cpu2
coretemp3: <CPU On-Die Thermal Sensors> on cpu3
Setting timezone...done.
Configuring loopback interface...done.
Starting syslog...done.
Starting Secure Shell Services...done.
Configuring switch...done.
Setting up interfaces microcode...done.
Configuring loopback interface...done.
Creating wireless clone interfaces...done.
Configuring LAGG interfaces...done.
Configuring VLAN interfaces...done.
Loading configuration......done.
..................Updating configuration..............done.
Checking config backups consistency...done.

....
Configuring switch...done.
Actions #1

Updated by Steve Wheeler over 5 years ago

It looks to me like the USB drive is being detected and loaded after the ECL has run which why it does not see the config file to import.

ugen0.1: <0x8086 XHCI root HUB> at usbus0
uhub0: <0x8086 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
mmcsd0: 31GB <MMCHC BJTD4R 0.3 SN 7A64FE68 MFG 12/2017 by 21 0x0000> at mmc0 50.0MHz/8bit/65535-block
mmcsd0boot0: 4MB partion 1 at mmcsd0
mmcsd0boot1: 4MB partion 2 at mmcsd0
mmcsd0rpmb: 4MB partion 3 at mmcsd0
Trying to mount root from ufs:/dev/ufsid/5cdd93ec623831e2 [rw]...
Configuring crash dumps...
Using /dev/label/swap0 for dump device.
/dev/ufsid/5cdd93ec623831e2: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ufsid/5cdd93ec623831e2: clean, 6836730 free (2562 frags, 854271 blocks, 0.0% fragmentation)
Filesystems are clean, continuing...
Mounting filesystems...
Setting up memory disks...random: unblocking device.
 done.
Restoring contents of RAM disk store...uhub0: 8 ports with 8 removable, self powered
 done.

        __
 _ __  / _|___  ___ _ __  ___  ___
| '_ \| |_/ __|/ _ \ '_ \/ __|/ _ \
| |_) |  _\__ \  __/ | | \__ \  __/
| .__/|_| |___/\___|_| |_|___/\___|
|_|

Welcome to pfSense 2.4.4-RELEASE (Patch 3)...

No core dumps found.
...ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/ipsec /usr/local/lib/perl5/5.26/mach/CORE
32-bit compatibility ldconfig path:
done.
>>> Removing vital flag from lang/php72... done.
External config loader 1.0 is now starting... mmcsd0s1 mmcsd0s1a mmcsd0s1b
Launching the init system...Updating CPU Microcode...
CPU: Intel(R) Atom(TM) CPU C3558 @ 2.20GHz (2200.07-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x506f1  Family=0x6  Model=0x5f  Stepping=1
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x4ff8ebbf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,SDBG,CX16,xTPR,PDCM,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,RDRAND>
  AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
  AMD Features2=0x101<LAHF,Prefetch>
  Structured Extended Features=0x2294e283<FSGSBASE,TSCADJ,SMEP,ERMS,NFPUSG,MPX,PQE,RDSEED,SMAP,CLFLUSHOPT,PROCTRACE,SHA>
  Structured Extended Features3=0xac000400<IBPB,STIBP,ARCH_CAP,SSBD>
  XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES>
  IA32_ARCH_CAPS=0x69<RDCL_NO>
  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID,VID,PostIntr
  TSC: P-state invariant, performance statistics
Done.
ugen0.2: <innostor USB 3.0> at usbus0
umass0 on uhub0
umass0: <innostor USB 3.0, class 0/0, rev 2.10/0.01, addr 1> on usbus0
da0 at umass-sim0 bus 0 scbus5 target 0 lun 0
da0: <IS917 innostor 1.00> Removable Direct Access SPC-4 SCSI device
da0: 40.000MB/s transfers
da0: 966MB (1978368 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>
...... done.
Initializing.................. done.
Starting device manager (devd)...done.

It's unclear why it does not see that when it sees ugen0.1. Other systems load that before mountroot and hence the ECL sees anything on them.

Actions #2

Updated by Steve Wheeler about 5 years ago

Revisiting this after hitting it on another system. Adding the following to loader.conf (or loader.conf.local) allows the USB drive to be detected before the ECL runs:

kern.cam.boot_delay=10000

Resulting in:

uhub0: 8 ports with 8 removable, self powered
ugen0.2: <innostor USB 3.0> at usbus0
umass0 on uhub0
umass0: <innostor USB 3.0, class 0/0, rev 2.10/0.01, addr 1> on usbus0
da0 at umass-sim0 bus 0 scbus5 target 0 lun 0
da0: <IS917 innostor 1.00> Removable Direct Access SPC-4 SCSI device
da0: 40.000MB/s transfers
da0: 966MB (1978368 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>
Trying to mount root from ufs:/dev/ufsid/5cdd93ec623831e2 [rw]...
Configuring crash dumps...
Using /dev/label/swap0 for dump device.
/dev/ufsid/5cdd93ec623831e2: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ufsid/5cdd93ec623831e2: clean, 6787815 free (2863 frags, 848119 blocks, 0.0% fragmentation)
Filesystems are clean, continuing...
Mounting filesystems...
random: unblocking device.

        __
 _ __  / _|___  ___ _ __  ___  ___
| '_ \| |_/ __|/ _ \ '_ \/ __|/ _ \
| |_) |  _\__ \  __/ | | \__ \  __/
| .__/|_| |___/\___|_| |_|___/\___|
|_|

Welcome to pfSense 2.4.4-RELEASE (Patch 3)...

No core dumps found.
...ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/ipsec /usr/local/lib/perl5/5.26/mach/CORE
32-bit compatibility ldconfig path:
done.
>>> Removing vital flag from lang/php72... done.
External config loader 1.0 is now starting... da0s1 -> found config.xml
Backing up old configuration...
Restoring [da0s1] /tmp/mnt/cf/config.xml...
Nov 12 16:02:18 php-fpm[348]: /ecl.php: pfSense is restoring the configuration /tmp/mnt/cf/config.xml
Nov 12 16:02:18 php-fpm[348]: /ecl.php: New alert found: pfSense is restoring the configuration /tmp/mnt/cf/config.xml

Actions #3

Updated by Renato Botelho almost 5 years ago

  • Assignee set to Renato Botelho
  • Target version set to 2.4.5
Actions #4

Updated by Renato Botelho almost 5 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Added kern.cam.boot_delay to default loader.conf and also a script to set it during upgrade

Actions #5

Updated by Danilo Zrenjanin almost 5 years ago

I have tested both options:

- update to

2.4.5-RC (amd64)
built on Tue Feb 11 09:27:41 EST 2020
FreeBSD 11.3-STABLE

- fresh install of

2.4.5-RC (amd64)
built on Tue Feb 11 09:27:41 EST 2020
FreeBSD 11.3-STABLE

In both cases, it worked like a charm. I was able to restore a config.xml during fresh install and post-install.

The logs from the post-install procedure:

External config loader 1.0 is now starting... da0s1 -> found config.xml
Backing up old configuration...
Restoring [da0s1] /tmp/mnt/cf/config.xml...
Feb 12 11:11:35 php-fpm[348]: /ecl.php: pfSense is restoring the configuration /tmp/mnt/cf/config.xml
Feb 12 11:11:35 php-fpm[348]: /ecl.php: New alert found: pfSense is restoring the configuration /tmp/mnt/cf/config.xml
Cleaning up...

The logs of restoring config.xml during a fresh install

Looking for config.xml on da0s3: [found msdos] [config.xml on da0s3] [Copied config.xml file to recovery area] Done.

The Content of loader.conf

[2.4.5-RC][root@pfSense.localdomain]/boot: cat loader.conf
kern.ipc.nmbclusters="1000000" 
kern.ipc.nmbjumbop="524288" 
kern.ipc.nmbjumbo9="524288" 
kern.cam.boot_delay=10000
boot_serial="YES" 
console="comconsole" 
comconsole_speed="115200" 
hint.mdio.0.at="ix2" 
hint.e6000sw.0.addr=0
hint.e6000sw.0.is8190=1
hint.e6000sw.0.port0disabled=1
hint.e6000sw.0.port9cpu=1
hint.e6000sw.0.port10cpu=1
hint.e6000sw.0.port9speed=2500
hint.e6000sw.0.port10speed=2500
hw.e6000sw.default_disabled=1
autoboot_delay="3" 
hw.usb.no_pf="1" 
Actions #6

Updated by Jim Pingle almost 5 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF