public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW scripts/lvm_dump.sh
@ 2008-08-28 10:40 mbroz
  0 siblings, 0 replies; 9+ messages in thread
From: mbroz @ 2008-08-28 10:40 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2008-08-28 10:40:44

Modified files:
	.              : WHATS_NEW 
	scripts        : lvm_dump.sh 

Log message:
	Fix lvmdump metadata gather option (-m) to work correctly. (Jaroslav Stava)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.947&r2=1.948
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=1.12&r2=1.13

--- LVM2/WHATS_NEW	2008/08/16 09:46:55	1.947
+++ LVM2/WHATS_NEW	2008/08/28 10:40:44	1.948
@@ -1,5 +1,6 @@
 Version 2.02.40 - 
 ================================
+  Fix lvmdump metadata gather option (-m) to work correctly.
   Fix allocation bug in text metadata format write error path.
   Fix vgcfgbackup to properly check filename if template is used.
   configure aborts if lcov or genhtml are missing with --enable-profiling
--- LVM2/scripts/lvm_dump.sh	2007/10/03 15:00:51	1.12
+++ LVM2/scripts/lvm_dump.sh	2008/08/28 10:40:44	1.13
@@ -206,7 +206,7 @@
 
 	pvs="$("$LVM" pvs --separator , --noheadings --units s --nosuffix -o \
 	    name,pe_start 2>> "$log" | $SED -e 's/^ *//')"
-	for line in "$pvs"
+	for line in $pvs
 	do
 		test -z "$line" && continue
 		pv="$(echo $line | $CUT -d, -f1)"


^ permalink raw reply	[flat|nested] 9+ messages in thread

* LVM2 ./WHATS_NEW scripts/lvm_dump.sh
@ 2009-01-06 18:03 mbroz
  0 siblings, 0 replies; 9+ messages in thread
From: mbroz @ 2009-01-06 18:03 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-01-06 18:02:58

Modified files:
	.              : WHATS_NEW 
	scripts        : lvm_dump.sh 

Log message:
	Fix lvmdump /sys listing to include virtual devices directory.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1015&r2=1.1016
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=1.13&r2=1.14

--- LVM2/WHATS_NEW	2008/12/22 09:04:35	1.1015
+++ LVM2/WHATS_NEW	2009/01/06 18:02:57	1.1016
@@ -1,5 +1,6 @@
 Version 2.02.44 - 
 ====================================
+  Fix lvmdump /sys listing to include virtual devices directory.
   Add "--refresh" functionality to vgchange and vgmknodes.
   Check for maximal LV size when wiping device.
   Calculate mirror log size instead of using 1 extent.
--- LVM2/scripts/lvm_dump.sh	2008/08/28 10:40:44	1.13
+++ LVM2/scripts/lvm_dump.sh	2009/01/06 18:02:58	1.14
@@ -197,7 +197,8 @@
 log "$LS -laR /dev > \"$dir/dev_listing\" 2>> \"$log\""
 
 myecho "Gathering /sys/block listing..."
-log "$LS -laR /sys/block > \"$dir/sysblock_listing\""
+log "$LS -laR /sys/block > \"$dir/sysblock_listing\"  2>> \"$log\""
+log "$LS -laR /sys/devices/virtual/block >> \"$dir/sysblock_listing\"  2>> \"$log\""
 
 if (( $metadata )); then
 	myecho "Gathering LVM metadata from Physical Volumes..."


^ permalink raw reply	[flat|nested] 9+ messages in thread

* LVM2 ./WHATS_NEW scripts/lvm_dump.sh
@ 2007-10-02 16:09 mornfall
  0 siblings, 0 replies; 9+ messages in thread
From: mornfall @ 2007-10-02 16:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2007-10-02 16:09:46

Modified files:
	.              : WHATS_NEW 
	scripts        : lvm_dump.sh 

Log message:
	Fix underquotations in lvm_dump.sh.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.715&r2=1.716
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=1.10&r2=1.11

--- LVM2/WHATS_NEW	2007/10/02 15:48:57	1.715
+++ LVM2/WHATS_NEW	2007/10/02 16:09:46	1.716
@@ -1,6 +1,7 @@
 Version 2.02.29 -
 ==================================
   Fix a bug in lvm_dump.sh checks for lvm/dmsetup binaries.
+  Fix underquotations in lvm_dump.sh.
   Refactor lvcreate stripe and mirror parameter validation.
   All tools: print --help output to stdout, not stderr.
   After a diagnostic, suggest --help, rather than printing all --help output.
