Issue 487 db

This is ready for initial review. Thanks. 
Is there a use for this ID or can a natural PK be formed from, say, `(type, mountpoint, subdirectory)`?