Problems with "ada0: Previously was known as ad6" functionality

From: Jason Edwards <sub.mesa_at_gmail.com>
Date: Tue, 25 Oct 2011 15:38:08 +0200
Hello list,

I'm working on ZFSguru, a FreeNAS-like distribution based on FreeBSD
that focuses on NAS or Network Attached Storage functionality,
sporting a web-interface et al.

I've been building FreeBSD 9.0-RC1, and put together a LiveCD using my
own scripts. It works, and boots fine in Virtualbox just like the
other LiveCDs. Though I discovered a problem.

It appears that some new functionality was put in 9.x to 'symlink' the
new 'ada' devices using AHCI driver to the old-fashioned 'ad' (ATA)
device names, probably to make migration of ATA to AHCI driver more
convenient for users still using hardcoded devices in /etc/fstab
(shame on you!). However, I suspect this is causing a nasty
side-effect, because after having created a GPT partition with a ZFS
pool on it, I cannot import it once I reboot fresh from the LiveCD,
with 'zpool import' showing a corrupt pool. I've seen this before and
generally it means that ZFS cannot read data or that GEOM does funny
things. In this case, it could be that ad6 and ada0 both contain the
same metadata, which somehow causes ZFS to go beserk.

I would like to debug this issue, but for that I need to disable the
'ada0 to ad6' symlinking functionality. I've searched for a sysctl
variable which can disable this behavior, but have not found it.
Anyone can enlighten me how I can disable this behavior, so that I
only get /dev/ada0 and no ad6? If the zpool import works again after
that change, this would confirm my suspicions that this behavior is
causing the zpool import command to fail.

I'm using FreeBSD 9.0-RC1 fetched this morning as RELENG_9, uname:
# uname -a
FreeBSD zfsguru.bsd 9.0-RC1 FreeBSD 9.0-RC1 #0: Tue Oct 25 07:13:52
UTC 2011     ssh_at_zfsguru:/usr/obj/usr/src/sys/GENERIC  amd64


Relevant command output:

# dmesg | grep ad
(..)
ada0: Previously was known as ad6

# ls -l /dev/ad*
lrwxr-xr-x  1 root  wheel            4 Oct 25 13:21 /dev/ad6 -> ada0
lrwxr-xr-x  1 root  wheel            6 Oct 25 13:21 /dev/ad6p1 -> ada0p1
crw-r-----  1 root  operator    0,  73 Oct 25 13:20 /dev/ada0
crw-r-----  1 root  operator    0,  75 Oct 25 13:20 /dev/ada0p1

# glabel status
                  Name  Status  Components
(..)
          gpt/testdisk     N/A  ada0p1

# zpool import
  pool: tank
    id: 17935188179790554412
 state: FAULTED
status: One or more devices contains corrupted data.
action: The pool cannot be imported due to damaged devices or data.
        The pool may be active on another system, but can be imported using
        the '-f' flag.
   see: http://www.sun.com/msg/ZFS-8000-5E
config:

        tank                    FAULTED  corrupted data
          15830803292687600194  UNAVAIL  corrupted data


Regards,
Jason / sub.mesa
Received on Tue Oct 25 2011 - 12:04:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:19 UTC