--- LVM2/scripts/lvm_dump.sh	2007/10/02 15:48:58	1.10
+++ LVM2/scripts/lvm_dump.sh	2007/10/02 16:09:46	1.11
@@ -91,11 +91,11 @@
 
 myecho() {
 	echo "$@"
-	echo "$@" >> $log
+	echo "$@" >> "$log"
 }
 
 log() {
-	echo "$@" >> $log
+	echo "$@" >> "$log"
 	eval "$@"
 }
 
@@ -107,19 +107,19 @@
 	myecho "Gathering LVM volume info..."
 
 	myecho "  vgscan..."
-	log "$LVM vgscan -vvvv > $dir/vgscan 2>&1"
+	log "\"$LVM\" vgscan -vvvv > \"$dir/vgscan\" 2>&1"
 
 	myecho "  pvscan..."
-	log "$LVM pvscan -v >> $dir/pvscan 2>> $log"
+	log "\"$LVM\" pvscan -v >> \"$dir/pvscan\" 2>> \"$log\""
 
 	myecho "  lvs..."
-	log "$LVM lvs -a -o +devices >> $dir/lvs 2>> $log"
+	log "\"$LVM\" lvs -a -o +devices >> \"$dir/lvs\" 2>> \"$log\""
 
 	myecho "  pvs..."
-	log "$LVM pvs -a -v > $dir/pvs 2>> $log"
+	log "\"$LVM\" pvs -a -v > \"$dir/pvs\" 2>> \"$log\""
 
-	echo "  vgs..."
-	log "$LVM vgs -v > $dir/vgs 2>> $log"
+	myecho "  vgs..."
+	log "\"$LVM\" vgs -v > \"$dir/vgs\" 2>> \"$log\""
 fi
 
 if (( $clustered )); then
@@ -129,7 +129,7 @@
 	for i in nodes status services; do
 		cap_i=$(echo $i|tr a-z A-Z)
 		printf "$cap_i:\n----------------------------------\n"
-		log "cman_tool $i 2>> $log"
+		log "cman_tool $i 2>> \"$log\""
 		echo
 	done
 
@@ -161,50 +161,50 @@
 fi
 
 myecho "Gathering LVM & device-mapper version info..."
-echo "LVM VERSION:" > $dir/versions
-"$LVM" lvs --version >> $dir/versions 2>> $log
-echo "DEVICE MAPPER VERSION:" >> $dir/versions
-"$DMSETUP" --version >> $dir/versions 2>> $log
-echo "KERNEL VERSION:" >> $dir/versions
-"$UNAME" -a >> $dir/versions 2>> $log
-echo "DM TARGETS VERSIONS:" >> $dir/versions
-"$DMSETUP" targets >> $dir/versions 2>> $log
+echo "LVM VERSION:" > "$dir/versions"
+"$LVM" lvs --version >> "$dir/versions" 2>> "$log"
+echo "DEVICE MAPPER VERSION:" >> "$dir/versions"
+"$DMSETUP" --version >> "$dir/versions" 2>> "$log"
+echo "KERNEL VERSION:" >> "$dir/versions"
+"$UNAME" -a >> "$dir/versions" 2>> "$log"
+echo "DM TARGETS VERSIONS:" >> "$dir/versions"
+"$DMSETUP" targets >> "$dir/versions" 2>> "$log"
 
 myecho "Gathering dmsetup info..."
-log "$DMSETUP info -c > $dir/dmsetup_info 2>> $log"
-log "$DMSETUP table > $dir/dmsetup_table 2>> $log"
-log "$DMSETUP status > $dir/dmsetup_status 2>> $log"
+log "\"$DMSETUP\" info -c > \"$dir/dmsetup_info\" 2>> \"$log\""
+log "\"$DMSETUP\" table > \"$dir/dmsetup_table\" 2>> \"$log\""
+log "\"$DMSETUP\" status > \"$dir/dmsetup_status\" 2>> \"$log\""
 
 myecho "Gathering process info..."
-log "$PS alx > $dir/ps_info 2>> $log"
+log "$PS alx > \"$dir/ps_info\" 2>> \"$log\""
 
 myecho "Gathering console messages..."
-log "$TAIL -n 75 /var/log/messages > $dir/messages 2>> $log"
+log "$TAIL -n 75 /var/log/messages > \"$dir/messages\" 2>> \"$log\""
 
 myecho "Gathering /etc/lvm info..."
-log "$CP -a /etc/lvm $dir/lvm 2>> $log"
+log "$CP -a /etc/lvm \"$dir/lvm\" 2>> \"$log\""
 
 myecho "Gathering /dev listing..."
-log "$LS -laR /dev > $dir/dev_listing 2>> $log"
+log "$LS -laR /dev > \"$dir/dev_listing\" 2>> \"$log\""
 
 myecho "Gathering /sys/block listing..."
