[readonly/geninitrd: 495/1068] - more information why lvdisplay failed to resolve lvm name

draenog draenog at pld-linux.org
Sat Nov 2 19:54:00 CET 2013


commit a14a054a7bfb5664580f42680e2bcf373f497270
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Thu Nov 1 17:30:15 2007 +0000

    - more information why lvdisplay failed to resolve lvm name
    
    svn-id: @8951

 functions | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/functions b/functions
index 32e40c7..0db38e6 100644
--- a/functions
+++ b/functions
@@ -95,10 +95,23 @@ dm_lvm2_name() {
 	;;
 	esac
 
+	if [ ! -b "$node" ]; then
+		echo >&2 "dm_lvm2_name: $node is not a block device"
+		return 1
+	fi
+
 	local lvm_path=$(/sbin/lvdisplay -c 2>/dev/null | awk -F: -vn=$dm_minor '{node=$1; major=$12; minor=$13; if (n == minor) print node}' | xargs)
 	if [ -z "$lvm_path" ]; then
 		# XXX: this could happen also for non-lvm nodes?
-		echo >&2 "lvdisplay couldn't find device-mapper node with minor $dm_minor. try running 'vgscan --mknodes'."
+		cat >&2 <<-EOF
+		LVM doesn't recognize device-mapper node with minor $dm_minor
+
+		In case your Physical Volumes are device mapper nodes, you should add to lvm.conf:
+		    types = [ "device-mapper", 254 ]
+
+		In case the LVM nodes are not present yet, it could be fixed by running:
+		# vgscan --mknodes
+		EOF
 		return 2
 	fi
 	if [ ! -r "$lvm_path" ]; then
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090



More information about the pld-cvs-commit mailing list