The block-devices interface plug provides the ability to perform operations on raw disk block devices, such as:
- /dev/hd* IDE devices (/dev/hda, /dev/hdb, …)
- /dev/sd* SCSI devices (/dev/sda, /dev/sdb, … incl. /dev/sdia, /dev/sdib, …)
- /dev/mmcblk* MMC devices (/dev/mmcblk0, /dev/mmcblk1, …)
- /dev/vd* virtio devices (/dev/vda, /dev/vdb, …)
- /dev/loop* loopback devices (/dev/loop0, /dev/loop1, …)
- including /dev/loop-control device
- /dev/zd* ZFS volumes (/dev/zd0, /dev/zd1, …)
- including /dev/zfs control device
- /dev/nvme*n* NVMe namespace block devices (/dev/nvme0n1…)
- including /dev/nvme* NVMe control devices (/dev/nvme0, /dev/nvme1, …)
Requires snapd version 2.37+.
When the plug sets an optional allow-partitions boolean attribute to true, the interface will grant access to individual partition devices, examples of which include:
- /dev/sda1, /dev/sdb2, …
- /dev/mmcblk0p1, …
- /dev/nvme0n1p2, …
The plug with the attribute needs to be declared in the following manner:
plugs:
block-devices:
allow-partitions: true
The allow-partitions attribute requires snapd version 2.71+.
This interface grants privileged access to the device.
Auto-connect: no
Super-privileged: yes
Consumers of this interface require a snap declaration for distribution via the Snap Store.
ⓘ This is a snap interface. See Interface management and Supported interfaces for further details on how interfaces are used.