After I’ve installed one older application on Oracle Linux 7, next time I’ve tried to start it, the server refused to start.
Fortunately it’s Linux, so there are many ways to recover it.
The following approach should work for most cases.
- Try to boot into the terminal mode by editing Grub
- In case that previous receipt doesn’t help, choose older kernel version to boot.
- If either receipt 1 or 2 is working, you should proceed in the following way:
#As root user execute the following command to disable Graphical mode:
systemctl set-default multi-user.target
#reboot and start the latest (problematic) kernel.
#Enter username/password for the oracle user (or any user you've created).
login as: oracle
password: ****
#Switch to the root user:
su -
#execute one of the following to troubleshoot:
journalctl
dmesg
/var/log
After inspecting those log files, I’m able to figure out what caused the boot problem.
In this case I’ve installed one application that requires several dependencies to be installed as well.
On of dependencies have caused GNOME issue.
To fix the problem, you should revert those changes:
#check all recent yum transactions
yum history
#get more info from the problematic transaction
yum history info 12
#revert all changes done by problematic transaction
yum history undo 12
#reboot your system
reboot
After that you should be able to boot.
For more severe cases you’ll need to boot the system into rescue mode.
To do that you’ll need to have the binary DVD ready to start the server from DVD.
- Boot from a source like DVD image/netboot.
- In the boot menu select started from DVD select Rescue
- When prompted, select option 1 – Continue to mount the disks for the target system to be rescued. This will mount existing system under the /mount/sysimage
- Press ENTER to dive into shell and execute:
df
to check if dev/sys/proc filesystems are mounted under the existing installation env (/mnt/sysimage).
If they are not mounted, you’ll need to mount them by executing:
mount -o bind /dev /mnt/sysimage/dev
mount -o bind /sys /mnt/sysimage/sys
mount -t proc /proc /mnt/sysimage/proc
mount -o bind /dev/shm /mnt/sysimage/dev/shm
5. In the next step, change root to already installed root fs by executing:
$ chroot /mnt/sysimage
Now you can fix or repair your files from the backup.
At the end, you’ll need to exit from the chroot environment and reboot by executing the following:
$ exit
$ exit
In the worst case when you have corrupted /boot directory, you’ll need to recreate it (vmlinuz & initramfs).
As this won’t happen very often, procedure of how to fix that case won’t be covered here.
Comments