According to medievalist Erik Kwakkel, they used a sort of low-tech GPS system:
A book was tagged with a unique identifier (a shelfmark) that was entered into a searchable database (a library catalogue), which could subsequently be consulted with a handheld device (a portable version of the catalogue).
And now I want one.