From fa75d0f7bc374b88911c2bc5746bafb156987286 Mon Sep 17 00:00:00 2001 From: Jaromil Date: Thu, 5 Sep 2013 12:45:40 +0200 Subject: [PATCH] check if loop mount is possible if not abort gracefully with an explanation (10x to Bucciarati and sdonk) --- tomb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tomb b/tomb index 7bd21d9..758b65c 100755 --- a/tomb +++ b/tomb @@ -216,6 +216,15 @@ EOF exit $? fi # are we root already + # check if we have support for loop mounting + losetup -f > /dev/null + { test "$?" = "0" } || { + no "Loop mount of volumes is not supported on this machine, this error" + no "often occurs on VPS and kernels that don't provide the loop module." + no "It is impossible to use Tomb on this machine at this conditions." + die "Operation aborted." + } + # make sure necessary kernel modules are loaded modprobe dm_mod 2>/dev/null modprobe dm_crypt 2>/dev/null