Make 'snapshot' use our standard names.
authorrjones <devnull@localhost>
Mon, 10 Sep 2007 18:33:32 +0000 (19:33 +0100)
committerrjones <devnull@localhost>
Mon, 10 Sep 2007 18:33:32 +0000 (19:33 +0100)
virt-p2v.sh

index fa2e705..92b840f 100755 (executable)
@@ -3,9 +3,9 @@
 # virt-p2v.sh is a shell script which performs a physical to
 # virtual conversion of local disks.
 #
-# By Richard W.M. Jones <rjones@redhat.com>
-#
 # Copyright (C) 2007 Red Hat Inc.
+# Written by Richard W.M. Jones <rjones@redhat.com>
+#
 # $Id$
 
 export PATH=/usr/sbin:/sbin:/usr/local/bin:/usr/kerberos/bin:/usr/bin:/bin
@@ -74,7 +74,7 @@ function word_in_list {
 
 # Create a device-mapper snapshot of a device with ramdisk overlay.
 # Example:
-#   snapshot /dev/sda1 snap
+#   snapshot sda1 snap
 # creates a snapshot of /dev/sda1 called /dev/mapper/snap
 
 
@@ -83,10 +83,10 @@ function snapshot {
     local dev=$1 name=$2
 
     # Get size of the device in sectors.
-    local sectors=`blockdev --getsize $dev`
+    local sectors=`blockdev --getsize /dev/$dev`
 
     dmsetup create ${name}_org \
-       --table="0 $sectors snapshot-origin $dev"
+       --table="0 $sectors snapshot-origin /dev/$dev"
     dmsetup create $name \
        --table="0 $sectors snapshot /dev/mapper/${name}_org /dev/ram1 n 64"
 }
@@ -407,7 +407,9 @@ done
 clear
 
 # Mount the root filesystem(s) using device-mapper snapshots.
-
+# For example, if asked to examine VolGroup00/LogVol00, then
+# we might find that it is located on physical device sda, and
+# the snapshot in that case will be called sda_snap.