I came across an interesting problem the other day. All of a sudden, after saving a particular file to USB on the SINUMERIK 828D (a popular CNC machine controller) all USB drives stopped showing up on the HMI.
After looking through the file browser, you could see that
/user/sinumerik/mnt/USB had the file in it – even when a USB was not plugged in. This is a common problem in the linux world. What probably happened is that for some reason, the HMI, saved the file to
/user/sinumerik/mnt/USB, and then when plugging in the USB drive it would not mount as the directory already existed with files in it.
The next problem was – how do we fix it. We couldn’t delete the folder via the HMI, because there was inadequate permissions (even as the manufacturer user) so the end solution was to remove the system CF card from the unit, mount it on a linux computer (as it’s formatted ex4) with a USB CF card reader and then remove the file. Obviously this is risky, and you should always backup before attempting this. Another solution would be to SSH into the machine as root, but this requires it to be networked, and also the ability to get root access which I couldn’t figure out.
After mounting on a separate computer, we could see that the USB folder existed and had different permissions to the other drive mounts. After deleting the file and putting the CF card back in the 828D, USB drives were able to be mounted again.