On 2016-10-20 11:25, jdd wrote:
Le 20/10/2016 à 11:08, Carlos E. R. a écrit :
I don't know if that is what imagewriter writer uses, but it is a start. You can also detect if the device is mounted, and baulk if it is. Or mount and check contents. List on the screen and ask the user to accept.
I tried (since my mail) several solutions, none works as expected. the solution above detects also my 5 Tb disk I don't want to format :-))
I can detect the openSUSE branded USB pen by id
ls /dev/disk/by-id/ | grep Flash_D
seems to detect any of them, whatever is written on it
#ls /dev/disk/by-id/ | grep Flash_D usb-General_USB_Flash_Disk_0531110000000324-0:0 usb-General_USB_Flash_Disk_0531110000000324-0:0-part1
the best one I found now is
blkid -c /dev/null | grep iso9660
that seems to detect iso images. I will probably also detect iso DVD, but these ones can't be erased :-)
to be continued :-)
Yes, checking for a particular string that the ISO images have is a good route. Just now I thought of hdparm -i/-I, but most info fields are blank. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)