Work around LVM related race condition when using --force with LVM
If an "lvremove" is immediately followed by an "lvcreate" for an LV with the same name, "mkswap" (and maybe other commands) occasionally fail with "Device or resource busy". Work around it by using sync and sleep.
This commit is contained in:
@@ -3066,6 +3066,10 @@ sub createLVMBits
|
||||
logprint(
|
||||
"Removing $lvm_disk - since we're forcing the install\n");
|
||||
runCommand("lvremove --force $lvm_disk", \%CONFIG);
|
||||
runCommand("sync", \%CONFIG);
|
||||
logprint(
|
||||
"Sleeping a few seconds to avoid LVM race conditions...\n");
|
||||
sleep(3);
|
||||
} else {
|
||||
fail("ERROR: Xen guest $CONFIG{'hostname'} appears to be running.\nAborting.\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user