Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Unable to image bare metal from USB drives #358

Closed
joharper54SEG opened this issue Jan 27, 2020 · 9 comments
Closed

Unable to image bare metal from USB drives #358

joharper54SEG opened this issue Jan 27, 2020 · 9 comments

Comments

@joharper54SEG
Copy link

Version
v0.7.1
v0.8.0
v0.9.0-rc1

Architecture
x86

Describe the bug
Booting a bare metal device from a USB key made from the ISO image fails to install k3os. Error is thrown when trying to mount disks.

k3os-error1
k3os-error2

To Reproduce
Write ISO image to USB drive and boot. Try and run k3os install.

I have been writing the USB drives from a windows machine using Rufus in DD mode. This used to work but started to fail. Tried to write the drive from ubuntu using dd and it won't boot at all, gives an error that is can't find the kernel.

This behavior is only happening on bare metal when trying to use a USB drive to install. I was able to successfully image the device from a portable USB DVD Drive using the same ISO burned to DVD. Mounting the ISO to a VM also works fine.

v0.6.0 is the only working ISO for bare metal. Something changed after this version that broke bare metal installs from USB.

Expected behavior
k3os should format the disk and install

@dweomer
Copy link
Contributor

dweomer commented Jan 28, 2020

@joharper54SEG there might be an issue with how we are creating the ISO image but I just flashed k3OS (built from an unrelated PR based on top of v0.9.0-rc1) to USB using BalenaEtcher on macOS and it worked without issue on a NUC7i5BNK. I did have a false start when accidentally selecting the non-UEFI USB boot option, however, so depending on your hardware make sure you select the correct boot option.

@joharper54SEG
Copy link
Author

I found a mac to use and flashed with BalenaEtcher just to make sure we are on the same page. The ISO downloaded from github flashed fine with no errors. My refactored ISO is failing with the same error. So it appears that something in the refactoring process is producing an ISO that is not quite right.

My build pipeline has the following tasks to create my custom ISO.
wget $(k3os.release.uri)
mkdir source
mkdir -p newiso/boot/grub
sudo mount -o loop k3os-amd64.iso source
sudo cp -rf source/k3os newiso/
sudo cp -f configs/config.yaml newiso/k3os/system/config.yaml
sudo cp -f configs/grub.cfg newiso/boot/grub/grub.cfg
grub-mkrescue -o k3os-seg.iso newiso/ -- -volid K3OS

@dweomer
Copy link
Contributor

dweomer commented Jan 28, 2020

I found a mac to use and flashed with BalenaEtcher just to make sure we are on the same page. The ISO downloaded from github flashed fine with no errors. My refactored ISO is failing with the same error. So it appears that something in the refactoring process is producing an ISO that is not quite right.

My build pipeline has the following tasks to create my custom ISO.
wget $(k3os.release.uri)
mkdir source
mkdir -p newiso/boot/grub
sudo mount -o loop k3os-amd64.iso source
sudo cp -rf source/k3os newiso/
sudo cp -f configs/config.yaml newiso/k3os/system/config.yaml
sudo cp -f configs/grub.cfg newiso/boot/grub/grub.cfg
grub-mkrescue -o k3os-seg.iso newiso/ -- -volid K3OS

This looks compatible with the "Remasering ISO" guidance. Are you by chance running these commands from a centos/rhel linux box? If so you might be running into #288

@joharper54SEG
Copy link
Author

I am using ubuntu on the build machines. I have tried ubuntu 16.04 and k3os fails to boot, errors out and dumps me into grub rescue. Ubuntu 18.04 is producing the ISO with the mounting issues.

@joharper54SEG
Copy link
Author

I was able to work around this by rebuilding from source like we did for #203 rather than refactoring the ISO. It takes a little longer but does produce a working customized ISO at then end.

`mkdir $(Build.SourcesDirectory)/k3os
git clone --single-branch --progress -b v0.8.0 "https://github.com/rancher/k3os" $(Build.SourcesDirectory)/k3os

cp -f $(Build.SourcesDirectory)/configs/grub.cfg $(Build.SourcesDirectory)/k3os/images/07-iso/grub.cfg
cp -f $(Build.SourcesDirectory)/configs/config.yaml $(Build.SourcesDirectory)/k3os/images/07-iso/config.yaml
cd $(Build.SourcesDirectory)/k3os

make`

@dweomer
Copy link
Contributor

dweomer commented Jan 28, 2020

I was able to work around this by rebuilding from source like we did for #203 rather than refactoring the ISO. It takes a little longer but does produce a working customized ISO at then end.

`mkdir $(Build.SourcesDirectory)/k3os
git clone --single-branch --progress -b v0.8.0 "https://github.com/rancher/k3os" $(Build.SourcesDirectory)/k3os

cp -f $(Build.SourcesDirectory)/configs/grub.cfg $(Build.SourcesDirectory)/k3os/images/07-iso/grub.cfg
cp -f $(Build.SourcesDirectory)/configs/config.yaml $(Build.SourcesDirectory)/k3os/images/07-iso/config.yaml
cd $(Build.SourcesDirectory)/k3os

make`

@joharper54SEG excellent, I am glad you were able to find a workaround.

I think the problem with the Remastering ISO guidance, as per #288, is that it doesn't call out that grub-mkrescue on some( many?) systems creates /boot/grub2 instead of the expected /boot/grub.

dweomer added a commit to dweomer/k3os that referenced this issue Jan 28, 2020
In the Remastering ISO section of the README.md note that it is not
uncommon for `grub-mkrescue` from grub2 installations to create `boot/grub2`
instead of the expected `boot/grub`.

Addresses rancher#288 (and possibly rancher#358)
dweomer added a commit to dweomer/k3os that referenced this issue Jan 28, 2020
In the Remastering ISO section of the README.md note that it is not
uncommon for `grub-mkrescue` from grub2 installations to create `boot/grub2`
instead of the expected `boot/grub`.

Addresses rancher#288 (and possibly rancher#358)
dweomer added a commit to dweomer/k3os that referenced this issue Jan 28, 2020
In the Remastering ISO section of the README.md note that it is not
uncommon for `grub-mkrescue` from grub2 installations to create `boot/grub2`
instead of the expected `boot/grub`.

Addresses rancher#288 (and possibly rancher#358)
@dweomer
Copy link
Contributor

dweomer commented Jan 28, 2020

@joharper54SEG I have added some documentation to the readme to warn users grub-mkrescue sometimes creates ${ISO}/boot/grub2 instead of ${ISO}/boot/grub. If it turns out that this was not the problem and/or your workaround isn't viable long-term, please re-open this issue or submit another.

@indistinctTalk
Copy link

Just an FYI that I'm seeing this same issue with v0.10.0 k3os and v1.5.80 BalenaEtcher running on a Windows 10 host.

@lcotonea
Copy link

Another [quick & dirty] solution is to change usb devices location on the server (usb devices permutation or use another free usb location) and reboot. Some times it works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants