OPNsense Forum

Archive => 18.1 Legacy Series => Topic started by: incirrata on February 27, 2018, 08:31:46 pm

Title: Mounting from ufs:/dev/gpt/rootfs failed with error 19.
Post by: incirrata on February 27, 2018, 08:31:46 pm
I've managed to get the serial installer working on my troublesome Netgate XG-2758, but I've encountered a lot of bsdlabel and mounting errors during and after install; I'm not very familiar with BSD or GEOM and am not sure what to do about this. I am using the 18.1 serial installer now, but have had the same problems with the 17.7 installer too. The only way I can complete the installation is to use the Guided install -> GPT/UEFI method; anything else results in bsdlabel errors. Choosing Guided install -> MBR produces this error:

Code: [Select]
/sbin/bsdlabel -B -r -w ada0s1
auto FAILED with a return code of 1.

Viewing the log returns the following:

Code: [Select]
  x BSD Installer started                                                    a
  x DFUI connection on tcp:9999 successfully established                     a
  x ,- opened pty to '/sbin/sysctl -n hw.physmem'                            a
  x < 17138442240                                                            a
  x `- closed pty to '/sbin/sysctl -n hw.physmem'                            a
  x `/sbin/sysctl -n hw.physmem` returned: 17138442240                       a
  x ,- opened pty to '/sbin/sysctl -n kern.disks'                            a
  x < da0 ada1 ada0                                                          a
  x `- closed pty to '/sbin/sysctl -n kern.disks'                            a
  x `/sbin/sysctl -n kern.disks` returned: da0 ada1 ada0                     a
  x /dev/mirror exists. Surveying.                                           a
  x ,- opened pty to '/usr/bin/find /dev/mirror/* | /usr/bin/sed             a
  x "s/\/dev\/mirror/mirror/"'                                               a
  x < mirror/OPNsenseMirror                                                  a
  x `- closed pty to '/usr/bin/find /dev/mirror/* | /usr/bin/sed             a
  x "s/\/dev\/mirror/mirror/"'                                               a
  x `/usr/bin/find /dev/mirror/* | /usr/bin/sed "s/\/dev\/mirror/mirror/"`   a
  x returned: mirror/OPNsenseMirror                                          a
  x Testing mirror/OPNsenseMirror                                            a
  x Invoking survey for mirror/OPNsenseMirror                                a
  x Surveying Disk: mirror/OPNsenseMirror ...                                a
  x | Media sector size is 512                                               a
  x | Warning: BIOS sector numbering starts with sector 1                    a
  x | Information from DOS bootblock is:                                     a
  x | The data for partition 1 is:                                           a
  x | sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)                               a
  x | start 63, size 234441585 (114473 Meg), flag 80 (active)                a
  x | beg: cyl 0/ head 1/ sector 1;                                          a
  x | end: cyl 132/ head 15/ sector 63                                       a
  x | The data for partition 2 is:                                           a
  x | <UNUSED>                                                               a
  x | The data for partition 3 is:                                           a
  x | <UNUSED>                                                               a
  x | The data for partition 4 is:                                           a
  x | <UNUSED>                                                               a
  x `->>> Exit status: 0                                                     a
  x ,-<<< Executing `/sbin/bsdlabel -B -r -w ada0s1 auto'                    a
  x | bsdlabel: unable to get correct path for ada0s1: No such file or       a
  x directory                                                                a
  x `->>> Exit status: 1                                                     a

When this happens, it becomes impossible to leave the installer without rebooting as far as I know. <Retry> and <Cancel> will immediately display the same error again; <Skip> will cycle through a few more errors until it comes back to the original. The Manual install option also produces this error, but the <Cancel> option allows you to go back and choose other options. That being said, I was able to install GPT/UEFI on both ada0 and ada1 using the Guided install, and created an OPNsense GEOM mirror using ada0 as the primary and ada1 as the secondary. When booting the system, however, I get the following error:

Code: [Select]
mountroot: waiting for device /dev/gpt/rootfs...
Mounting from ufs:/dev/gpt/rootfs failed with error 19.

Typing "?" at the resulting mountroot prompt gives me four options: mirror/OPNsenseMirror, mirror/pfSenseMirror, ada1 and ada0. I am not sure how to remove the pfSenseMirror, but entering "ufs:/dev/mirror/OPNsenseMirror" produces this error:

Code: [Select]
Mounting from ufs:/dev/mirror/OPNsenseMirror failed with error 22.
The other devices listed present the same error. How can I mount one of these filesystems and get the system working normally?

EDIT: Figured it out. You're supposed to wipe the drives, create the GEOM mirror BEFORE installing OPNsense on either drive, then select mirror/OPNSenseMirror as the device to install to. DO NOT try to install OPNsense on ada0 and/or ada1 THEN create the mirror. Then it should just work!
Title: Re: Mounting from ufs:/dev/gpt/rootfs failed with error 19.
Post by: franco on February 28, 2018, 07:25:32 am
Some people reported that FreeBSD is not capable of clearing the disk completely all the time. It looks like there is  remnant data on that disk that could be properly from a different machine with e.g. Linux and dd.


Cheers,
Franco
Title: Re: Mounting from ufs:/dev/gpt/rootfs failed with error 19.
Post by: incirrata on March 02, 2018, 10:36:25 pm
I was able to wipe the XG-2758's SSDs today and started the OPNsense installer from scratch. While the mirror/pfSenseMirror is now gone, I'm still getting the same mountroot prompt. Am I doing something wrong with selecting ada0 as the primary and ada1 as the secondary when setting up the GEOM mirror? Am I supposed to set the GEOM mirror before I install OPNsense on the SSDs?
Title: Re: Mounting from ufs:/dev/gpt/rootfs failed with error 19.
Post by: franco on March 05, 2018, 08:36:56 am
Honestly, I don't know what it's doing. It should just work.

I don't have such a system to poke at it.


Cheers,
Franco
Title: Re: Mounting from ufs:/dev/gpt/rootfs failed with error 19.
Post by: incirrata on March 05, 2018, 06:04:27 pm
I tried wiping the SSDs and installing OPNsense from scratch again, and this time it worked! The difference? I didn't set up GEOM this time. I am going to try to research GEOM because I do not really understand it, but the OPNsense installer GEOM configuration utility is very straightforward so I'm not sure how I could have messed it up...

EDIT: I was also able to install under MBR with no problems after wiping the drives. Unfortunately installing both drives under MBR then setting up GEOM from the installer still takes me to mountroot on boot, so there is still something left to solve.
Title: Re: Mounting from ufs:/dev/gpt/rootfs failed with error 19.
Post by: incirrata on March 07, 2018, 11:36:01 pm
Franco was right - it does "just work", if you have a basic understanding of GEOM (which I did not). The fix is included in an edit to the OP. What you want to do is wipe the drives, create the GEOM mirror, then install OPNsense to the GEOM mirror device. You're not supposed to install OPNsense on ada0 or ada1!