parted utility somehow detects the file system on partitions on my GPT disk:I guess it does not do this based on partition type codes(seen in the gdisk output) because those would be 27(Hidden NTFS Win) for partitions 1, 5, 6, 7 and for example ef(EFI) for /dev/sda2 but in parted output there are clearly different file systems listed.
How does parted know the file-system type for GPT partitions?
gpt;parted
It looks at the data on the partition, similar to what file -s /dev/partition does. If you strace it you should see things like this:lseek(3, 1048576, SEEK_SET) = 1048576read(3, \353<\220mkfs.fat\0\2\10..., 512) = 512A seek to position 1048576 (1 MiB or 2048 sectors) is outside the partition table (it's the start of the first partition), and it reads from there, so it's looking at other things than just the partition table itself.It also looks at /proc/mounts, so it could collect information from there as well. What I don't see it doing is what blkid does.The filesystem information shown by parted is not terribly accurate, the above example shows as FAT filesystem but it's actually being used as MD-RAID / LUKS / LVM. The metadata of MD-RAID is 4k from the start so an old FAT header in the first 4k might survive and confuse heuristics like those of file or parted...