USB Partition - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: USB Partition (/showthread.php?tid=1171) |
USB Partition - marc - 11.01.2018 Hi, I have a problem with writing logs to a USB stick. The stick is connected to my Homelynk (FW 2.1.0) via a dlink DUB H4 USB hub. After approximately one week Homelynk loses the connection to the stick so the log file cannot be accessed. When I try to access the stick via ftp client it is also not accessible. I’ve been watching this behavior when the stick was connected with or without the USB hub. When I run the init script to mount the partition again it will work. What is causing this behavior and how can I solve this problem? My idea is to let the writing script check if the partition is accessible, but I don’t know how. If it isn’t accessible the script could try to mount the partition and write to the log file. Would this work with Code: dev = io.readproc('ls /dev/sd*1 2>/dev/null'):match('/dev/sd%l1') from the init script or will this order find the stick in any case since it is physically connected? The second idea is to check cyclically if the stick is accessible and give an alert if it is not. Last but not least I could run the mounting script every 12 hours or so, but every time I run the script an additional line appears which shows the partition in the system status. Is this a problem in any case? Maybe the problem is the stick itself. I don’t know who the manufacturer of this stick is. Does anyone have a suggestion which stick will work reliable? Thank you guys RE: USB Partition - admin - 11.01.2018 Most USB drives are not very reliable and certainly are not meant for 24/7 operation. What you can do (if you have a scheduled script for writing data) is to unmount the device after each write. RE: USB Partition - marc - 11.01.2018 That is a good idea. Maybe you should consider to mention that point in your examples. Thank you Admin |