-s will make the kpartx command synchronous. However the 2 second pause before this is to ensure that unmount that runs before kpartx has completed. Until we make that command synchronous, I don't think we should remove the sleep from here.