1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add udev info and context to lvmdump.

--------------------------------------------------------------------
This commit is contained in:
Peter Rajnoha 2012-04-18 15:26:02 +00:00
parent 23957e16d5
commit 973cfb19b7
2 changed files with 20 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.96 -
================================
Add udev info and context to lvmdump.
Fix RAID device replacement code so that it works under snapshot.
Fix inability to split RAID1 image while specifying a particular PV.
Update man pages to give them same look&feel.

View File

@ -30,6 +30,7 @@ DD=dd
CUT=cut
DATE=date
BASENAME=basename
UDEVADM=udevadm
UNAME=uname
# user may override lvm and dmsetup location by setting LVM_BINARY
@ -54,6 +55,7 @@ function usage {
echo " -m gather LVM metadata from the PVs"
echo " -d <directory> dump into a directory instead of tarball"
echo " -c if running clvmd, gather cluster data as well"
echo " -u gather udev info and context"
echo ""
exit 1
@ -62,7 +64,8 @@ function usage {
advanced=0
clustered=0
metadata=0
while getopts :acd:hm opt; do
udev=0
while getopts :acd:hmu opt; do
case $opt in
s) sysreport=1 ;;
a) advanced=1 ;;
@ -70,6 +73,7 @@ while getopts :acd:hm opt; do
d) userdir=$OPTARG ;;
h) usage ;;
m) metadata=1 ;;
u) udev=1 ;;
:) echo "$0: $OPTARG requires a value:"; usage ;;
\?) echo "$0: unknown option $OPTARG"; usage ;;
*) usage ;;
@ -221,6 +225,20 @@ if (( $metadata )); then
done
fi
if (( $udev )); then
myecho "Gathering udev info..."
udev_dir="$dir/udev"
log "$MKDIR -p \"$udev_dir\""
log "$UDEVADM info --version >> \"$udev_dir/version\" 2>> \"$log\""
log "$UDEVADM info --export-db >> \"$udev_dir/db\" 2>> \"$log\""
log "$CP -a /etc/udev/udev.conf \"$udev_dir/conf\" 2>> \"$log\""
log "$LS -la /lib/udev >> \"$udev_dir/lib_dir\" 2>> \"$log\""
log "$CP -aR /etc/udev/rules.d \"$udev_dir/rules_etc\" 2>> \"$log\""
log "$CP -aR /lib/udev/rules.d \"$udev_dir/rules_lib\" 2>> \"$log\""
fi
if test -z "$userdir"; then
lvm_dump="$dirbase.tgz"
myecho "Creating report tarball in $HOME/$lvm_dump..."