PDA

View Full Version : Identify and format usb drive



RolandHughes
1st February 2013, 14:52
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

wysota
1st February 2013, 15:52
D-Bus should contain all information you need. I can see org.freedesktop.UDisks2 interface might contain what you need.

anda_skoa
4th February 2013, 11:24
Or check how KDE's Solid framework or rather its Linux backend handle that

Cheers,
_