-log "$LS -laR /sys/block > $dir/sysblock_listing"
+log "$LS -laR /sys/block > \"$dir/sysblock_listing\""
 
 if (( $metadata )); then
 	myecho "Gathering LVM metadata from Physical Volumes..."
 
-	log "$MKDIR -p $dir/metadata"
+	log "$MKDIR -p \"$dir/metadata\""
 
-	pvs="$($LVM pvs --separator , --noheadings --units s --nosuffix -o \
-	    name,pe_start 2>> $log | $SED -e 's/^ *//')"
+	pvs="$("$LVM" pvs --separator , --noheadings --units s --nosuffix -o \
+	    name,pe_start 2>> "$log" | $SED -e 's/^ *//')"
 	for line in "$pvs"
 	do
 		test -z "$line" && continue
 		pv="$(echo $line | $CUT -d, -f1)"
 		pe_start="$(echo $line | $CUT -d, -f2)"
-		name="$($BASENAME $pv)"
+		name="$($BASENAME "$pv")"
 		myecho "  $pv"
-		log "$DD if=$pv of=$dir/metadata/$name bs=512 count=$pe_start 2>> $log"
+		log "$DD if=$pv \"of=$dir/metadata/$name\" bs=512 count=$pe_start 2>> \"$log\""
 	done
 fi
 
@@ -212,8 +212,8 @@
 	lvm_dump="$dirbase.tgz"
 	myecho "Creating report tarball in $HOME/$lvm_dump..."
 	cd "$HOME"
-	"$TAR" czf $lvm_dump $dirbase 2>/dev/null
-	"$RM" -rf $dir
+	"$TAR" czf "$lvm_dump" "$dirbase" 2>/dev/null
+	"$RM" -rf "$dir"
 fi
 
 if test "$UID" != "0" && test "$EUID" != "0"; then


^ permalink raw reply	[flat|nested] 9+ messages in thread

* LVM2 ./WHATS_NEW scripts/lvm_dump.sh
@ 2007-10-02 15:48 mornfall
  0 siblings, 0 replies; 9+ messages in thread
From: mornfall @ 2007-10-02 15:48 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2007-10-02 15:48:58

Modified files:
	.              : WHATS_NEW 
	scripts        : lvm_dump.sh 

Log message:
	Fix a bug in lvm_dump.sh checks for lvm/dmsetup binaries quote the
	invocations a bit more (although i'm fairly sure there are still
	quotes missing somewhere due to the eval in log).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.714&r2=1.715
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=1.9&r2=1.10

--- LVM2/WHATS_NEW	2007/09/24 13:25:31	1.714
+++ LVM2/WHATS_NEW	2007/10/02 15:48:57	1.715
@@ -1,5 +1,6 @@
 Version 2.02.29 -
 ==================================
+  Fix a bug in lvm_dump.sh checks for lvm/dmsetup binaries.
   Refactor lvcreate stripe and mirror parameter validation.
   All tools: print --help output to stdout, not stderr.
   After a diagnostic, suggest --help, rather than printing all --help output.
--- LVM2/scripts/lvm_dump.sh	2007/08/20 20:55:29	1.9
+++ LVM2/scripts/lvm_dump.sh	2007/10/02 15:48:58	1.10
@@ -17,7 +17,7 @@
 #           the debugging of lvm issues.
 
 # following external commands are used throughout the script
-# which, echo and test are internal in bash at least
+# echo and test are internal in bash at least
 MKDIR=mkdir # need -p
 TAR=tar # need czf
 RM=rm # need -rf
@@ -43,12 +43,8 @@
     exit $code
 }
 
