sync memory and filesystem
diff --git a/nandroid.c b/nandroid.c
index 08f3ec2..56971c0 100644
--- a/nandroid.c
+++ b/nandroid.c
@@ -120,6 +120,7 @@
     sprintf(tmp, "md5sum %s/*img > %s/nandroid.md5", backup_path, backup_path);
     __system(tmp);
     
+    sync();
     ui_set_background(BACKGROUND_ICON_NONE);
     ui_reset_progress();
     ui_print("Backup complete!\n");
@@ -176,6 +177,7 @@
     if (0 != unyaffs(tmp, "/cache", yaffs_callback))
         return print_and_error("Error while restoring /cache!\n");
         
+    sync();
     ui_set_background(BACKGROUND_ICON_NONE);
     ui_reset_progress();
     ui_print("Restore complete!\n");