zfs/cmd/zpool
Brian Behlendorf a9977b37ca 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 GPT partitioned disks.  However, for non-GPT
partitioned disks (MBR/EBR) things are a bit harder.  The lack of
a convenient library means non-GPT 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 GPT 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-GPT
formated disks (unformatted, MBR/EBR, etc).  If no GPT 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.
However these days it's somewhat less critical because Linux
defaults to GPT partition tables for devices 2TB or larger.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2660
Closes #2274
2016-03-10 14:04:58 -08:00
..
.gitignore Add .gitignore files to exclude build products 2010-01-08 11:35:17 -08:00
Makefile.am Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
zpool_iter.c Fix gcc missing parenthesis warnings 2010-08-31 08:38:35 -07:00
zpool_main.c Require libblkid 2016-03-09 10:39:22 -08:00
zpool_util.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zpool_util.h cstyle: Resolve C style issues 2013-12-18 16:46:35 -08:00
zpool_vdev.c Relax MBR partition scanning requirement 2016-03-10 14:04:58 -08:00