lock/unlock a partition in PartitionManager.