summaryrefslogtreecommitdiffstats
path: root/scripts/zconfig.sh
diff options
context:
space:
mode:
authorEric Dillmann <[email protected]>2013-02-14 00:11:59 +0100
committerBrian Behlendorf <[email protected]>2013-03-05 12:37:54 -0800
commit0b4d1b5853791e1e447d74f0b229800d65b53071 (patch)
tree9d908b32fb62c3f9549de128195bdf67c6d50a7e /scripts/zconfig.sh
parenta4430fce691d492aec382de0dfa937c05ee16500 (diff)
Add snapdev=[hidden|visible] dataset property
The new snapdev dataset property may be set to control the visibility of zvol snapshot devices. By default this value is set to 'hidden' which will prevent zvol snapshots from appearing under /dev/zvol/ and /dev/<dataset>/. When set to 'visible' all zvol snapshots for the dataset will be visible. This functionality was largely added because when automatic snapshoting is enabled large numbers of read-only zvol snapshots will be created. When creating these devices the kernel will attempt to read their partition tables, and blkid will attempt to identify any filesystems on those partitions. This leads to a variety of issues: 1) The zvol partition tables will be read in the context of the `modprobe zfs` for automatically imported pools. This is undesirable and should be done asynchronously, but for now reducing the number of visible devices helps. 2) Udev expects to be able to complete its work for a new block devices fairly quickly. When many zvol devices are added at the same time this is no longer be true. It can lead to udev timeouts and missing /dev/zvol links. 3) Simply having lots of devices in /dev/ can be aukward from a management standpoint. Hidding the devices your unlikely to ever use helps with this. Any snapshot device which is needed can be made visible by changing the snapdev property. NOTE: This patch changes the default behavior for zvols which was effectively 'snapdev=visible'. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1235 Closes #945 Issue #956 Issue #756
Diffstat (limited to 'scripts/zconfig.sh')
-rwxr-xr-xscripts/zconfig.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/zconfig.sh b/scripts/zconfig.sh
index 83a6fac22..141348c03 100755
--- a/scripts/zconfig.sh
+++ b/scripts/zconfig.sh
@@ -192,6 +192,7 @@ test_3() {
${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
${ZFS} create -V 100M ${FULL_ZVOL_NAME} || fail 3
+ ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME} || fail 3
label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
partition /dev/zvol/${FULL_ZVOL_NAME} primary 1% 50% || fail 4
partition /dev/zvol/${FULL_ZVOL_NAME} primary 51% -1 || fail 4
@@ -245,6 +246,7 @@ test_4() {
${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
${ZFS} create -V 100M ${FULL_ZVOL_NAME} || fail 3
+ ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME} || fail 3
label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
partition /dev/zvol/${FULL_ZVOL_NAME} primary 1% 50% || fail 4
partition /dev/zvol/${FULL_ZVOL_NAME} primary 51% -1 || fail 4
@@ -335,6 +337,7 @@ test_6() {
${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raid0 || fail 2
${ZFS} create -V 800M ${FULL_ZVOL_NAME} || fail 3
+ ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME} || fail 3
label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
partition /dev/zvol/${FULL_ZVOL_NAME} primary 1 -1 || fail 4
format /dev/zvol/${FULL_ZVOL_NAME}-part1 ext2 || fail 5
@@ -394,6 +397,7 @@ test_7() {
${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
${ZFS} create -V 300M ${FULL_ZVOL_NAME} || fail 3
+ ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME} || fail 3
label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
partition /dev/zvol/${FULL_ZVOL_NAME} primary 1 -1 || fail 4
format /dev/zvol/${FULL_ZVOL_NAME}-part1 ext2 || fail 5
@@ -481,6 +485,7 @@ test_8() {
${ZPOOL_CREATE_SH} -p ${POOL_NAME1} -c lo-raidz2 || fail 2
${ZPOOL_CREATE_SH} -p ${POOL_NAME2} -c lo-raidz2 || fail 2
${ZFS} create -V 300M ${FULL_ZVOL_NAME1} || fail 3
+ ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME1} || fail 3
label /dev/zvol/${FULL_ZVOL_NAME1} msdos || fail 4
partition /dev/zvol/${FULL_ZVOL_NAME1} primary 1 -1 || fail 4
format /dev/zvol/${FULL_ZVOL_NAME1}-part1 ext2 || fail 5