Site menu:


Site search

Unlocking A GRASS Mapset

If you’ve used GRASS at all, you’ve probably seen a message that looks like this:

"Cannot open the mapset. Mapset is already in use.

"Cannot open the mapset. Mapset is already in use."

Depending on which version of GRASS you’re running, or your OS, the dialog box may look different (this one shown is from a GRASS session running inside QGIS; coincidentally my fvourite way to run GRASS….) but the message will be the same, reading “Cannot open the mapset. Mapset is already in use.” So, what does it mean? It means that for some reason (likely due to a system crash, improper exiting of the program, or a hung module…) your previous GRASS session was not properly closed.  As GRASS was originally designed for a multi-user environment, it protects each individual mapset from being edited by more than one person by locking it when it is opened. It unlocks the mapset when it is closed; unless something goes wrong as I mentioned above.

When this does happen, you’ll be unable to use the mapset, even though you know no one else is using it. So what do you do? It’s easy really!

Browse to the mapset in your OS filesystem. There should be a file called ‘.gislock’ there. Delete it. You should then be able to open your mapset normally!

Note that you are just doing what GRASS does normally when it works properly; .gislock is the file created when you open a mapset, and when a mapset is closed properly, it is deleted. You deleting it manually won’t change or break anything. Just be careful not to touch any of the other files in the mapset!

There you go! It’s just that easy!


Comment from paul
Time August 16, 2011 at 8:35 pm

Awesome, thanks for posting this. Have already wasted an hour trying to figure this out myself!

Comment from darrencope
Time August 17, 2011 at 7:05 am

Glad to help out Paul! You’ll never waste time on it again! :)

Comment from Rita
Time March 18, 2013 at 10:42 am

I cant find that .gislock file.
WHich steps do i have to follow?

Comment from darrencope
Time March 18, 2013 at 10:47 am

Rita: You may have to enable the “Show hidden files and folders” option in Widows explorer to see the .gislock file.

Write a comment