Most duplicate disk_ops use ped_disk_new_fresh, which sets needs_clobber
to 1. This would lead to clobbering the disk when committing a duplicate
disk even when the original disk was not made with ped_disk_new_fresh.
* libparted/disk.c (ped_disk_duplicate): Copy the needs_clobber member.
* NEWS (Bug fixes): Describe it.
or a user might encounter a failure to format or delete a newly
created partition, respectively.
+ libparted: committing a disk that was returned by ped_disk_duplicate
+ would always result in ped_disk_clobber being called (and thus the first
+ and last 9KiB of the disk being zeroed), even if the duplicated disk,
+ was not returned by ped_disk_fresh().
+
* Noteworthy changes in release 2.1 (2009-12-20) [stable]
}
if (!_disk_pop_update_mode (new_disk))
goto error_destroy_new_disk;
+
+ new_disk->needs_clobber = old_disk->needs_clobber;
+
return new_disk;
error_destroy_new_disk: