Thanks a lot to all for your answers.
From a console you would do something like this
udevadm info --name=/dev/sdf --query=property | grep ID_FS_TYPE
I tried it, but I faced 2 problems:
- you must specify the correct "--name=/dev/sd
?", but my program knows only, in which folder the USB-drive is mounted, e.g. /media/hg6/TOSHIBA EXT/. I'm a beginner to Linux. How can my program find the corresponding "--name=/dev/sd
?" for a known mounted folder?
- I searched for the correct "--name=" manually, which was "--name=/dev/sdd", but the output did not contain something similar to "ID_FS_TYPE". I attached the output of a 500 GB FAT32 USB-drive. I'm using Ubuntu 18.04
my version of console output:
lsblk -n -o FSTYPE /dev/sdb5
After finding out the correct "/dev/sdd" it worked perfectly.
But I face the same problem as above: How can my program find the corresponding "/dev/sd
?" for a known mounted folder?
Thanks for your help.