Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
/.autorelabel on centos/7 sometimes not working #4
On the recover vm the
Only booting with
Once booted via
I've got some more info on this...
For the last 3 days or so, I've been beating my head against this exact issue. Upon the first boot from disk, autorelabel works for me no problem, but my coworker, following the same steps, cannot log in due to the autorelabel not actually happening.
We have narrowed it down to how we create our VMs in Virtualbox:
I always add a virtual serial port which has the output sent to a raw file (so I can see everything that was sent to the console, even if the screen is cleared or the VM reboots). My coworker doesn't do this.
If we each restore VMs from the exact same ISO image created by ReaR, his restored VM will not relabel and will not allow logins while mine will relabel, reboot and logins work just fine.
FYI, this is with CentOS 7.2 VMs, Relax-and-Recover 1.17.2 / Git, Vagrant 1.9.1 and Virtualbox 5.1.14 r112924, but we haven't narrowed it down to which component is the culprit yet.
Hopefully I can look into this shortly and either get more info back here... or a patch to resolve it (if it's a ReaR issue)!
-Rich Alloway (RogueWave)
So, here's an update on what I've found...
The crux of the problem is that, if you have
The last console definition determines where /dev/console is located.
The kernel cmdline is
when this failed.
Swapping the console definitions, which changes the cmdline to
results in /dev/console being /dev/tty0, so systemd can perform ioctl() operations successfully. Removing
I have been able to replicate this in VirtualBox and libvirt, but NOT in VMWare Fusion.
My guess is that there is something different with how VMWare Fusion handles emulation of the serial hardware regardless of whether or not the serial device is present in the VM configuration.
VirtualBox defaults to not having a virtual serial port present on VMs. libvirt default to having a virtual serial port present on VMs. I think this is why you haven't seen this issue with libvirt @gdha .
If you remove the virtual serial port from a libvirt VM but have the last console definition be a ttySx device, you can recreate the problem within libvirt.
Since we don't know what hardware (virtual or bare metal) the recover will be performed on, I don't think we can catch this reliably on the system running the backup.
What I think we could do, though, is to warn users that there is a potential issue with having the last console definition reference ttySx IFF the serial device does not exist on the restore system.
If this sounds reasonable, do you think it should only be included in the logfile or sent to the logfile and output to STDERR?
-Rich Alloway (RogueWave)
I reported this bug to CentOS as https://bugs.centos.org/view.php?id=13213 and I also created a Vagrantfile to show the problem and the fix at https://gist.github.com/schlomo/b532ba9bca87ea40d922d90e62b7338c