summaryrefslogtreecommitdiffstats
path: root/tools/virt-make-fs
diff options
context:
space:
mode:
Diffstat (limited to 'tools/virt-make-fs')
-rwxr-xr-xtools/virt-make-fs14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/virt-make-fs b/tools/virt-make-fs
index 6efa3cd0..072a517c 100755
--- a/tools/virt-make-fs
+++ b/tools/virt-make-fs
@@ -456,7 +456,19 @@ eval {
# Create the filesystem.
if ($type ne "btrfs") {
- $g->mkfs ($type, $dev);
+ eval {
+ $g->mkfs ($type, $dev);
+ };
+ if ($@) {
+ # Provide more guidance in the error message (RHBZ#823883).
+ print STDERR "'mkfs' (create filesystem) operation failed.\n";
+ if ($type eq "fat") {
+ print STDERR "Instead of 'fat', try 'vfat' (long filenames) or 'msdos' (short filenames).\n";
+ } else {
+ print STDERR "Is '$type' a correct filesystem type?\n";
+ }
+ die
+ }
} else {
$g->mkfs_btrfs ([$dev], datatype => "single", metadata => "single");
}