def is_linux_fs_type(device):
 disk_device = device.rstrip('0123456789')
 fdisk_fd = os.popen(("/sbin/fdisk -l -u '%s'" % disk_device))
 fdisk_lines = fdisk_fd.readlines()
 fdisk_fd.close()
 for line in fdisk_lines:
  if (not line.startswith(device)):
   continue
  info_tuple = line.split()
  for fsinfo in info_tuple[4:6]:
   if (fsinfo == '83'):
    return True
 return False

def is_linux_fs_type ( device ) : disk_device = device . rstrip ( '0123456789' ) fdisk_fd = os . popen ( ( "/sbin/fdisk -l -u '%s'" % disk_device ) ) fdisk_lines = fdisk_fd . readlines ( ) fdisk_fd . close ( ) for line in fdisk_lines : if ( not line . startswith ( device ) ) : continue info_tuple = line . split ( ) for fsinfo in info_tuple [ 4 : 6 ] : if ( fsinfo == '83' ) : return True return False
checks if specified partition is type 83 .