psutil is a cross-platform package which can identify partition types:
>>> psutil.disk_partitions()
[sdiskpart(device='/dev/sda1', mountpoint='/', fstype='ext4', opts='rw,nosuid'),
sdiskpart(device='/dev/sda2', mountpoint='/home', fstype='ext4', opts='rw')]
Warning: On linux, the fstype may be reported as ext4
or ntfs
, but on Windows, the fstype is limited to "removable", "fixed", "remote", "cdrom", "unmounted" or "ramdisk"
.