Can not install loop device.
I try to create a coreos image with this installer. Like:
truncate -s 4G boot
losetup -d /dev/loop0
losetup -P -f --show boot
/dev/loopX
coreos-installer install --insecure -f rhcos-4.6.47-x86_64-metal.x86_64.raw.gz -i ignition/boot.ign /dev/loopX
But sometimes this will succeed but sometimes it will fail. I have no idea what is wrong here. Maybe this has nothiing to do with installer. But I guess some clues can be got here. Thanks in advance.
The succesful result will be like:
Signature not found; skipping verification as requested
> Read disk 849.8 MiB/849.8 MiB (100%)
Install complete.
The failure will be :
Signature not found; skipping verification as requested
> Read disk 849.8 MiB/849.8 MiB (100%)
Error: couldn't find any partitions on /dev/loop0
Resetting partition table
Error: install failed
My OS is amd64 CentOS 8. coreos-installer 0.10.1
Any clue will be appreciated.
There could be a race condition when rereading the partition table. In the failing case, if you pass --preserve-on-error, do /dev/loop0p* devices exist afterward? If not, there might be clues in dmesg.
@bgilbert
Thanks for your reply and I got new findings.
yes, with --preserve-on-error, the partitions exist then.
So it would be fine to use this image ?
But with real device it is OK without this issue.
No, --preserve-on-error is a debugging tool and shouldn't be used for normal operation.
yes, with
--preserve-on-error, the partitions exist then.
To be clear, are you saying that the partitions exist after coreos-installer fails with --preserve-on-error?
To be clear, are you saying that the partitions exist after coreos-installer fails with --preserve-on-error?
yes. And without this, the paritions will be gone. Maybe you can try by youself.