Report error when exporting non-ext partition
authorThomas Thrainer <thomasth@google.com>
Thu, 23 May 2013 11:17:29 +0000 (13:17 +0200)
committerThomas Thrainer <thomasth@google.com>
Thu, 23 May 2013 15:58:36 +0000 (17:58 +0200)
Report an error if it's exporting an instance fails because of the
wrong filesystem type.

This fixes issue 303.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

NEWS
export

diff --git a/NEWS b/NEWS
index 7c48341..493cd60 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,10 @@ defaults to 'ext4'.
 
 Improve documentation with regard to instance variants.
 
+Bugfixes:
+
+- Report an error if it's exporting an instance fails because of the
+  wrong filesystem type.
 
 Version 0.12
 ------------
diff --git a/export b/export
index d0afa68..46aa74c 100755 (executable)
--- a/export
+++ b/export
@@ -43,6 +43,9 @@ vol_type=$($VOL_TYPE $filesystem_dev)
 
 if [ "${vol_type:0:3}" = "ext" ]; then
   dump -0 -q -f - "$filesystem_dev"
+else
+  echo "Can't dump partition of type ${vol_type}!" >&2
+  exit 1
 fi
 
 # execute cleanups