Skip to main content
added 6 characters in body
Source Link

I currently have a logic to wait for the resync process to finish by looking at /sys/block/mdXXX/md/raid_state to be clean and assume that the resync has finished. However, I don't think this is correct as the raid can be in clean state while the resync is still happening.

What is a guaranteed way to ensure that newly created raid1 array using mdadm has fully completed the resync process?

Does mdadm have an inbuilt way of specifying whether we want to wait for resync to finish or not?

I have a Rust program that is orchestrating RAID creation using mdadm.

    // above create RAID-1 using mdadm --create
    loop {
        let raid_state = read_file("/sys/block/mdXXX/md/raid_state")
        let sync_complete = raid_state == RaidState::Clean;

        if sync_complete {
            // do more
        }
    }

I currently have a logic to wait for the resync process to finish by looking at /sys/block/mdXXX/md/raid_state to be clean and assume that the resync has finished. However, I don't think this is correct as the raid can be in clean state while the resync is still happening.

What is a guaranteed way to ensure that newly created raid1 array using mdadm has fully completed the resync process?

Does mdadm have an inbuilt way of specifying whether we want to wait for resync to finish or not?

I have a Rust program that is orchestrating RAID creation using mdadm.

    // create RAID-1 using mdadm --create
    loop {
        let raid_state = read_file("/sys/block/mdXXX/md/raid_state")
        let sync_complete = raid_state == RaidState::Clean;

        if sync_complete {
            // do more
        }
    }

I currently have a logic to wait for the resync process to finish by looking at /sys/block/mdXXX/md/raid_state to be clean and assume that the resync has finished. However, I don't think this is correct as the raid can be in clean state while the resync is still happening.

What is a guaranteed way to ensure that newly created raid1 array using mdadm has fully completed the resync process?

Does mdadm have an inbuilt way of specifying whether we want to wait for resync to finish or not?

I have a Rust program that is orchestrating RAID creation using mdadm.

    // above create RAID-1 using mdadm --create
    loop {
        let raid_state = read_file("/sys/block/mdXXX/md/raid_state")
        let sync_complete = raid_state == RaidState::Clean;

        if sync_complete {
            // do more
        }
    }
added 123 characters in body
Source Link

I currently have a logic to wait for the resync process to finish by looking at /sys/block/mdXXX/md/raid_state to be clean and assume that the resync has finished. However, I don't think this is correct as the raid can be in clean state while the resync is still happening.

What is a guaranteed way to ensure that newly created raid1 array using mdadm has fully completed the resync process?

Does mdadm have an inbuilt way of specifying whether we want to wait for resync to finish or not?

I have a Rust program that is orchestrating RAID creation using mdadm.

    // create RAID-1 using mdadm --create
    loop {
        let raid_state = read_file(raid_state_file_path"/sys/block/mdXXX/md/raid_state")
        let sync_complete = raid_state == RaidState::Clean;

        if sync_complete {
            // do more
        }
    }

I currently have a logic to wait for the resync process to finish by looking at /sys/block/mdXXX/md/raid_state to be clean and assume that the resync has finished. However, I don't think this is correct as the raid can be in clean state while the resync is still happening.

What is a guaranteed way to ensure that newly created raid1 array using mdadm has fully completed the resync process?

Does mdadm have an inbuilt way of specifying whether we want to wait for resync to finish or not?

    loop {
        let raid_state = read_file(raid_state_file_path)
        let sync_complete = raid_state == RaidState::Clean;

        if sync_complete {
            // do more
        }
    }

I currently have a logic to wait for the resync process to finish by looking at /sys/block/mdXXX/md/raid_state to be clean and assume that the resync has finished. However, I don't think this is correct as the raid can be in clean state while the resync is still happening.

What is a guaranteed way to ensure that newly created raid1 array using mdadm has fully completed the resync process?

Does mdadm have an inbuilt way of specifying whether we want to wait for resync to finish or not?

I have a Rust program that is orchestrating RAID creation using mdadm.

    // create RAID-1 using mdadm --create
    loop {
        let raid_state = read_file("/sys/block/mdXXX/md/raid_state")
        let sync_complete = raid_state == RaidState::Clean;

        if sync_complete {
            // do more
        }
    }
added 218 characters in body
Source Link

I currently have a logic to wait for the resync process to finish by looking at /sys/block/mdXXX/md/raid_state to be clean and assume that the resync has finished. However, I don't think this is correct as the raid can be in clean state while the resync is still happening.

What is a guaranteed way to ensure that newly created raid1 array using mdadm has fully completed the resync process?

Does mdadm have an inbuilt way of specifying whether we want to wait for resync to finish or not?

    loop {
        let raid_state = read_file(raid_state_file_path)
        let sync_complete = raid_state == RaidState::Clean;

        if sync_complete {
            // do more
        }
    }

I currently have a logic to wait for the resync process to finish by looking at /sys/block/mdXXX/md/raid_state to be clean and assume that the resync has finished. However, I don't think this is correct as the raid can be in clean state while the resync is still happening.

What is a guaranteed way to ensure that newly created raid1 array using mdadm has fully completed the resync process?

Does mdadm have an inbuilt way of specifying whether we want to wait for resync to finish or not?

I currently have a logic to wait for the resync process to finish by looking at /sys/block/mdXXX/md/raid_state to be clean and assume that the resync has finished. However, I don't think this is correct as the raid can be in clean state while the resync is still happening.

What is a guaranteed way to ensure that newly created raid1 array using mdadm has fully completed the resync process?

Does mdadm have an inbuilt way of specifying whether we want to wait for resync to finish or not?

    loop {
        let raid_state = read_file(raid_state_file_path)
        let sync_complete = raid_state == RaidState::Clean;

        if sync_complete {
            // do more
        }
    }
edited title
Link
Loading
Source Link
Loading