zfsonlinux/zfs — pull request #2507 by behlendorf (2014-07-17 20:32:07+00:00)
Title: Relax MBR partition scanning requirement

When checking a whole disk to see if it can be safely added to
the pool a variety of checks are done. One of those checks is
to attempt to determine the partition information and scan all
the partitions for existing filesystems.

Since ZoL contains a EFI library this partition scanning is
easy to do for EFI partitioned disks. However, for non-EFI
parition disks (MBR/EBR) things are a bit harder. The lack of
a convenient library means non-EFI partitioned disks will not
have all their partitions checked. For this reason, the default
behavior was to require the force option. For example:

invalid vdev specification
use '-f' to override the following errors:
/dev/vdb does not contain an EFI label but it may contain partition
information in the MBR.

However in practice requiring the force option for this case is
counter-intuitively less safe. The reason is because only the first
error is returned. By passing the force option it will suppress
this first warning and potentially others you were not aware of.

Therefore this patch inverts the default behavior for non-EFI
formated disks (unformatted, MBR/EBR, etc). If no EFI table is
detected and there is no file system detected on the provided
block device. Then it will be assumed that block device is safe
to use.

Longer term it would be nice to see MBR/EBR scanning added to
the utilities. This should be fairly straight forward to do.

Signed-off-by: Brian Behlendorf