Minicom: device /dev/ttyS0 is locked

Posted on in System Administration

It seems like I have been working with Mac OS X serial ports a lot lately. Since the Mac in question is hundreds of miles away, I've been doing all of this via the command line using tools like kermit and minicom. One error that we ran into recently was the following:

$ minicom
Device /dev/cu.PL2303-0000105D is locked.

This error is the result of a lock file hanging around. If you don't know the location of the lock file, it might be helpful to check your local minicom configuration file to see if it has been moved:

$ cat .minirc.dfl 
# Machine-generated file - use setup menu in minicom to change parameters.
pu port             /dev/cu.PL2303-0000105D
pu lock             /tmp
pu baudrate         9600
pu scriptprog       runscript
pu minit            ~^M~
pu rtscts           No

As you can see, the configuration file indicates /tmp is the lock directory. Lo and behold:

$ ls /tmp
LCK..cu.PL2303-0000105D

If the application is running, you should try to shut it down cleanly. If not, deleting the lock file should solve your problem.

Slaptijack's Koding Kraken