coreos-installer icon indicating copy to clipboard operation
coreos-installer copied to clipboard

Can not install loop device.

Open nobody4t opened this issue 3 years ago • 4 comments

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.

nobody4t avatar Dec 30 '21 13:12 nobody4t

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 avatar Jan 05 '22 00:01 bgilbert

@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.

nobody4t avatar Jan 06 '22 05:01 nobody4t

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?

bgilbert avatar Jan 06 '22 05:01 bgilbert

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.

nobody4t avatar Jan 06 '22 08:01 nobody4t