Erase file system signatures before creating a partition table (#743181)
When writing "loop" partition table over the top of some whole disk device file system types GParted continued to show those whole disk device file systems rather than the virtual unknown partition from the "loop" partition table. This affected btrfs, jfs, reiser4 and reiserfs. It occurred because of several factors: 1) Libparted only zeroed the first and last 9.5 KiB (assuming 512 byte sectors) of the device before writing a new partition table. See ped_disk_clobber(). 2) These file systems have their super blocks and therefore signatures after the first 9.5 KiB. 3) Whole disk device file system detection is performed using blkid before checking for a libparted "loop" partition table. See GParted_Core::set_devices_thread(). Ref: libparted 3.2: disk.c:ped_disk_clobber() http://git.savannah.gnu.org/cgit/parted.git/tree/libparted/disk.c?id=v3.2#n302 Fix by always erasing any possible file system signatures on the device before creating a new "loop" partition table. NOTE: This is typically taking up to 0.5 seconds in my testing on a 5400 RPM hard drive, during which time the GParted UI is hung and the create partition table dialog shows the apply button pressed but no other progress indication. Bug 743181 - Add unpartitioned drive read-write support
parent
e9a5cf28
Please register or sign in to comment