[PATCH 22/35] fsadm: Add LVOL_PREFIX configuration option

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

 



This commit adds new configuration option LVOL_PREFIX which defines a
prefix for new logical volumes. The prefix will be concatenated with a
sequential number of the logical volume.

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

diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index a66abd1..63600eb 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -776,9 +776,9 @@ create() {
 		tmp=$(mktemp)
 		$LVM lvs $vgname --separator ' ' --noheadings > $tmp
 		for i in $(seq -w $MAX_VGS); do
-			$GREP -e " lvol${i} " $tmp &> /dev/null
+			$GREP -e " ${LVOL_PREFIX}${i} " $tmp &> /dev/null
 			if [ $? -ne 0 ]; then
-				name="lvol${i}"
+				name="${LVOL_PREFIX}${i}"
 				lvname="--name $name"
 				break;
 			fi
@@ -1285,12 +1285,14 @@ check() {
 
 set_default_config() {
 	[ -z "$DEFAULT_POOL" ] && DEFAULT_POOL="default_pool"
+	[ -z "$LVOL_PREFIX" ] && LVOL_PREFIX="lvol"
 }
 
 parse_config() {
 	for line in $(cat $1); do
 		case "$line" in
 		  "DEFAULT_POOL"*) DEFAULT_POOL=${line##*=} ;;
+		  "LVOL_PREFIX"*) LVOL_PREFIX=${line##*=} ;;
 		  "#"*) continue ;;
 		  *) error "Unknown value \"$line\" in configuration file"
 		esac
-- 
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