# pool.dataset.lock

Locks `id` dataset. It will unmount the dataset and its children before locking.

After the dataset has been unmounted, system will set immutable flag on the dataset’s mountpoint where the dataset was mounted before it was locked making sure that the path cannot be modified. Once the dataset is unlocked, it will not be affected by this change and consumers can continue consuming it.

This method is a job.

Type: object

##

Type: array
No Additional Items

#### Tuple Validation

##### Parameter 1: id

#### id

Type: string

The dataset ID (full path) to lock.

##### Parameter 2: options

#### options

Type: object

Options for locking the dataset, such as force unmount settings.

No Additional Properties

##

#### Force Umount

Type: boolean Default: false

Force unmounting of the dataset before locking.

##

#### Result

Type: const

Dataset is locked.

Specific value: `true`

Required roles: DATASET_WRITE