Unmount system after boot, backup, and restore
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index b3c6adc..101f6f4 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -86,6 +86,7 @@
 			LOGI("Error creating fstab\n");
 	}
 	Update_System_Details();
+	UnMount_Main_Partitions();
 	return true;
 }
 
@@ -873,6 +874,7 @@
 
 	ui_print("[%llu MB TOTAL BACKED UP]\n", actual_backup_size);
 	Update_System_Details();
+	UnMount_Main_Partitions();
 	ui_print("[BACKUP COMPLETED IN %d SECONDS]\n\n", total_time); // the end
     return true;
 }
@@ -1071,6 +1073,7 @@
 
 	TWFunc::GUI_Operation_Text(TW_UPDATE_SYSTEM_DETAILS_TEXT, "Updating System Details");
 	Update_System_Details();
+	UnMount_Main_Partitions();
 	time(&rStop);
 	ui_print("[RESTORE COMPLETED IN %d SECONDS]\n\n",(int)difftime(rStop,rStart));
 	return true;
@@ -1543,6 +1546,7 @@
 			// Sleep for a bit so that the device will be ready
 			sleep(1);
 			Update_System_Details();
+			UnMount_Main_Partitions();
 		} else
 			LOGE("Unable to locate data partition.\n");
 	}
@@ -1702,6 +1706,21 @@
 	}
 }
 
+void TWPartitionManager::UnMount_Main_Partitions(void) {
+	// Unmounts system and data if data is not data/media
+	// Also unmounts boot if boot is mountable
+	LOGI("Unmounting main partitions...\n");
+
+	TWPartition* Boot_Partition = Find_Partition_By_Path("/boot");
+
+	UnMount_By_Path("/system", true);
+#ifndef RECOVERY_SDCARD_ON_DATA
+	UnMount_By_Path("/data", true);
+#endif
+	if (Boot_Partition != NULL && Boot_Partition->Can_Be_Mounted)
+		Boot_Partition->UnMount(true);
+}
+
 int TWPartitionManager::Partition_SDCard(void) {
 	char mkdir_path[255], temp[255], line[512];
 	string Command, Device, fat_str, ext_str, swap_str, start_loc, end_loc, ext_format, sd_path, tmpdevice;