summaryrefslogtreecommitdiff
path: root/cryptfs.bin.in
diff options
context:
space:
mode:
Diffstat (limited to 'cryptfs.bin.in')
-rw-r--r--cryptfs.bin.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/cryptfs.bin.in b/cryptfs.bin.in
index 5516e5d..84d97a0 100644
--- a/cryptfs.bin.in
+++ b/cryptfs.bin.in
@@ -191,7 +191,13 @@ do_mount() {
case "$(mount_details fs "$1")" in
'ext'*)
- e2fsck -p $(mount_details dev "$1")
+ if cryptsetup status $(mount_details dev "$1") \
+ | grep -q '^\s*mode:\s\+readonly$'; then
+ e2fsck_option='-n'
+ else
+ e2fsck_option='-p'
+ fi
+ e2fsck ${e2fsck_option} $(mount_details dev "$1")
;;
'fuse.sshfs'|'fuse.ftps')
local max_wait