Mounting from zfs failed with error 22 with gmirror

Daniel Gerzo danger at FreeBSD.org
Mon Sep 16 13:10:06 UTC 2013


Hello Andriy,

I have applied your patch but unfortunately I cannot get much out of 
it.
Interestingly, when I built a custom, stripped down kernel, I could 
boot that box even with gmirror setup, however GENERIC fails with the 
mentioned error.

The stripped-down config looks like this:
cpu             HAMMER
ident           ALICE
makeoptions     DEBUG=-g                # Build kernel with gdb(1) 
debug symbols
options         SCHED_ULE               # ULE scheduler
options         PREEMPTION              # Enable kernel thread 
preemption
options         INET                    # InterNETworking
options         INET6                   # IPv6 communications protocols
options         TCP_OFFLOAD             # TCP offload
options         FFS                     # Berkeley Fast Filesystem
options         SOFTUPDATES             # Enable FFS soft updates 
support
options         UFS_ACL                 # Support for access control 
lists
options         UFS_DIRHASH             # Improve performance on big 
directories
options         UFS_GJOURNAL            # Enable gjournal-based UFS 
journaling
options         MD_ROOT                 # MD is a potential root device
options         NFSCL                   # New Network Filesystem Client
options         NFSD                    # New Network Filesystem Server
options         NFSLOCKD                # Network Lock Manager
options         NFS_ROOT                # NFS usable as /, requires 
NFSCL
options         MSDOSFS                 # MSDOS Filesystem
options         CD9660                  # ISO 9660 Filesystem
options         PROCFS                  # Process filesystem (requires 
PSEUDOFS)
options         PSEUDOFS                # Pseudo-filesystem framework
options         GEOM_PART_GPT           # GUID Partition Tables.
options         GEOM_LABEL              # Provides labelization
options         KTRACE                  # ktrace(1) support
options         STACK                   # stack(9) support
options         SYSVSHM                 # SYSV-style shared memory
options         SYSVMSG                 # SYSV-style message queues
options         SYSVSEM                 # SYSV-style semaphores
options         _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time 
extensions
options         PRINTF_BUFR_SIZE=128    # Prevent printf output being 
interspersed.
options         KBD_INSTALL_CDEV        # install a CDEV entry in /dev
options         KDTRACE_FRAME           # Ensure frames are compiled in
options         INCLUDE_CONFIG_FILE     # Include this file in kernel
options         KDB                     # Kernel debugger related code
options         KDB_TRACE               # Print a stack trace for a 
panic
options         DDB_CTF                 # kernel ELF linker loads CTF 
data
options         SMP                     # Symmetric MultiProcessor 
Kernel
device          cpufreq
device          acpi
device          pci
device          fdc
device          ahci            # AHCI-compatible SATA controllers
device          ata             # Legacy ATA/SATA controllers
options         ATA_CAM         # Handle legacy controllers with CAM
options         ATA_STATIC_ID   # Static device numbering
                                         # output.  Adds ~128k to 
driver.
                                         # output.  Adds ~215k to 
driver.
device          scbus           # SCSI bus (required for ATA/SCSI)
device          da              # Direct Access (disks)
device          pass            # Passthrough device (direct ATA/SCSI 
access)
device          atkbdc          # AT keyboard controller
device          atkbd           # AT keyboard
device          kbdmux          # keyboard multiplexer
device          vga             # VGA video card driver
options         VESA            # Add support for VESA BIOS Extensions 
(VBE)
device          splash          # Splash screen and screen saver 
support
device          sc
options         SC_PIXEL_MODE   # add support for the raster text mode
device          agp             # support several AGP chipsets
device          uart            # Generic UART driver
device          bxe             # Broadcom BCM57710/BCM57711/BCM57711E 
10Gb Ethernet
device          de              # DEC/Intel DC21x4x (``Tulip'')
device          em              # Intel PRO/1000 Gigabit Ethernet 
Family
device          igb             # Intel PRO/1000 PCIE Server Gigabit 
Family
device          ixgbe           # Intel PRO/10GbE PCIE Ethernet Family
device          le              # AMD Am7900 LANCE and Am79C9xx PCnet
device          ti              # Alteon Networks Tigon I/II gigabit 
Ethernet
device          txp             # 3Com 3cR990 (``Typhoon'')
device          vx              # 3Com 3c590, 3c595 (``Vortex'')
device          miibus          # MII bus support
device          re              # RealTek 8139C+/8169/8169S/8110S
device          loop            # Network loopback
device          random          # Entropy device
options         PADLOCK_RNG     # VIA Padlock RNG
options         RDRAND_RNG      # Intel Bull Mountain RNG
device          ether           # Ethernet support
device          vlan            # 802.1Q VLAN support
device          tun             # Packet tunnel.
device          pty             # BSD-style compatibility pseudo ttys
device          md              # Memory "disks"
device          gif             # IPv6 and IPv4 tunneling
device          faith           # IPv6-to-IPv4 relaying (translation)
device          firmware        # firmware assist module
device          bpf             # Berkeley packet filter
options         USB_DEBUG       # enable debug msgs
device          ehci            # EHCI PCI->USB interface (USB 2.0)
device          xhci            # XHCI PCI->USB interface (USB 3.0)
device          usb             # USB Bus (required)
device          ukbd            # Keyboard
device          umass           # Disks/Mass storage - Requires scbus 
and da
options         ACCEPT_FILTER_DATA
options         ACCEPT_FILTER_HTTP
options         ACCEPT_FILTER_DNS
options         GEOM_MIRROR
options         NULLFS
device          pf
device          pflog
makeoptions     MODULES_OVERRIDE="zfs opensolaris krpc"


When I built GENERIC kernel with your patch, I couldn't extract much 
info because for some reason the keyboard of my remote console doesn't 
work on 9.2, due to some USB bug :-(  and thus I couldn't paginate the 
screen output. Obviously, it didn't get logged, too.


On 2013-09-15 22:55, Andriy Gapon wrote:
> on 14/09/2013 22:53 Daniel Gerzo said the following:
>> The problem is that while I do not load geom_mirror from loader.conf, 
>> the
>> machine boots fine, however as soon as I enable gmirror in 
>> loader.conf the
>> machine doesn't boot and errors with
>> 
>> /Trying to mount root from zfs:sys/default/root [].../
>> 
>> /Mounting from zfs:sys/default/root failed with error 22.
>> /
>> 
>> 
>> and it hangs in the prompt asking me to enter device to mount root 
>> from.
>> 
>> I found only this
>> http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037910.html
>> email where avg@ mentions that it might be a bug in his code, but no 
>> further
>> followups. However that is almost a year ago and I got trapped by 
>> this on 9.2-RC4.
> 
> At that time there was a specific new change committed and I already 
> had a
> report about the kind of configurations that were broken by that 
> change.
> 
> So far, I have no idea what could cause your problem.
> 
> You may want to try the following diagnostic patch:
> http://people.freebsd.org/~avg/zfs-root-pool-config-debug.patch
> If your kernel configuration doesn't have INVARIANTS then you can 
> either add
> that or remove DEBUG check around the added code.
> Please enable verbose boot, set vfs.zfs.debug and 
> kern.geom.mirror.debug (in
> loader.conf or at its prompt) and try to capture any interesting geom 
> and ZFS
> related messages.

-- 
Kind regards
   Daniel


More information about the freebsd-fs mailing list