rancher / os

Tiny Linux distro that runs the entire OS as Docker containers
https://rancher.com/docs/os/v1.x/en/
Apache License 2.0
6.44k stars 655 forks source link

Problem booting from USB #2044

Open zimme opened 7 years ago

zimme commented 7 years ago

RancherOS Version: 1.0.3

Where are you running RancherOS? baremetal

I have recurring problems booting my server from USB.

I flash my USB drive with rancheros.iso, boot my server with it, run sudo ros install -c cloud-config.yml -d <usb drive> -t <syslinux/gptsyslinux>, reboot and everything works.

However after a while when I reboot the server it get stuck in the syslinux boot phase, I'm not completely sure if it's before it loads syslinux or when it tries to load rancheros from syslinux.

I've got kernel-headers, kernel-extras, kernel-headers-system-docker,zfsanddebian-console` enabled.

I'm not sure if it's related to #1923.

zimme commented 7 years ago

I'll try with another USB drive whenever I have time to make sure it's not a failing USB drive that's the problem.

zimme commented 7 years ago

Last time this happened was after an update, did the update tried to reboot and it just hangs when trying to load syslinux from the usb drive.

I'm not sure this isn't a bios problem, but because it works with a clean install I don't think so.

zimme commented 7 years ago

Ok, so I'm not completely sure but I do believe I might have found an explanation for my problem.

I install rancheros on my usb drive with type gptsyslinux then once an upgrade is available I run sudo ros os upgrade from 1.0.3 to 1.0.4 for example. Then during the upgrade process the following code is ran with installType = "rancher-upgrade" which is changed to installType = "upgrade" beforehand. This will then install syslinux again, but this time with an ordinary mbr and not the gptmbr, or an I missing something? installType is never set to gptsyslinux during an upgrade from what I can tell, hence diskType is always msdos. https://github.com/rancher/os/blob/96257a5e1815a092d5cda1767b59b5c24347374b/cmd/control/install.go#L427-L429

SvenDowideit commented 7 years ago

OH :( that makes sense - I don't use gpt enough.

zimme commented 7 years ago

Ok, so I've run into this problem again. This time with an msdos partition table. But I'm thinking that this time it might be related to #1923, but as I'm booting from an usb drive it's just taking forever maybe? Also this time it was just a regular reboot, not after an update.

Edit:

So it's not related to the issue I brought up here. I used a VM to write a fresh dos mbr from syslinux to my usb drive and the server boots up properly.

The problems seems to be relating to the mbr getting corrupted or overwritten some how.

niusmallnan commented 6 years ago

So can I close this issue?

zimme commented 6 years ago

There is still a bug here, where an upgrade on a gptsyslinux install writes a dos mbr over the gpt one but that is not related to my original problem so i guess that could go in it's own issue.

niusmallnan commented 6 years ago

ok, keep this open, will try to fix it.