GNOME Bugzilla – Bug 755495
GParted allowing partitioning of large sector devices specified on the command line, when built with old libparted which doesn't support it
Last modified: 2015-10-27 17:04:28 UTC
When GParted is built with an old version of libparted (pre version 2.2 which doesn't support large sector drives) it it meant to ignore drives with sector sizes greater than 512 bytes. However it only ignores such drives when scanning for drives, not when they are specified on the command line. Effects at least these still supported distributions with old versions of libparted: * RHEL/CentOS 6 with libparted 2.1 * RHEL/CentOS 5 with libparted 1.8.1 Correctly ignoring when scanning: [root@centos6 ~]# modprobe scsi_debug dev_size_mb=128 sector_size=4096 [root@centos6 ~]# ~centos/bin/gpartedbin-0.23.0 ====================== libparted : 2.1 ====================== Device /dev/sdd has a logical sector size of 4096. Not all parts of GNU Parted support this at the moment, and the working code is HIGHLY EXPERIMENTAL. Ignoring device /dev/sdd with logical sector size of 4096 bytes. GParted requires libparted version 2.2 or higher to support devices with sector sizes larger than 512 bytes. Incorrectly allowing operation on large sector drive when specified on the command line: [root@centos6 ~]# ~centos/bin/gpartedbin-0.23.0 /dev/sdd ====================== libparted : 2.1 ====================== Device /dev/sdd has a logical sector size of 4096. Not all parts of GNU Parted support this at the moment, and the working code is HIGHLY EXPERIMENTAL. /dev/sdd: unrecognised disk label
Created attachment 312753 [details] [review] Validate command line named disk devices (v1) Hi Curtis, Here's the patchset for this. So if a user does specific just one device on the command line which is a large sector device and libparted is too old to handle it, there will be a message on the console reporting the device ignored, as seen in comment 1 above, and the GParted UI will show "No devices detected" in the status bar. In the end I didn't do as much refactoring as I suggested I might do, to Wrolf in bug 755429 comment 3. Further refactoring of set_devices_thread() belongs under that bug not this. I'll do that refactoring and post it into bug 755429. Thanks, Mike
Hi Mike, Good catch on the difference in handling between GParted auto-determining devices and when device paths are passed on the command line. I hadn't even thought of a user passing the same device path twice. I tested patch set v1 on Kubuntu 12.04 and also Fedora 13 (had parted 2.1) and all went well. Patch set v1 from comment #1 has been committed to the git repository for inclusion in the next release of GParted. The relevant git commits can be viewed at the following links: Create new method GParted_Core::useable_device() (#755495) https://git.gnome.org/browse/gparted/commit/?id=037020b1162a2d61576fb80fdea54522533c93f1 Check disks named on the command line are safe to use too (#755495) https://git.gnome.org/browse/gparted/commit/?id=362b2db331b4c31a978bb67232fa7f3ce9ab38c3 Sort command line named disk devices and remove duplicates (#755495) https://git.gnome.org/browse/gparted/commit/?id=3d3d98994bd1b3fc56260b65e576cf0f8d6a50ea Ensure DMRaid /dev entries are created before using named devices https://git.gnome.org/browse/gparted/commit/?id=23b5ba4e4e45a384038f6c25a94715d1ff733a79 Thanks, Curtis
This enhancement was included in the GParted 0.24.0 release on October 27, 2015.