tools/livecd-iso-to-disk.sh | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit a46804ad6a4e17f38bb226f9dee410727520277c
Author: Alan Pevec <apevec(a)redhat.com>
Date: Fri May 7 21:28:04 2010 +0000
livecd-iso-to-disk --format fails with existing LV on USB
Resolves: rhbz#583658
Signed-off-by: Alan Pevec <apevec(a)redhat.com>
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 3a4726d..f4d0855 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -138,6 +138,18 @@ checkPartActive() {
fi
}
+checkLVM() {
+ dev=$1
+
+ if [ -x /sbin/pvs -a \
+ "$(/sbin/pvs -o vg_name --noheadings $dev* 2>/dev/null)" ]; then
+ echo "Device, $dev, contains a volume group and cannot be formated!"
+ echo "You can remove the volume group using vgremove."
+ exitclean
+ fi
+ return 0
+}
+
createGPTLayout() {
dev=$1
getdisk $dev
@@ -407,6 +419,7 @@ fi
# do some basic sanity checks.
checkMounted $USBDEV
if [ -n "$format" ];then
+ checkLVM $USBDEV
# checks for a valid filesystem
if [ -n "$efi" ];then
createGPTLayout $USBDEV
Show replies by thread