A Short article to learn how to enter a single-user mode in SUSE 12 Linux server.
In this short article, we will walk you through steps that demonstrate how to enter a single-user mode in SUSE 12 Linux. Single user mode is always preferred when you are troubleshooting major issues with your system. Single user mode disables networking and no other users are logged in, you rule out many situations of the multi-user system and it helps you in troubleshooting fast. One of the most popular uses of single-user mode is to reset forgotten root password.
1. Halt boot process
First of all, you need to have a console of your machine to get into single-user mode. If its VM then VM console, if its physical machine then you need its iLO/serial console connected. Reboot the system and halt automatic booting of the kernel at the grub boot menu by pressing any key.
2. Edit boot option of kernel
Once you are on the above screen, press e
on selected kernel (which is normally your preferred latest kernel) to update its boot options. You will see be below screen.
Now, scroll down to your booting kernel line and add init=/bin/bash
at the end of the line as shown below.
3. Boot kernel with edited entry
Now press Ctrl-x
or F10
to boot this edited kernel. The kernel will be booted in single-user mode and you will be presented with hash prompt i.e. root access to the server. At this point in time, your root file system is mounted in read-only mode. So any changes you are doing to the system won’t be saved.
Run below command to remount root filesystem as re-writable.
kerneltalks:/ # mount -o remount,rw /
And you are good to go! Go ahead and do your necessary actions in single-user mode. Don’t forget to reboot the server or type exit
to boot into normal multiuser mode once you are done.