Add port of FreeBSD 'volmode' property

The volmode property may be set to control the visibility of ZVOL
block devices.

This allow switching ZVOL between three modes:
   full - existing fully functional behaviour (default)
   dev  - hide partitions on ZVOL block devices
   none - not exposing volumes outside ZFS

Additionally the new zvol_volmode module parameter can be used to
control the default behaviour.

This functionality can be used, for instance, on "backup" pools to
avoid cluttering /dev with unneeded zd* devices.

Original-patch-by: mav <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>

FreeBSD-commit: https://github.com/freebsd/freebsd/commit/dd28e6bb
Closes #1796 
Closes #3438 
Closes #6233
This commit is contained in:
LOLi
2017-07-12 22:05:37 +02:00
committed by Brian Behlendorf
parent e19572e4cc
commit cf8738d853
14 changed files with 634 additions and 83 deletions
@@ -81,13 +81,13 @@ vfstab_dev=$(find_vfstab_dev)
if is_linux; then
partition_disk $SIZE $disk 7
cyl=$(get_endslice $disk $SLICE5)
set_partition $SLICE6 "$cyl" $SIZE1 $disk
log_must set_partition $SLICE6 "$cyl" $SIZE1 $disk
else
specified_dump_dev=${disk}${SLICE_PREFIX}${SLICE0}
saved_dump_dev=$(save_dump_dev)
cyl=$(get_endslice $disk $SLICE6)
set_partition $SLICE7 "$cyl" $SIZE1 $disk
log_must set_partition $SLICE7 "$cyl" $SIZE1 $disk
fi
create_pool "$TESTPOOL" "$pooldev1"