What is Gparted doing when scanning for partitions?
Gparted is extremely more slow when looking for partitions than any command line counterpart.
Can anybody explain to me what is Gparted doing that the other tools do not do, in this time?
Here are two GIFs to show this difference
Gparted
sudo parted -l
GParted scans through all devices using libparted and third-party tools. It not only reads the partition table, it looks for many things such as for file systems, labels, UUIDs, whether the partition is in use, where the partition is mounted or active, how much free space is available within the file system and within the partition, is the file system encrypted, and is the partition part of a Logical Volume Manager and if so the volume group details.
Tools like fdisk or gdisk read the partition table.
Parted reads the partition table and tries to determine the type of file system.
For exact commands/arguments/parameters used by GParted I suggest reading the source code starting with GParted_Core::set_devices_thread because this is where scanning of device and partition information begins.
Look at output of dmesg when it's doing so. I found out that it's desperately trying to read some USB card reader (which was empty). I unplugged the card reader and restarted gparted and it worked.