Thank you for the detailed response.
With the parted project, the focus is now on partitioning only, and to downplay file system functionality. As you discovered, parted-3.0 removed much file system functionality (all resize ability). Fortunately with parted-3.1 the project added back basic API resize ability, mainly because there are no free software alternatives for resizing FAT16/32 and HFS/+.
Responses to numbered points follow:
1) My preference would be to use the command "wipefs -a /path-to-partition" instead of linking to the libblkid library and calling the appropriate API. By using a command, a user can more easily follow along with the gparted_details.htm log file if they need to manually replicate gparted operations. Also by using a command we do not need to add a hard dependency for an additional library. However, in the case of libblkid, we are increasingly relying on it to provide the file system recognition needed by GParted. As such there may come a time when it makes more sense to link to libblkid for improved error handling and more precise calls directly to the API, rather than being limited to what is available on the command line.
2) Agreed. The order you indicated seems best. :-)
3) Good catch on create_partition() calling erase_filesystem_signatures(). My thoughts are that erasing file system signatures belongs immediately before formatting a partition. If GParted is refactored to work this way, then it will permit users to re-create partition boundaries only. This could be useful if a user deletes a partition and then wants to immediately recreate the lost partition. Currently a user would have to resort to fdisk or gdisk to perform a similar task.
3.1) Agreed that create_partition() should not erase signatures. Instead of adding an extra option to create new partition which formats as "wiped", I think that the "wiped" or "erase file system signatures" should be moved to just before the format operation.
I think we should refactor the code.
Since the remove_filesystem() method already exists, and is called immediately before formatting a partition, we could consider the following logic:
a) Remove the call to erase_filesystem_signatures() from create_partition(), and format().
By removing the call from create_partition, we increase the ability of a user to recover data.
b) Remove the call to remove_file_system from the OPERATION_DELETE in the apply_operation_to_disk() method. This increases the ability of a user to recover data.
EDIT:
I'm not positive about this one. If a user says he wants to delete a partition, then it might be best to delete the filesystem signatures to avoid problems in the future.
c) Enhance remove_filesystem() method logic:
If there is a filesystem specific remove command (fs.remove)
Call the fs.remove
Else if "wipe" exists
Call "wipe"
Else (if ped_clobber_filesystem() available)
Call erase_filesystem_signatures()
3.2) Regarding adding "Partition > [W]ipe" menu, I think that by using the above mentioned changes, the problem with file system signatures should be sufficiently handled.
There probably is a need for a menu command to completely overwrite a partition. This has been requested in Bug 619348 - GParted should have option to shred.
Is this idea something that you would like to work on?
If so I think we should create a bug report for this enhancement. In fact, it might be beneficial to create multiple reports:
a) Improve SSD handling by using TRIM
b) Improve filesystem signature erasure by using WIPE