updatedb.mlocate hangs on stale NFS mounts (Proxmox)

After properly configuring postfix on the Proxmox hosts to send email, emails to root were noticed daily:

/etc/cron.daily/mlocate:
 /usr/bin/updatedb.mlocate: `/var/lib/mlocate/mlocate.db' is locked (probably by an earlier updatedb)
 run-parts: /etc/cron.daily/mlocate exited with return code 1

After logging on to one of the boxes, killing (-9) the updatedb process and running it with verbose on:

updatedb.mlocate -v

The output indicated it was hanging on one of the ”/mnt” directories. Looking at the output of ”mount” a couple of old nfs shares were noticed, that should have been deleted (and didn’t appear in the GUI). Unmounting these shares made updatedb run happily.

If the unmount complains the device is busy, check the updatedb.mlocate process has been killed.

Published by

Jamie Scott

IT Administrator at the Institute for Gravitational Research, University of Glasgow