This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

USB Drive
#1
Hi, is there any way of programmatically reading the status of a USB drive ie, is it healthy and read to write?
I had a corrupted drive and no obvious way of knowing until things stopped working.

Thanks

Dave
Reply
#2
There's no way of knowing if the USB drive is fully operational or not. You can only check if it is mounted or not:
Code:
mounted = io.readfile('/proc/mounts'):match('/dev/sd') ~= nil
log(mounted)
Using USB drives is not recommended because they are not designed for 24/7 operation. A preferred way is to use network storage or cloud solutions.
Reply


Forum Jump: