Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Activate and Deactivate

hse-project edited this page Apr 21, 2020 · 1 revision

An mpool is activated at the time it is created, which is to say that it is made online and accessible by a client application. However, there are times when it may be necessary or desirable to deactivate an mpool, rendering it offline.

For example, an mpool must be deactivated to grow a volume used for one of its media classes. Deactivating an mpool frees up any kernel resources it consumes, so it may be desirable to deactivate mpools that are not in use.

The following examples demonstrate deactivating and then activating mpools. These examples continue working with the mpools created in prior examples.

Deactivate

The mpool deactivate command deactivates a specified mpool.

$ sudo mpool deactivate mp2
$ sudo mpool list
MPOOL    TOTAL    USED   AVAIL  CAPACITY  LABEL    HEALTH
mp1      1.00t   1.16g    972g     0.12%    raw   optimal
mp2       0.00    0.00    0.00     0.00%      -   offline

The mpool scan command optionally deactivates all mpools.

$ sudo mpool scan --deactivate
$ sudo mpool list
MPOOL    TOTAL    USED   AVAIL  CAPACITY  LABEL    HEALTH
mp2       0.00    0.00    0.00     0.00%      -   offline
mp1       0.00    0.00    0.00     0.00%      -   offline

No detailed information is available for deactivated mpools.

Activate

The mpool activate command activates a specified mpool, rendering it online and accessible by a client application.

$ sudo mpool activate mp1
$ sudo mpool list
MPOOL    TOTAL    USED   AVAIL  CAPACITY  LABEL    HEALTH
mp1      1.00t   1.16g    972g     0.12%    raw   optimal
mp2       0.00    0.00    0.00     0.00%      -   offline

Detailed information is again available for mpool mp1 now that it is activated.

The mpool scan command optionally activates all mpools.

$ sudo mpool scan --activate
$ sudo mpool list
MPOOL    TOTAL    USED   AVAIL  CAPACITY  LABEL    HEALTH
mp1      1.00t   1.16g    972g     0.12%    raw   optimal
mp2      1.20t    632m   1.13t     0.05%    raw   optimal

When mpool is installed on a system, a systemd mpool.service unit file is installed which executes mpool scan --activate at boot.

Clone this wiki locally