diff --git a/src/adv.c b/src/adv.c index 39f61921..e3a0eaeb 100644 --- a/src/adv.c +++ b/src/adv.c @@ -803,6 +803,7 @@ int fat32_boot_sector(disk_t *disk_car, partition_t *partition, const int verbos { display_message("Write error: Can't overwrite FAT32 backup boot sector\n"); } + disk_car->sync(disk_car); rescan=1; } break; @@ -814,6 +815,7 @@ int fat32_boot_sector(disk_t *disk_car, partition_t *partition, const int verbos { display_message("Write error: Can't overwrite FAT32 boot sector\n"); } + disk_car->sync(disk_car); rescan=1; } break; @@ -1039,6 +1041,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose { display_message("Write error: Can't overwrite NTFS backup boot sector\n"); } + disk_car->sync(disk_car); rescan=1; } break; @@ -1050,6 +1053,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose { display_message("Write error: Can't overwrite NTFS boot sector\n"); } + disk_car->sync(disk_car); rescan=1; } break; @@ -1260,6 +1264,7 @@ int HFS_HFSP_boot_sector(disk_t *disk_car, partition_t *partition, const int ver { display_message("Write error: Can't overwrite HFS/HFS+ backup superblock\n"); } + disk_car->sync(disk_car); rescan=1; } break; @@ -1271,6 +1276,7 @@ int HFS_HFSP_boot_sector(disk_t *disk_car, partition_t *partition, const int ver { display_message("Write error: Can't overwrite HFS/HFS+ main superblock\n"); } + disk_car->sync(disk_car); rescan=1; } break; diff --git a/src/fat_adv.c b/src/fat_adv.c index 6e9bddcf..ce0aedc5 100644 --- a/src/fat_adv.c +++ b/src/fat_adv.c @@ -1022,6 +1022,7 @@ static void menu_write_fat_boot_sector(disk_t *disk_car, partition_t *partition, if(disk_car->write(disk_car,DEFAULT_SECTOR_SIZE, newboot, partition->part_offset)!=0) err=1; } + disk_car->sync(disk_car); if(err==1) { display_message("Write error: Can't write new FAT boot sector\n"); @@ -2917,6 +2918,10 @@ int repair_FAT_table(disk_t *disk_car, partition_t *partition, const int verbose { display_message("FATs seems Ok, nothing to do.\n"); } + else + { + disk_car->sync(disk_car); + } #ifdef HAVE_NCURSES delwin(window); (void) clearok(stdscr, TRUE); diff --git a/src/intrf.c b/src/intrf.c index fe8da3a3..d26489fc 100644 --- a/src/intrf.c +++ b/src/intrf.c @@ -1467,7 +1467,7 @@ static int interface_partition_type_ncurses(disk_t *disk_car) struct MenuItem menuOptions[]= { { 'I', arch_i386.part_name, "Intel/PC partition" }, - { 'G', arch_gpt.part_name, "EFI GPT partition map (Mac i386, x86_64...)" }, + { 'G', arch_gpt.part_name, "EFI GPT partition map (Mac i386, some x86_64...)" }, { 'M', arch_mac.part_name, "Apple partition map" }, { 'N', arch_none.part_name, "Non partitioned media" }, { 'S', arch_sun.part_name, "Sun Solaris partition"}, diff --git a/src/ntfs_adv.c b/src/ntfs_adv.c index c049cbf7..1f682b15 100644 --- a/src/ntfs_adv.c +++ b/src/ntfs_adv.c @@ -141,6 +141,7 @@ static void menu_write_ntfs_boot_sector_cli(disk_t *disk_car, partition_t *parti { display_message("Write error: Can't write new NTFS backup boot sector\n"); } + disk_car->sync(disk_car); } return ; } @@ -208,6 +209,7 @@ static void menu_write_ntfs_boot_sector_ncurses(disk_t *disk_car, partition_t *p { display_message("Write error: Can't write new NTFS backup boot sector\n"); } + disk_car->sync(disk_car); } return; case 'd': diff --git a/src/ntfs_fix.c b/src/ntfs_fix.c index 688a95f9..ac93ba45 100644 --- a/src/ntfs_fix.c +++ b/src/ntfs_fix.c @@ -193,6 +193,7 @@ int repair_MFT(disk_t *disk_car, partition_t *partition, const int verbose, char } else { + disk_car->sync(disk_car); log_info("MFT mirror fixed.\n"); display_message("MFT mirror fixed.\n"); } @@ -214,6 +215,7 @@ int repair_MFT(disk_t *disk_car, partition_t *partition, const int verbose, char } else { + disk_car->sync(disk_car); log_info("MFT fixed.\n"); display_message("MFT fixed.\n"); } diff --git a/src/ntfs_io.c b/src/ntfs_io.c index 1271b079..aa2436e1 100644 --- a/src/ntfs_io.c +++ b/src/ntfs_io.c @@ -119,9 +119,8 @@ static s64 ntfs_device_testdisk_io_write(struct ntfs_device *dev, const void *bu static int ntfs_device_testdisk_io_sync(struct ntfs_device *dev) { - log_warning("ntfs_device_testdisk_io_sync() unimplemented\n"); - errno = ENOTSUP; - return -1; + my_data_t *my_data=(my_data_t*)dev->d_private; + return my_data->disk_car->sync(my_data->disk_car); } static int ntfs_device_testdisk_io_stat(struct ntfs_device *dev, struct stat *buf) diff --git a/src/partgpt.c b/src/partgpt.c index 09d5f777..7919a754 100644 --- a/src/partgpt.c +++ b/src/partgpt.c @@ -511,6 +511,7 @@ static int write_part_gpt(disk_t *disk_car, const list_part_t *list_part, const free(gpt); free(gpt_entries); write_part_gpt_i386(disk_car, list_part); + disk_car->sync(disk_car); return 0; } diff --git a/src/parti386.c b/src/parti386.c index 088ba52e..cb82117d 100644 --- a/src/parti386.c +++ b/src/parti386.c @@ -626,6 +626,7 @@ int write_part_i386(disk_t *disk_car, const list_part_t *list_part, const int ro int res=0; res+=write_mbr_i386(disk_car,list_part,ro,verbose); res+=write_all_log_i386(disk_car,list_part,ro,verbose,align); + disk_car->sync(disk_car); return res; } @@ -890,6 +891,7 @@ static int write_MBR_code_i386(disk_t *disk_car) { return 1; } + disk_car->sync(disk_car); return 0; } @@ -1559,6 +1561,7 @@ static int erase_list_part_i386(disk_t *disk_car) { return 1; } + disk_car->sync(disk_car); return 0; }