diff --git a/Android.mk b/Android.mk
index c556db3..b0fefbd 100644
--- a/Android.mk
+++ b/Android.mk
@@ -13,7 +13,7 @@
     roots.c \
     ui.c \
     verifier.c \
-    efs_migration.c
+    encryptedfs_provisioning.c
 
 LOCAL_SRC_FILES += test_roots.c
 
diff --git a/efs_migration.c b/efs_migration.c
deleted file mode 100644
index aeadd18..0000000
--- a/efs_migration.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "efs_migration.h"
-#include "cutils/misc.h"
-#include "cutils/properties.h"
-#include "common.h"
-#include "mtdutils/mtdutils.h"
-#include "mtdutils/mounts.h"
-#include "roots.h"
-
-const char* efs_enabled_property = "persist.security.efs.enabled";
-const char* efs_transition_property = "persist.security.efs.trans";
-const char* efs_property_dir = "/data/property/";
-
-void get_property_file_name(char *buffer, const char *property_name) {
-    sprintf(buffer, "%s%s", efs_property_dir, property_name);
-}
-
-int get_text_file_contents(char *buffer, int buf_size, char *file_name) {
-    FILE *in_file;
-    char *read_data;
-
-    in_file = fopen(file_name, "r");
-    if (in_file == NULL) {
-        LOGE("Encrypted FS: error accessing properties.");
-        return EFS_ERROR;
-    }
-
-    read_data = fgets(buffer, buf_size, in_file);
-    if (read_data == NULL) {
-        // Error or unexpected data
-        fclose(in_file);
-        LOGE("Encrypted FS: error accessing properties.");
-        return EFS_ERROR;
-    }
-
-    fclose(in_file);
-    return EFS_OK;
-}
-
-int set_text_file_contents(char *buffer, char *file_name) {
-    FILE *out_file;
-    int result;
-
-    out_file = fopen(file_name, "w");
-    if (out_file == NULL) {
-        LOGE("Encrypted FS: error setting up properties.");
-        return EFS_ERROR;
-    }
-
-    result = fputs(buffer, out_file);
-    if (result != 0) {
-        // Error or unexpected data
-        fclose(out_file);
-        LOGE("Encrypted FS: error setting up properties.");
-        return EFS_ERROR;
-    }
-
-    fflush(out_file);
-    fclose(out_file);
-    return EFS_OK;
-}
-
-
-int read_efs_boolean_property(const char *prop_name, int *value) {
-    char prop_file_name[PROPERTY_KEY_MAX + 32];
-    char prop_value[PROPERTY_VALUE_MAX];
-    int result;
-
-    get_property_file_name(prop_file_name, prop_name);
-    result = get_text_file_contents(prop_value, PROPERTY_VALUE_MAX, prop_file_name);
-
-    if (result < 0) {
-        return result;
-    }
-
-    if (strncmp(prop_value, "1", 1) == 0) {
-        *value = 1;
-    } else if (strncmp(prop_value, "0", 1) == 0) {
-        *value = 0;
-    } else {
-        LOGE("Encrypted FS: error accessing properties.");
-        return EFS_ERROR;
-    }
-
-    return EFS_OK;
-}
-
-int write_efs_boolean_property(const char *prop_name, int value) {
-    char prop_file_name[PROPERTY_KEY_MAX + 32];
-    char prop_value[PROPERTY_VALUE_MAX];
-    int result;
-
-    get_property_file_name(prop_file_name, prop_name);
-
-    // Create the directory if needed
-    mkdir(efs_property_dir, 0755);
-    if (value == 1) {
-        result = set_text_file_contents("1", prop_file_name);
-    } else if (value == 0) {
-        result = set_text_file_contents("0", prop_file_name);
-    } else {
-        return EFS_ERROR;
-    }
-    if (result < 0) {
-        return result;
-    }
-
-    return EFS_OK;
-}
-
-int read_encrypted_fs_info(encrypted_fs_info *efs_data) {
-    int result;
-    int value;
-    result = ensure_root_path_mounted("DATA:");
-    if (result != 0) {
-        LOGE("Encrypted FS: error mounting userdata partition.");
-        return EFS_ERROR;
-    }
-
-    // STOPSHIP: Read the EFS key from a file (TBD later)
-    // Future code goes here...
-
-    result = ensure_root_path_unmounted("DATA:");
-    if (result != 0) {
-        LOGE("Encrypted FS: error unmounting data partition.");
-        return EFS_ERROR;
-    }
-
-    return EFS_OK;
-}
-
-int restore_encrypted_fs_info(encrypted_fs_info *efs_data) {
-    int result;
-    result = ensure_root_path_mounted("DATA:");
-    if (result != 0) {
-        LOGE("Encrypted FS: error mounting userdata partition.");
-        return EFS_ERROR;
-    }
-
-    // Set the EFS properties to their respective values
-    result = write_efs_boolean_property(efs_enabled_property, efs_data->encrypted_fs_mode);
-    if (result != 0) {
-        return result;
-    }
-
-    // Signal "transition" of Encrypted File System settings
-    result = write_efs_boolean_property(efs_transition_property, 1);
-    if (result != 0) {
-        return result;
-    }
-
-    result = ensure_root_path_unmounted("DATA:");
-    if (result != 0) {
-        LOGE("Encrypted FS: error unmounting data partition.");
-        return EFS_ERROR;
-    }
-
-    return EFS_OK;
-}
-
diff --git a/efs_migration.h b/efs_migration.h
deleted file mode 100644
index 7857f94..0000000
--- a/efs_migration.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-
-#ifndef __EFS_MIGRATION_H__
-#define __EFS_MIGRATION_H__
-
-#define MODE_ENCRYPTEDFS_DISABLED 0
-#define MODE_ENCRYPTEDFS_ENABLED  1
-
-#define EFS_OK            0
-#define EFS_ERROR       (-1)
-
-struct encrypted_fs_info {
-    int encrypted_fs_mode;
-    char *encrypted_fs_key;
-};
-
-typedef struct encrypted_fs_info encrypted_fs_info;
-
-int read_encrypted_fs_info(encrypted_fs_info *efs_data);
-
-int restore_encrypted_fs_info(encrypted_fs_info *efs_data);
-
-#endif /* __EFS_MIGRATION_H__ */
-
diff --git a/encryptedfs_provisioning.c b/encryptedfs_provisioning.c
new file mode 100644
index 0000000..2bcfec1
--- /dev/null
+++ b/encryptedfs_provisioning.c
@@ -0,0 +1,284 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "encryptedfs_provisioning.h"
+#include "cutils/misc.h"
+#include "cutils/properties.h"
+#include "common.h"
+#include "mtdutils/mtdutils.h"
+#include "mtdutils/mounts.h"
+#include "roots.h"
+
+const char* encrypted_fs_enabled_property      = "persist.security.secfs.enabled";
+const char* encrypted_fs_property_dir          = "/data/property/";
+const char* encrypted_fs_system_dir            = "/data/system/";
+const char* encrypted_fs_key_file_name         = "/data/fs_key.dat";
+const char* encrypted_fs_salt_file_name        = "/data/hash_salt.dat";
+const char* encrypted_fs_hash_file_src_name    = "/data/system/password.key";
+const char* encrypted_fs_hash_file_dst_name    = "/data/hash.dat";
+const char* encrypted_fs_entropy_file_src_name = "/data/system/entropy.dat";
+const char* encrypted_fs_entropy_file_dst_name = "/data/ported_entropy.dat";
+
+void get_property_file_name(char *buffer, const char *property_name) {
+    sprintf(buffer, "%s%s", encrypted_fs_property_dir, property_name);
+}
+
+int get_binary_file_contents(char *buffer, int buf_size, const char *file_name, int *out_size) {
+    FILE *in_file;
+    int read_bytes;
+
+    in_file = fopen(file_name, "r");
+    if (in_file == NULL) {
+        LOGE("Secure FS: error accessing key file.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    read_bytes = fread(buffer, 1, buf_size, in_file);
+    if (out_size == NULL) {
+        if (read_bytes != buf_size) {
+            // Error or unexpected data
+            fclose(in_file);
+            LOGE("Secure FS: error reading conmplete key.");
+            return ENCRYPTED_FS_ERROR;
+        }
+    } else {
+        *out_size = read_bytes;
+    }
+    fclose(in_file);
+    return ENCRYPTED_FS_OK;
+}
+
+int set_binary_file_contents(char *buffer, int buf_size, const char *file_name) {
+    FILE *out_file;
+    int write_bytes;
+
+    out_file = fopen(file_name, "w");
+    if (out_file == NULL) {
+        LOGE("Secure FS: error setting up key file.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    write_bytes = fwrite(buffer, 1, buf_size, out_file);
+    if (write_bytes != buf_size) {
+        // Error or unexpected data
+        fclose(out_file);
+        LOGE("Secure FS: error reading conmplete key.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    fclose(out_file);
+    return ENCRYPTED_FS_OK;
+}
+
+int get_text_file_contents(char *buffer, int buf_size, char *file_name) {
+    FILE *in_file;
+    char *read_data;
+
+    in_file = fopen(file_name, "r");
+    if (in_file == NULL) {
+        LOGE("Secure FS: error accessing properties.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    read_data = fgets(buffer, buf_size, in_file);
+    if (read_data == NULL) {
+        // Error or unexpected data
+        fclose(in_file);
+        LOGE("Secure FS: error accessing properties.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    fclose(in_file);
+    return ENCRYPTED_FS_OK;
+}
+
+int set_text_file_contents(char *buffer, char *file_name) {
+    FILE *out_file;
+    int result;
+
+    out_file = fopen(file_name, "w");
+    if (out_file == NULL) {
+        LOGE("Secure FS: error setting up properties.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    result = fputs(buffer, out_file);
+    if (result != 0) {
+        // Error or unexpected data
+        fclose(out_file);
+        LOGE("Secure FS: error setting up properties.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    fflush(out_file);
+    fclose(out_file);
+    return ENCRYPTED_FS_OK;
+}
+
+int read_encrypted_fs_boolean_property(const char *prop_name, int *value) {
+    char prop_file_name[PROPERTY_KEY_MAX + 32];
+    char prop_value[PROPERTY_VALUE_MAX];
+    int result;
+
+    get_property_file_name(prop_file_name, prop_name);
+    result = get_text_file_contents(prop_value, PROPERTY_VALUE_MAX, prop_file_name);
+
+    if (result < 0) {
+        return result;
+    }
+
+    if (strncmp(prop_value, "1", 1) == 0) {
+        *value = 1;
+    } else if (strncmp(prop_value, "0", 1) == 0) {
+        *value = 0;
+    } else {
+        LOGE("Secure FS: error accessing properties.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    return ENCRYPTED_FS_OK;
+}
+
+int write_encrypted_fs_boolean_property(const char *prop_name, int value) {
+    char prop_file_name[PROPERTY_KEY_MAX + 32];
+    char prop_value[PROPERTY_VALUE_MAX];
+    int result;
+
+    get_property_file_name(prop_file_name, prop_name);
+
+    // Create the directory if needed
+    mkdir(encrypted_fs_property_dir, 0755);
+    if (value == 1) {
+        result = set_text_file_contents("1", prop_file_name);
+    } else if (value == 0) {
+        result = set_text_file_contents("0", prop_file_name);
+    } else {
+        return ENCRYPTED_FS_ERROR;
+    }
+    if (result < 0) {
+        return result;
+    }
+
+    return ENCRYPTED_FS_OK;
+}
+
+int read_encrypted_fs_info(encrypted_fs_info *encrypted_fs_data) {
+    int result;
+    int value;
+    result = ensure_root_path_mounted("DATA:");
+    if (result != 0) {
+        LOGE("Secure FS: error mounting userdata partition.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    // Read the pre-generated encrypted FS key, password hash and salt.
+    result = get_binary_file_contents(encrypted_fs_data->key, ENCRYPTED_FS_KEY_SIZE,
+            encrypted_fs_key_file_name, NULL);
+    if (result != 0) {
+        LOGE("Secure FS: error reading generated file system key.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    result = get_binary_file_contents(encrypted_fs_data->salt, ENCRYPTED_FS_SALT_SIZE,
+            encrypted_fs_salt_file_name, &(encrypted_fs_data->salt_length));
+    if (result != 0) {
+        LOGE("Secure FS: error reading file system salt.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    result = get_binary_file_contents(encrypted_fs_data->hash, ENCRYPTED_FS_MAX_HASH_SIZE,
+            encrypted_fs_hash_file_src_name, &(encrypted_fs_data->hash_length));
+    if (result != 0) {
+        LOGE("Secure FS: error reading password hash.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    result = get_binary_file_contents(encrypted_fs_data->entropy, ENTROPY_MAX_SIZE,
+            encrypted_fs_entropy_file_src_name, &(encrypted_fs_data->entropy_length));
+    if (result != 0) {
+        LOGE("Secure FS: error reading ported entropy.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    result = ensure_root_path_unmounted("DATA:");
+    if (result != 0) {
+        LOGE("Secure FS: error unmounting data partition.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    return ENCRYPTED_FS_OK;
+}
+
+int restore_encrypted_fs_info(encrypted_fs_info *encrypted_fs_data) {
+    int result;
+    result = ensure_root_path_mounted("DATA:");
+    if (result != 0) {
+        LOGE("Secure FS: error mounting userdata partition.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    // Write the pre-generated secure FS key, password hash and salt.
+    result = set_binary_file_contents(encrypted_fs_data->key, ENCRYPTED_FS_KEY_SIZE,
+            encrypted_fs_key_file_name);
+    if (result != 0) {
+        LOGE("Secure FS: error writing generated file system key.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    result = set_binary_file_contents(encrypted_fs_data->salt, encrypted_fs_data->salt_length,
+        encrypted_fs_salt_file_name);
+    if (result != 0) {
+        LOGE("Secure FS: error writing file system salt.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    result = set_binary_file_contents(encrypted_fs_data->hash, encrypted_fs_data->hash_length,
+            encrypted_fs_hash_file_dst_name);
+    if (result != 0) {
+        LOGE("Secure FS: error writing password hash.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    result = set_binary_file_contents(encrypted_fs_data->entropy, encrypted_fs_data->entropy_length,
+            encrypted_fs_entropy_file_dst_name);
+    if (result != 0) {
+        LOGE("Secure FS: error writing ported entropy.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    // Set the secure FS properties to their respective values
+    result = write_encrypted_fs_boolean_property(encrypted_fs_enabled_property, encrypted_fs_data->mode);
+    if (result != 0) {
+        return result;
+    }
+
+    result = ensure_root_path_unmounted("DATA:");
+    if (result != 0) {
+        LOGE("Secure FS: error unmounting data partition.");
+        return ENCRYPTED_FS_ERROR;
+    }
+
+    return ENCRYPTED_FS_OK;
+}
+
diff --git a/encryptedfs_provisioning.h b/encryptedfs_provisioning.h
new file mode 100644
index 0000000..284605d
--- /dev/null
+++ b/encryptedfs_provisioning.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+
+#ifndef __ENCRYPTEDFS_PROVISIONING_H__
+#define __ENCRYPTEDFS_PROVISIONING_H__
+
+#define MODE_ENCRYPTED_FS_DISABLED    0
+#define MODE_ENCRYPTED_FS_ENABLED     1
+
+#define ENCRYPTED_FS_OK               0
+#define ENCRYPTED_FS_ERROR          (-1)
+
+#define ENCRYPTED_FS_KEY_SIZE        16
+#define ENCRYPTED_FS_SALT_SIZE       16
+#define ENCRYPTED_FS_MAX_HASH_SIZE  128
+#define ENTROPY_MAX_SIZE        4096
+
+struct encrypted_fs_info {
+    int mode;
+    char key[ENCRYPTED_FS_KEY_SIZE];
+    char salt[ENCRYPTED_FS_SALT_SIZE];
+    int salt_length;
+    char hash[ENCRYPTED_FS_MAX_HASH_SIZE];
+    int hash_length;
+    char entropy[ENTROPY_MAX_SIZE];
+    int entropy_length;
+};
+
+typedef struct encrypted_fs_info encrypted_fs_info;
+
+int read_encrypted_fs_info(encrypted_fs_info *secure_fs_data);
+
+int restore_encrypted_fs_info(encrypted_fs_info *secure_data);
+
+#endif /* __ENCRYPTEDFS_PROVISIONING_H__ */
+
diff --git a/recovery.c b/recovery.c
index 4c437e5..2454a07 100644
--- a/recovery.c
+++ b/recovery.c
@@ -36,15 +36,14 @@
 #include "minzip/DirUtil.h"
 #include "roots.h"
 #include "recovery_ui.h"
-#include "efs_migration.h"
+#include "encryptedfs_provisioning.h"
 
 static const struct option OPTIONS[] = {
   { "send_intent", required_argument, NULL, 's' },
   { "update_package", required_argument, NULL, 'u' },
   { "wipe_data", no_argument, NULL, 'w' },
   { "wipe_cache", no_argument, NULL, 'c' },
-  // TODO{oam}: implement improved command line passing key, egnor to review.
-  { "set_encrypted_filesystem", required_argument, NULL, 'e' },
+  { "set_encrypted_filesystems", required_argument, NULL, 'e' },
   { NULL, 0, NULL, 0 },
 };
 
@@ -111,9 +110,9 @@
  *        -- after this, rebooting will (try to) restart the main system --
  * 9. main() calls reboot() to boot main system
  *
- * ENCRYPTED FILE SYSTEMS ENABLE/DISABLE
+ * SECURE FILE SYSTEMS ENABLE/DISABLE
  * 1. user selects "enable encrypted file systems"
- * 2. main system writes "--set_encrypted_filesystem=on|off" to
+ * 2. main system writes "--set_encrypted_filesystems=on|off" to
  *    /cache/recovery/command
  * 3. main system reboots into recovery
  * 4. get_args() writes BCB with "boot-recovery" and
@@ -471,10 +470,10 @@
     int previous_runs = 0;
     const char *send_intent = NULL;
     const char *update_package = NULL;
-    const char *efs_mode = NULL;
+    const char *encrypted_fs_mode = NULL;
     int wipe_data = 0, wipe_cache = 0;
-    int toggle_efs = 0;
-    encrypted_fs_info efs_data;
+    int toggle_secure_fs = 0;
+    encrypted_fs_info encrypted_fs_data;
 
     int arg;
     while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {
@@ -484,7 +483,7 @@
         case 'u': update_package = optarg; break;
         case 'w': wipe_data = wipe_cache = 1; break;
         case 'c': wipe_cache = 1; break;
-        case 'e': efs_mode = optarg; toggle_efs = 1; break;
+        case 'e': encrypted_fs_mode = optarg; toggle_secure_fs = 1; break;
         case '?':
             LOGE("Invalid command argument\n");
             continue;
@@ -504,12 +503,12 @@
 
     int status = INSTALL_SUCCESS;
 
-    if (toggle_efs) {
-        if (strcmp(efs_mode,"on") == 0) {
-            efs_data.encrypted_fs_mode = MODE_ENCRYPTEDFS_ENABLED;
+    if (toggle_secure_fs) {
+        if (strcmp(encrypted_fs_mode,"on") == 0) {
+            encrypted_fs_data.mode = MODE_ENCRYPTED_FS_ENABLED;
             ui_print("Enabling Encrypted FS.\n");
-        } else if (strcmp(efs_mode,"off") == 0) {
-            efs_data.encrypted_fs_mode = MODE_ENCRYPTEDFS_DISABLED;
+        } else if (strcmp(encrypted_fs_mode,"off") == 0) {
+            encrypted_fs_data.mode = MODE_ENCRYPTED_FS_DISABLED;
             ui_print("Disabling Encrypted FS.\n");
         } else {
             ui_print("Error: invalid Encrypted FS setting.\n");
@@ -518,10 +517,10 @@
 
         // Recovery strategy: if the data partition is damaged, disable encrypted file systems.
         // This preventsthe device recycling endlessly in recovery mode.
-        // TODO{oam}: implement improved recovery strategy later. egnor to review.
-        if (read_encrypted_fs_info(&efs_data)) {
+        if ((encrypted_fs_data.mode == MODE_ENCRYPTED_FS_ENABLED) &&
+                (read_encrypted_fs_info(&encrypted_fs_data))) {
             ui_print("Encrypted FS change aborted, resetting to disabled state.\n");
-            efs_data.encrypted_fs_mode = MODE_ENCRYPTEDFS_DISABLED;
+            encrypted_fs_data.mode = MODE_ENCRYPTED_FS_DISABLED;
         }
 
         if (status != INSTALL_ERROR) {
@@ -531,7 +530,8 @@
             } else if (erase_root("CACHE:")) {
                 ui_print("Cache wipe failed.\n");
                 status = INSTALL_ERROR;
-            } else if (restore_encrypted_fs_info(&efs_data)) {
+            } else if ((encrypted_fs_data.mode == MODE_ENCRYPTED_FS_ENABLED) &&
+                      (restore_encrypted_fs_info(&encrypted_fs_data))) {
                 ui_print("Encrypted FS change aborted.\n");
                 status = INSTALL_ERROR;
             } else {
