Skip to main content

device_remove

Function device_remove 

Source
pub fn device_remove(fd: BorrowedFd<'_>, spec: DeviceSpec<'_>) -> Result<()>
Expand description

Remove a device from the btrfs filesystem referred to by fd.

The device can be specified either by path or by its btrfs device ID via DeviceSpec. Uses BTRFS_IOC_RM_DEV_V2 and falls back to the older BTRFS_IOC_RM_DEV ioctl on kernels that do not support the v2 variant (only possible when removing by path). The kernel requires CAP_SYS_ADMIN.