-# which should error out if the binary is not executable, although i
-# am not sure we can rely on this
-which $LVM >& /dev/null || die 2 "Fatal: could not find lvm binary '$LVM'"
-test -x `which $LVM` || die 2 "Fatal: lvm binary '$LVM' not executable"
-which $DMSETUP >& /dev/null || die 2 "Fatal: could not find dmsetup binary '$DMSETUP'"
-test -x `which $DMSETUP` || die 2 "Fatal: dmsetup binary '$DMSETUP' not executable"
+"$LVM" version >& /dev/null || die 2 "Could not run lvm binary '$LVM'"
+"$DMSETUP" help >& /dev/null || die 2 "Fatal: could not run dmsetup binary '$DMSETUP'"
 
 function usage {
 	echo "$0 [options]"
@@ -166,13 +162,13 @@
 
 myecho "Gathering LVM & device-mapper version info..."
 echo "LVM VERSION:" > $dir/versions
-$LVM lvs --version >> $dir/versions 2>> $log
+"$LVM" lvs --version >> $dir/versions 2>> $log
 echo "DEVICE MAPPER VERSION:" >> $dir/versions
-$DMSETUP --version >> $dir/versions 2>> $log
+"$DMSETUP" --version >> $dir/versions 2>> $log
 echo "KERNEL VERSION:" >> $dir/versions
-$UNAME -a >> $dir/versions 2>> $log
+"$UNAME" -a >> $dir/versions 2>> $log
 echo "DM TARGETS VERSIONS:" >> $dir/versions
-$DMSETUP targets >> $dir/versions 2>> $log
+"$DMSETUP" targets >> $dir/versions 2>> $log
 
 myecho "Gathering dmsetup info..."
 log "$DMSETUP info -c > $dir/dmsetup_info 2>> $log"
@@ -215,9 +211,9 @@
 if test -z "$userdir"; then
 	lvm_dump="$dirbase.tgz"
 	myecho "Creating report tarball in $HOME/$lvm_dump..."
-	cd $HOME
-	$TAR czf $lvm_dump $dirbase 2>/dev/null
-	$RM -rf $dir
+	cd "$HOME"
+	"$TAR" czf $lvm_dump $dirbase 2>/dev/null
+	"$RM" -rf $dir
 fi
 
 if test "$UID" != "0" && test "$EUID" != "0"; then


^ permalink raw reply	[flat|nested] 9+ messages in thread

* LVM2 ./WHATS_NEW scripts/lvm_dump.sh
@ 2007-08-09  9:53 pcaulfield
  0 siblings, 0 replies; 9+ messages in thread
From: pcaulfield @ 2007-08-09  9:53 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2007-08-09 09:53:33

Modified files:
	.              : WHATS_NEW 
	scripts        : lvm_dump.sh 

Log message:
	Add more cluster/clvmd information to lvmdump

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.679&r2=1.680
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=1.6&r2=1.7

--- LVM2/WHATS_NEW	2007/08/07 09:06:04	1.679
+++ LVM2/WHATS_NEW	2007/08/09 09:53:33	1.680
@@ -1,5 +1,6 @@
 Version 2.02.28 -
 ================================
+  Add more cluster info to lvmdump
   Add const attributes where possible, first cut.
   Add support for renaming mirrored LVs.
   Factor out core of lvrename() to lv_rename lvm library function.
--- LVM2/scripts/lvm_dump.sh	2007/07/02 20:18:38	1.6
+++ LVM2/scripts/lvm_dump.sh	2007/08/09 09:53:33	1.7
@@ -116,15 +116,45 @@
 
 if (( $clustered )); then
 	myecho "Gathering cluster info..."
+	echo "NODES: " > $dir/cluster_info
+	echo "----------------------------------" >> $dir/cluster_info
+	log "cman_tool nodes >> $dir/cluster_info 2>> $log"
+	echo " " >> $dir/cluster_info
+
 	echo "STATUS: " > $dir/cluster_info
 	echo "----------------------------------" >> $dir/cluster_info
 	log "cman_tool status >> $dir/cluster_info 2>> $log"
-	echo " " >> $dir/lvm_info
+	echo " " >> $dir/cluster_info
 
 	echo "SERVICES: " >> $dir/cluster_info
 	echo "----------------------------------" >> $dir/cluster_info
 	log "cman_tool services >> $dir/cluster_info 2>> $log"
-	echo " " >> $dir/lvm_info
+	echo " " >> $dir/cluster_info
+
+	echo "LOCKS: "  >> $dir/cluster_info
+	echo "----------------------------------" >> $dir/cluster_info
+	if [ -f /proc/cluster/dlm_locks ]
+	then
+		echo "clvmd" > /proc/cluster/dlm_locks
+		cat /proc/cluster/dlm_locks >> $dir/cluster_info
+		echo " " >> $dir/cluster_info
+		echo "RESOURCE DIR: "  >> $dir/cluster_info
+		cat /proc/cluster/dlm_dir >> $dir/cluster_info
+		echo " " >> $dir/cluster_info
+		echo "DEBUG LOG: "  >> $dir/cluster_info
+		cat /proc/cluster/dlm_debug >> $dir/cluster_info
+		echo " " >> $dir/cluster_info
+	fi
+	if [ -f /debug/dlm/clvmd ]
+	then
+		cat /debug/dlm/clvmd >> $dir/cluster_info
+		echo " " >> $dir/cluster_info
+		echo "WAITERS: "  >> $dir/cluster_info
+		cat /debug/dlm/clvmd_waiters >> $dir/cluster_info
+		echo " " >> $dir/cluster_info
+		echo "MASTER: "  >> $dir/cluster_info
+		cat /debug/dlm/clvmd_master >> $dir/cluster_info
+	fi
 fi
 
 myecho "Gathering LVM & device-mapper version info..."


^ permalink raw reply	[flat|nested] 9+ messages in thread

* LVM2 ./WHATS_NEW scripts/lvm_dump.sh
@ 2007-07-02 20:18 mbroz
  0 siblings, 0 replies; 9+ messages in thread
From: mbroz @ 2007-07-02 20:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2007-07-02 20:18:38

Modified files:
	.              : WHATS_NEW 
	scripts        : lvm_dump.sh 

Log message:
	Add kernel and device-mapper targets versions report to lvmdump.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.644&r2=1.645
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6

--- LVM2/WHATS_NEW	2007/07/02 11:17:20	1.644
+++ LVM2/WHATS_NEW	2007/07/02 20:18:38	1.645
@@ -1,5 +1,6 @@
 Version 2.02.27 - 
 ================================
+  Add kernel and device-mapper targets versions report to lvmdump.
   Don't use index and rindex functions marked by SUSv3 as legacy.
   Fix vgsplit if splitting all PVs from VG.
   Fix lvmdiskscan volume reporting when run in the lvm shell
--- LVM2/scripts/lvm_dump.sh	2007/04/25 14:49:27	1.5
+++ LVM2/scripts/lvm_dump.sh	2007/07/02 20:18:38	1.6
@@ -18,6 +18,7 @@
 CUT=cut
 DATE=date
 BASENAME=basename
+UNAME=uname
 
 # user may override lvm and dmsetup location by setting LVM_BINARY
 # and DMSETUP_BINARY respectively
@@ -131,6 +132,10 @@
 $LVM lvs --version >> $dir/versions 2>> $log
 echo "DEVICE MAPPER VERSION:" >> $dir/versions
 $DMSETUP --version >> $dir/versions 2>> $log
+echo "KERNEL VERSION:" >> $dir/versions
+$UNAME -a >> $dir/versions 2>> $log
+echo "DM TARGETS VERSIONS:" >> $dir/versions
+$DMSETUP targets >> $dir/versions 2>> $log
 
 myecho "Gathering dmsetup info..."
 log "$DMSETUP info -c > $dir/dmsetup_info 2>> $log"


^ permalink raw reply	[flat|nested] 9+ messages in thread

* LVM2 ./WHATS_NEW scripts/lvm_dump.sh
@ 2007-04-25 14:49 bmr
  0 siblings, 0 replies; 9+ messages in thread
From: bmr @ 2007-04-25 14:49 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	bmr@sourceware.org	2007-04-25 15:49:27

Modified files:
	.              : WHATS_NEW 
	scripts        : lvm_dump.sh 

Log message:
	Make lvm_dump.sh capture a listing of /sys/block entries.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.600&r2=1.601
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5

--- LVM2/WHATS_NEW	2007/04/24 15:13:13	1.600
+++ LVM2/WHATS_NEW	2007/04/25 14:49:27	1.601
@@ -1,5 +1,7 @@
 Version 2.02.25 -
 =================================
+  Add /sys/block listings to lvm_dump.sh
+  Make lvm_dump.sh list /dev recursively
   Fix thread race in clvmd.
   Add scan_sector param to label_read and _find_labeller.
   Make clvmd cope with quorum devices on RHEL5
@@ -11,7 +13,6 @@
   Fix vgsplit for lvm1 format (set and validate VG name in PVs metadata).
   Split metadata areas in vgsplit properly.
   Add extra internal error checking to clvmd
-  Make lvm_dump.sh list /dev recursively
 
 Version 2.02.24 - 19th March 2007
 =================================
--- LVM2/scripts/lvm_dump.sh	2007/04/19 23:06:05	1.4
+++ LVM2/scripts/lvm_dump.sh	2007/04/25 14:49:27	1.5
@@ -149,6 +149,9 @@
 myecho "Gathering /dev listing..."
 log "$LS -laR /dev > $dir/dev_listing 2>> $log"
 
+myecho "Gathering /sys/block listing..."
+log "$LS -laR /sys/block > $dir/sysblock_listing"
+
 if (( $metadata )); then
 	myecho "Gathering LVM metadata from Physical Volumes..."
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* LVM2 ./WHATS_NEW scripts/lvm_dump.sh
@ 2006-11-23 17:23 agk
  0 siblings, 0 replies; 9+ messages in thread
From: agk @ 2006-11-23 17:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-11-23 17:23:14

Modified files:
	.              : WHATS_NEW 
	scripts        : lvm_dump.sh 

Log message:
	Improve lvm_dump.sh robustness.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.506&r2=1.507
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3

--- LVM2/WHATS_NEW	2006/11/21 22:41:55	1.506
+++ LVM2/WHATS_NEW	2006/11/23 17:23:14	1.507
@@ -1,5 +1,6 @@
 Version 2.02.16 -
 ====================================
+  Improve lvm_dump.sh robustness.
   Update lvm2create_initrd to support gentoo.
 
 Version 2.02.15 - 21st November 2006
--- LVM2/scripts/lvm_dump.sh	2006/11/16 16:44:48	1.2
+++ LVM2/scripts/lvm_dump.sh	2006/11/23 17:23:14	1.3
@@ -1,8 +1,41 @@
 #!/bin/bash
-#
+# we use some bash-isms (getopts?)
+
 # lvm_dump: This script is used to collect pertinent information for
 #           the debugging of lvm issues.
-#
+
+# following external commands are used throughout the script
+# which, echo and test are internal in bash at least
+MKDIR=mkdir # need -p
+TAR=tar # need czf
+RM=rm # need -rf
+CP=cp
+TAIL=tail # we need -n
+LS=ls # need -la
+PS=ps # need alx
+SED=sed
+DD=dd
+CUT=cut
+DATE=date
+BASENAME=basename
+
+# user may override lvm and dmsetup location by setting LVM_BINARY
+# and DMSETUP_BINARY respectively
+LVM=${LVM_BINARY-lvm}
+DMSETUP=${DMSETUP_BINARY-dmsetup}
+
+die() {
+    code=$1; shift
+    echo "$@" 1>&2
+    exit $code
+}
+
+# which should error out if the binary is not executable, although i
+# am not sure we can rely on this
+which $LVM >& /dev/null || die 2 "Fatal: could not find lvm binary '$LVM'"
+test -x `which $LVM` || die 2 "Fatal: lvm binary '$LVM' not executable"
+which $DMSETUP >& /dev/null || die 2 "Fatal: could not find dmsetup binary '$DMSETUP'"
+test -x `which $DMSETUP` || die 2 "Fatal: dmsetup binary '$DMSETUP' not executable"
 
 function usage {
 	echo "$0 [options]"
@@ -34,23 +67,16 @@
 	esac
 done
 
-DATE=`/bin/date -u +%G%m%d%k%M%S | /usr/bin/tr -d ' '`
+NOW=`$DATE -u +%G%m%d%k%M%S | /usr/bin/tr -d ' '`
 if test -n "$userdir"; then
 	dir="$userdir"
 else
-	dirbase="lvmdump-$HOSTNAME-$DATE"
+	dirbase="lvmdump-$HOSTNAME-$NOW"
 	dir="$HOME/$dirbase"
 fi
 
-if test -e $dir; then
-	echo $dir already exists, aborting >&2
-	exit 2
-fi
-
-if ! mkdir -p $dir; then
-	echo Could not create $dir >&2
-	exit 3
-fi
+test -e $dir && die 3 "Fatal: $dir already exists"
+$MKDIR -p $dir || die 4 "Fatal: could not create $dir"
 
 log="$dir/lvmdump.log"
 
@@ -72,19 +98,19 @@
 	myecho "Gathering LVM volume info..."
 
 	myecho "  vgscan..."
-	log "vgscan -vvvv > $dir/vgscan 2>&1"
+	log "$LVM vgscan -vvvv > $dir/vgscan 2>&1"
 
 	myecho "  pvscan..."
-	log "pvscan -v >> $dir/pvscan 2>> $log"
+	log "$LVM pvscan -v >> $dir/pvscan 2>> $log"
 
 	myecho "  lvs..."
-	log "lvs -a -o +devices >> $dir/lvs 2>> $log"
+	log "$LVM lvs -a -o +devices >> $dir/lvs 2>> $log"
 
 	myecho "  pvs..."
-	log "pvs -a -v > $dir/pvs 2>> $log"
+	log "$LVM pvs -a -v > $dir/pvs 2>> $log"
 
 	echo "  vgs..."
-	log "vgs -v > $dir/vgs 2>> $log"
+	log "$LVM vgs -v > $dir/vgs 2>> $log"
 fi
 
 if (( $clustered )); then
@@ -102,41 +128,42 @@
 
 myecho "Gathering LVM & device-mapper version info..."
 echo "LVM VERSION:" > $dir/versions
-lvs --version >> $dir/versions 2>> $log
+$LVM lvs --version >> $dir/versions 2>> $log
 echo "DEVICE MAPPER VERSION:" >> $dir/versions
-dmsetup --version >> $dir/versions 2>> $log
+$DMSETUP --version >> $dir/versions 2>> $log
 
 myecho "Gathering dmsetup info..."
-log "dmsetup info -c > $dir/dmsetup_info 2>> $log"
-log "dmsetup table > $dir/dmsetup_table 2>> $log"
-log "dmsetup status > $dir/dmsetup_status 2>> $log"
+log "$DMSETUP info -c > $dir/dmsetup_info 2>> $log"
+log "$DMSETUP table > $dir/dmsetup_table 2>> $log"
+log "$DMSETUP status > $dir/dmsetup_status 2>> $log"
 
 myecho "Gathering process info..."
-log "ps alx > $dir/ps_info 2>> $log"
+log "$PS alx > $dir/ps_info 2>> $log"
 
 myecho "Gathering console messages..."
-log "tail -n 75 /var/log/messages > $dir/messages 2>> $log"
+log "$TAIL -n 75 /var/log/messages > $dir/messages 2>> $log"
 
 myecho "Gathering /etc/lvm info..."
-log "cp -a /etc/lvm $dir/lvm 2>> $log"
+log "$CP -a /etc/lvm $dir/lvm 2>> $log"
 
 myecho "Gathering /dev listing..."
-log "ls -la /dev > $dir/dev_listing 2>> $log"
+log "$LS -la /dev > $dir/dev_listing 2>> $log"
 
 if (( $metadata )); then
 	myecho "Gathering LVM metadata from Physical Volumes..."
 
-	log "mkdir -p $dir/metadata"
+	log "$MKDIR -p $dir/metadata"
 
-	pvs="$(pvs --separator , --noheadings --units s --nosuffix -o name,pe_start 2>> $log | \
-		sed -e 's/^ *//')"
+	pvs="$($LVM pvs --separator , --noheadings --units s --nosuffix -o \
+	    name,pe_start 2>> $log | $SED -e 's/^ *//')"
 	for line in "$pvs"
 	do
-		pv="$(echo $line | cut -d, -f1)"
-		pe_start="$(echo $line | cut -d, -f2)"
-		name="$(basename $pv)"
+		test -z "$line" && continue
+		pv="$(echo $line | $CUT -d, -f1)"
+		pe_start="$(echo $line | $CUT -d, -f2)"
+		name="$($BASENAME $pv)"
 		myecho "  $pv"
-		log "dd if=$pv of=$dir/metadata/$name bs=512 count=$pe_start 2>> $log"
+		log "$DD if=$pv of=$dir/metadata/$name bs=512 count=$pe_start 2>> $log"
 	done
 fi
 
@@ -144,8 +171,14 @@
 	lvm_dump="$dirbase.tgz"
 	myecho "Creating report tarball in $HOME/$lvm_dump..."
 	cd $HOME
-	tar czf $lvm_dump $dirbase 2>/dev/null
-	rm -rf $dir
+	$TAR czf $lvm_dump $dirbase 2>/dev/null
+	$RM -rf $dir
+fi
+
+if test "$UID" != "0" && test "$EUID" != "0"; then
+	myecho
+	myecho "WARNING! Running as non-privileged user, dump is likely incomplete!"
+	myecho
 fi
 
 exit 0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* LVM2 ./WHATS_NEW scripts/lvm_dump.sh
@ 2006-10-05 18:42 agk
  0 siblings, 0 replies; 9+ messages in thread
From: agk @ 2006-10-05 18:42 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-05 18:42:33

Modified files:
	.              : WHATS_NEW 
Added files:
	scripts        : lvm_dump.sh 

Log message:
	Add lvm_dump.sh script to create a tarball of debugging info from a system.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.452&r2=1.453
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1

--- LVM2/WHATS_NEW	2006/10/05 13:55:50	1.452
+++ LVM2/WHATS_NEW	2006/10/05 18:42:33	1.453
@@ -1,5 +1,6 @@
 Version 2.02.11 - 
 =====================================
+  Add lvm_dump.sh script to create a tarball of debugging info from a system.
   Capture error messages in clvmd and pass them back to the user.
   Remove unused #defines from filter-md.c.
   Make clvmd restart init script wait until clvmd has died before starting it.
/cvs/lvm2/LVM2/scripts/lvm_dump.sh,v  -->  standard output
revision 1.1
--- LVM2/scripts/lvm_dump.sh
+++ -	2006-10-05 18:42:33.809564000 +0000
@@ -0,0 +1,118 @@
+#!/bin/bash
+#
+# lvm_dump: This script is used to collect pertinent information for
+#           the debugging of lvm issues.
+#
+
+function usage {
+	echo "$0 [options]"
+	echo "    -h print this message"
+	echo "    -a advanced collection - warning: if lvm is already hung,"
+	echo "       then this script may hang as well if -a is used"
+	echo "    -m gather LVM metadata from the PVs"
+	echo "    -d dump directory to place data in (default=/tmp/lvm_dump.\$\$)"
+	echo "    -c if running clvmd, gather cluster data as well"
+	echo ""
+	
+	exit 1
+}
+
+advanced=0
+clustered=0
+metadata=0
+while getopts :acd:hm opt; do
+	case $opt in 
+		a)	advanced=1 ;;
+		c)	clustered=1 ;;
+		d)	lvm_dir=$OPTARG ;;
+		h)	usage ;;
+		m)	metadata=1 ;;
+		:)	echo "$0: $OPTARG requires a value:"; usage ;;
+		\?)     echo "$0: unknown option $OPTARG"; usage ;;
+		*)	usage ;;
+	esac
+done
+
+dir=`mktemp -d -p /tmp lvm_dump.XXXXXX` || exit 2
+lvm_dir="$dir/lvm_dump"
+
+echo " "
+echo "Creating dump directory: $lvm_dir"
+echo " "
+
+mkdir -p $lvm_dir || exit 3
+
+if (( $advanced )); then
+	echo "Gathering LVM volume info..."
+
+	echo "  vgscan..."
+	vgscan -vvvv > $lvm_dir/vgscan 2>&1
+
+	echo "  pvscan..."
+	pvscan -v >> $lvm_dir/pvscan 2>/dev/null
+
+	echo "  lvs..."
+	lvs -a -o +devices >> $lvm_dir/lvs 2>/dev/null
+
+	echo "  pvs..."
+	pvs -a -v > $lvm_dir/pvs 2>/dev/null
+
+	echo "  vgs..."
+	vgs -v > $lvm_dir/vgs 2>/dev/null
+fi
+
+if (( $clustered )); then
+	echo "Gathering cluster info..."
+	echo "STATUS: " > $lvm_dir/cluster_info
+	echo "----------------------------------" >> $lvm_dir/cluster_info
+	cman_tool status >> $lvm_dir/cluster_info
+	echo " " >> $lvm_dir/lvm_info
+
+	echo "SERVICES: " >> $lvm_dir/cluster_info
+	echo "----------------------------------" >> $lvm_dir/cluster_info
+	cman_tool services >> $lvm_dir/cluster_info
+	echo " " >> $lvm_dir/lvm_info
+fi
+
+echo "Gathering LVM & device-mapper version info..."
+echo "LVM VERSION:" > $lvm_dir/versions
+lvs --version >> $lvm_dir/versions
+echo "DEVICE MAPPER VERSION:" >> $lvm_dir/versions
+dmsetup --version >> $lvm_dir/versions
+
+echo "Gathering dmsetup info..."
+dmsetup info -c > $lvm_dir/dmsetup_info
+dmsetup table > $lvm_dir/dmsetup_table
+dmsetup status > $lvm_dir/dmsetup_status
+
+echo "Gathering process info..."
+ps alx > $lvm_dir/ps_info
+
+echo "Gathering console messages..."
+tail -n 75 /var/log/messages > $lvm_dir/messages
+
+echo "Gathering /etc/lvm info..."
+cp -a /etc/lvm $lvm_dir/lvm
+
+echo "Gathering /dev listing..."
+ls -la /dev > $lvm_dir/dev_listing
+
+if (( $metadata )); then
+	echo "Gathering LVM metadata from Physical Volumes..."
+
+	mkdir -p $lvm_dir/metadata
+
+	for pv in `pvs --noheadings -o name`
+	do
+		echo "  $pv"
+		name=`basename $pv`
+		dd if=$pv of=$lvm_dir/metadata/$name bs=512 count=`pvs --noheadings --nosuffix --units s -o pe_start $pv | tr -d \ `
+	done 2>/dev/null
+fi
+
+lvm_dump=$lvm_dir.tgz
+echo "Creating tarball $lvm_dump..."
+tar czf $lvm_dump $lvm_dir 2>/dev/null
+
+exit 0
+


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-01-06 18:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-28 10:40 LVM2 ./WHATS_NEW scripts/lvm_dump.sh mbroz
  -- strict thread matches above, loose matches on Subject: below --
2009-01-06 18:03 mbroz
2007-10-02 16:09 mornfall
2007-10-02 15:48 mornfall
2007-08-09  9:53 pcaulfield
2007-07-02 20:18 mbroz
2007-04-25 14:49 bmr
2006-11-23 17:23 agk
2006-10-05 18:42 agk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).