Less Known Solaris features: lockfs

Okay, quite often the configuration of a feature or application mandates that the data on the disk doesn´t change while you activate it. Okay, an easy way would be simply unmounting the disk. Okay, that´s possible but then you can´t access the data on the disk at all. You can´t even read from the filesystem, albeit this doesn´t change anything on the disk (okay, as long you´ve mounted the disk with noatime).
So: How do you ensure, that the content of a filesystem doesn´t change while you work with the disk. ufs has a an interesting feature. It´s called lockfs you can lock the filesystem. You can lock it to an extend that you can only unmount and remount it to gather access to the data, but you can lock only some ways to access it.

Types of Locks

The lockfs command can establish a number of locks on an UFS filesystem: