# 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
# 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
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"
}
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.