Expand description
§Device management: adding, removing, and querying block devices in a filesystem
Covers adding and removing devices from a mounted filesystem, scanning a device to register it with the kernel, querying per-device I/O error statistics, and checking whether all devices of a multi-device filesystem are present and ready.
Most operations require CAP_SYS_ADMIN.
Structs§
- DevInfo
- Information about a single device within a btrfs filesystem, as returned
by
BTRFS_IOC_DEV_INFO. - DevStats
- Per-device I/O error statistics, as returned by
BTRFS_IOC_GET_DEV_STATS.
Enums§
- Device
Spec - Specifies a device for operations that can address by either path or ID.
Functions§
- device_
add - Add a device to the btrfs filesystem referred to by
fd. - device_
forget - Unregister a device (or all stale devices) from the kernel’s btrfs device scanner.
- device_
info - Query information about the device with the given
devidon the filesystem referred to byfd. - device_
info_ all - Query information about all devices in the filesystem referred to by
fd, using the device count from a previously obtainedFsInfo. - device_
ready - Check whether all member devices of the filesystem that contains
pathare available and the filesystem is ready to mount. - device_
remove - Remove a device from the btrfs filesystem referred to by
fd. - device_
scan - Register a block device with the kernel’s btrfs device scanner so that multi-device filesystems containing it can be mounted.
- device_
stats - Query I/O error statistics for the device identified by
devidwithin the filesystem referred to byfd.