Skip to main content

replace_start

Function replace_start 

Source
pub fn replace_start(
    fd: BorrowedFd<'_>,
    source: ReplaceSource<'_>,
    tgtdev_path: &CStr,
    avoid_srcdev: bool,
) -> Result<Result<(), ReplaceStartError>>
Expand description

Start a device replace operation, copying all data from source to the target device at tgtdev_path.

When avoid_srcdev is true, the kernel will only read from the source device when no other zero-defect mirror is available (useful for replacing a device with known read errors).

On success returns Ok(Ok(())). If the kernel returns an application-level error in the result field, returns Ok(Err(ReplaceStartError)).