summaryrefslogtreecommitdiffstats
path: root/scripts/zpool-config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-07-21 16:17:54 -0700
committerBrian Behlendorf <[email protected]>2009-07-21 16:17:54 -0700
commitb9c3c7a2f462febcbfdc6d8c0bc19be6ac6350c0 (patch)
tree1330d9f04b9bb7e1b4c3da02ca18f99941b50c99 /scripts/zpool-config
parent5753d78dcdf1b8bb4d86d4e39561db2778f5e4b8 (diff)
The losetup -f option is unavailable for SLES10 use unused_loop_device()
SLES10 ships util-linux-2.12r-35.30 which does not support the -f option to losetup. To avoid this problem the unused_loop_device() function was added which attempts to find an unused loop device by checking each /dev/loop* device with losetup to see if it is configured.
Diffstat (limited to 'scripts/zpool-config')
-rw-r--r--scripts/zpool-config/lo-raid0.sh2
-rw-r--r--scripts/zpool-config/lo-raid10.sh2
-rw-r--r--scripts/zpool-config/lo-raidz.sh2
-rw-r--r--scripts/zpool-config/lo-raidz2.sh2
4 files changed, 4 insertions, 4 deletions
diff --git a/scripts/zpool-config/lo-raid0.sh b/scripts/zpool-config/lo-raid0.sh
index 84c355266..36b3c4d62 100644
--- a/scripts/zpool-config/lo-raid0.sh
+++ b/scripts/zpool-config/lo-raid0.sh
@@ -11,7 +11,7 @@ DEVICES=""
zpool_create() {
for FILE in ${FILES}; do
- DEVICE=`/sbin/losetup -f`
+ DEVICE=`unused_loop_device`
msg "Creating ${FILE} using loopback device ${DEVICE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
diff --git a/scripts/zpool-config/lo-raid10.sh b/scripts/zpool-config/lo-raid10.sh
index 78004cc54..ce528004c 100644
--- a/scripts/zpool-config/lo-raid10.sh
+++ b/scripts/zpool-config/lo-raid10.sh
@@ -13,7 +13,7 @@ DEVICES_M2=""
zpool_create() {
for FILE in ${FILES_M1}; do
- DEVICE=`/sbin/losetup -f`
+ DEVICE=`unused_loop_device`
msg "Creating ${FILE} using loopback device ${DEVICE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
diff --git a/scripts/zpool-config/lo-raidz.sh b/scripts/zpool-config/lo-raidz.sh
index cac903646..616c364be 100644
--- a/scripts/zpool-config/lo-raidz.sh
+++ b/scripts/zpool-config/lo-raidz.sh
@@ -11,7 +11,7 @@ DEVICES=""
zpool_create() {
for FILE in ${FILES}; do
- DEVICE=`/sbin/losetup -f`
+ DEVICE=`unused_loop_device`
msg "Creating ${FILE} using loopback device ${DEVICE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
diff --git a/scripts/zpool-config/lo-raidz2.sh b/scripts/zpool-config/lo-raidz2.sh
index bd9a40ce5..dbd7d815e 100644
--- a/scripts/zpool-config/lo-raidz2.sh
+++ b/scripts/zpool-config/lo-raidz2.sh
@@ -11,7 +11,7 @@ DEVICES=""
zpool_create() {
for FILE in ${FILES}; do
- DEVICE=`/sbin/losetup -f`
+ DEVICE=`unused_loop_device`
msg "Creating ${FILE} using loopback device ${DEVICE}"
rm -f ${FILE} || exit 1
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||