Expand description
§Device management: adding, removing, querying, and extent layout
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, checking whether all devices of a multi-device filesystem are present and ready, and computing minimum device sizes from the device extent tree.
Most operations require CAP_SYS_ADMIN.
Structs§
- Device
Info - Information about a single device within a btrfs filesystem, as returned
by
BTRFS_IOC_DEV_INFO. - Device
Stats - 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 obtainedFilesystemInfo. - device_
min_ size - Compute the minimum size to which device
devidcan be shrunk. - 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.