Adding a "sync" call between umount and sfdisk seems to avoid the problem. At least the loop ran until I stopped it instead of failing very early (between one and three iterations).
Adding a "sync" call between umount and sfdisk seems to avoid the problem. At least the loop ran until I stopped it instead of failing very early (between one and three iterations).