When attempting to create a zpool on a too small media (say, a 1.4MB 3.5" floppy), the error message is "cannot create 'poolname': no such pool or dataset" I'd expect an error message along the lines of 'underlying block device too small'. Steps to reproduce: 1) Have a floppy or other ridiculously small r/w media accessible on the system In this example, the floppy is /dev/da0. 2) Execute following commands to prepare media # gpart create -s gpt da0 da0 created # gpart add -t freebsd-zfs da0 da0p1 created # gpart show da0 => 40 2800 da0 GPT (1.4M) 40 2800 1 freebsd-zfs (1.4M) 3) Attempt to create pool # zpool create floppytest /dev/da0p1 cannot create 'floppytest': no such pool or dataset
Created attachment 186261 [details] truss output Attaching output of # truss zpool create floppytest da0p1. I think relevant output is towards the end, but I'm not too familiar with truss so including all of it.
I can reproduce this bug when using GEOM devices but not file-backed vdevs. I've got a pretty good idea what the problem is.
Code review in progress: https://reviews.freebsd.org/D12531
A commit references this bug: Author: asomers Date: Mon Oct 23 23:05:29 UTC 2017 New revision: 324940 URL: https://svnweb.freebsd.org/changeset/base/324940 Log: Fix the error message when creating a zpool on a too-small device Don't check for SPA_MINDEVSIZE in vdev_geom_attach when opening by path. It's redundant with the check in vdev_open, and failing to attach here results in the wrong error message being printed. However, still check for it in some other situations: * When opening by guids, so we don't get bogged down reading from slow devices like floppy drives. * In vdev_geom_read_pool_label for the same reason, because we iterate over all providers. * If the caller requests that we verify the guid, because then we'll have to read from the device before vdev_open verifies the size. PR: 222227 Reported by: Marie Helene Kvello-Aune <marieheleneka@gmail.com> Reviewed by: avg, mav MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D12531 Changes: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
A commit references this bug: Author: asomers Date: Tue Nov 28 16:34:56 UTC 2017 New revision: 326319 URL: https://svnweb.freebsd.org/changeset/base/326319 Log: MFC r324940: Fix the error message when creating a zpool on a too-small device Don't check for SPA_MINDEVSIZE in vdev_geom_attach when opening by path. It's redundant with the check in vdev_open, and failing to attach here results in the wrong error message being printed. However, still check for it in some other situations: * When opening by guids, so we don't get bogged down reading from slow devices like floppy drives. * In vdev_geom_read_pool_label for the same reason, because we iterate over all providers. * If the caller requests that we verify the guid, because then we'll have to read from the device before vdev_open verifies the size. PR: 222227 Reported by: Marie Helene Kvello-Aune <marieheleneka@gmail.com> Reviewed by: avg, mav Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D12531 Changes: _U stable/11/ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
A commit references this bug: Author: asomers Date: Mon Mar 5 20:43:43 UTC 2018 New revision: 330524 URL: https://svnweb.freebsd.org/changeset/base/330524 Log: MFC r324940: Fix the error message when creating a zpool on a too-small device Don't check for SPA_MINDEVSIZE in vdev_geom_attach when opening by path. It's redundant with the check in vdev_open, and failing to attach here results in the wrong error message being printed. However, still check for it in some other situations: * When opening by guids, so we don't get bogged down reading from slow devices like floppy drives. * In vdev_geom_read_pool_label for the same reason, because we iterate over all providers. * If the caller requests that we verify the guid, because then we'll have to read from the device before vdev_open verifies the size. PR: 222227 Reported by: Marie Helene Kvello-Aune <marieheleneka@gmail.com> Reviewed by: avg, mav Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D12531 Changes: _U stable/10/ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c