Scholarly libraries actually used to chain rare books to shelves to ensure they weren't stolen! This was very common in monasteries and medieval libraries in particular. It's possible that only the valuable books are chained, which is why Sam is still seen shelving, or it's possible that they don't use them anymore…