installer: Make umounting more reliable

This commit is contained in:
Michael Tremer
2014-08-20 21:16:25 +02:00
parent ae5edf1612
commit ddd32a5cd3
2 changed files with 11 additions and 7 deletions

View File

@@ -779,6 +779,9 @@ int hw_mount_filesystems(struct hw_destination* dest, const char* prefix) {
}
int hw_umount_filesystems(struct hw_destination* dest, const char* prefix) {
// Write all buffers to disk before umounting
hw_sync();
// boot
if (*dest->part_boot) {
hw_umount(dest->part_boot);

View File

@@ -637,6 +637,13 @@ int main(int argc, char *argv[]) {
mysystem(logfile, commandstring);
}
// Umount the destination drive
hw_umount_filesystems(destination, DESTINATION_MOUNT_PATH);
// Stop the RAID array if we are using RAID
if (destination->is_raid)
hw_stop_all_raid_arrays(logfile);
// Umount source drive and eject
hw_umount(SOURCE_MOUNT_PATH);
@@ -671,13 +678,7 @@ EXIT:
free(helpline);
free(sourcedrive);
if (destination) {
hw_sync();
hw_umount_filesystems(destination, DESTINATION_MOUNT_PATH);
free(destination);
}
free(destination);
hw_stop_all_raid_arrays(logfile);