[zfs] Mounting from (...) failed with error 19

Xin LI delphij at delphij.net
Tue Oct 19 21:21:56 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 10/19/10 08:49, Marcel Moolenaar wrote:
> 
> On Oct 19, 2010, at 7:55 AM, Andrey V. Elsukov wrote:
> 
>> On 19.10.2010 09:03, Andrey V. Elsukov wrote:
>>>> 	Mounting from (...) failed with error 19
>>>>
>>>> On boot.  The system is using pure ZFS setup.  It seems that 19 means
>>>> ENODEV but according to the dmesg the device do exist.
>>>
>>> Yes, i have the same problem.
>>
>> I fixed it with attached patch.
> 
> Makes sense. "tank" (or its namesake) isn't a real device.
> Feel free to commit to unbreak things, but we may want to
> rethink this from a generality point of view. Listing
> exceptions doesn't scale and we now have 2 (the first was
> the empty device name as used by nfs, and now also zfs).
> 
> Good catch, BTW.

Yes good catch, it fixed the problem for me as well.

What about the attached patch?  I'm going to give it a swirl soon.  The
difference is that it tests whether dev begins with /dev/.

Note that I'm not quite convinced with this yet as we may want to wait
for the devices from a zpool be ready, which may also need some yielding
during boot.  A better way of solving this might be to register a
"watchlist" of devices (so that ZFS can register its vdev devices for
example) and have mountroot wait for that list?  Or perhaps a set of
EVENTHANDLER callback?

Cheers,
- -- 
Xin LI <delphij at delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iQEcBAEBCAAGBQJMvgvkAAoJEATO+BI/yjfBX/gIAIRnS4eQVBe/Zh6RrT8BjI91
J1r7wNz1AYXda2t4/RUVnPZYr97GG1quEewtgcxTxW2nkii1ZkftjMg6Ik4Gio6Y
AxNdjEB35tXqhVUV1oS8JS09ejZij2Y43SHxWxOkhUnFEmuhjK4+euM/+obpJ4Kl
AR61E/DYqwv/8bqhofknylroDsveN3Vhd1n7dK4s+e3YcmANnZxTCWcxroD7C2yb
gCH6TDZPDVKVbfyS73QFoyic2Jml5eK/dkmlLMRubP5qs5aIgy0P1zcjhvRrrgOf
bYLM3IUEbVhPSQnO8d2sDhXytgCI/s6p39rMdKPR3jrf2+UnW6IM46NvVkSaOP8=
=cAxC
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: sys/kern/vfs_mountroot.c
===================================================================
--- sys/kern/vfs_mountroot.c	(revision 214082)
+++ sys/kern/vfs_mountroot.c	(working copy)
@@ -713,8 +713,7 @@ parse_mount(char **conf)
 		goto out;
 	}
 
-	if (strcmp(fs, "zfs") != 0 && dev[0] != '\0' &&
-	    !parse_mount_dev_present(dev)) {
+	if ((strstr(dev, "/dev/") == dev) && !parse_mount_dev_present(dev)) {
 		printf("mountroot: waiting for device %s ...\n", dev);
 		delay = hz / 10;
 		timeout = root_mount_timeout * hz;


More information about the freebsd-current mailing list