[PATCH 09/35] fsadm: Specify number of stripes when no device is given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We should force user to specify number of stripes, (devices to be used)
if no device is specified on the command line when creating a new
volume.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 scripts/fsadm.sh |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index d42b759..f368f96 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -514,6 +514,7 @@ create() {
 			"name"*) name=${i##*=} ;;
 			"fstyp"* | "fs"*) fstyp=${i##*=} ;;
 			"size"*) size=${i##*=} ;;
+			"stripes"*) stripes=${i##*=} ;;
 			*) if [ -z $vg ]; then vgname=$i; else
 				error "Wrong option $i. (see: $TOOL --help)"
 			   fi ;;
@@ -582,9 +583,22 @@ create() {
 	[ -z "$vgname" ] && error "No suitable name for volume group found."
 
 	if [ "$stripesize" ]; then
+		if [ -z "$devices" ] && [ -z "$stripes" ]; then
+			error "Chunk size specified ($stripesize), but " \
+				"neither devices, nor number of stripes " \
+				"has been provided"
+		fi
 		striped="-i $devcount -I $stripesize"
 	fi
 
+	if [ "$stripes" ]; then
+		if [ -z "$stripesize" ]; then
+			error "Number of stripes specified, but chunk size " \
+				"has not been provided"
+		fi
+		striped="-i $stripes -I $stripesize"
+	fi
+
 	if [ "$name" ]; then
 		lvname="--name $name"
 	else
-- 
1.7.4.4

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux