Identify and format usb drive
Hello,
Looking for advice on how to identify and format usb thumb drive. Actually, my code currently monitors the /media directory and correctly handles insert/remove. The problem is you need the physical device to format.
Target is Linux only. (initially Ubuntu, but different Debian based distro for final.)
I have lots of command line instructions for fat formatting a usb device, but, I need the /dev/whatever path for that. I'm poking around with the udev stuff, but documentation seems a bit sparse.
Thanks
Re: Identify and format usb drive
D-Bus should contain all information you need. I can see org.freedesktop.UDisks2 interface might contain what you need.
Re: Identify and format usb drive
Or check how KDE's Solid framework or rather its Linux backend handle that
Cheers,
_