It’s been a while without a Linux/Unix post, now we are starting a series here. A series posts with some of the basics, in a Q&A format. We are attempting to help you improve your basics, which can be helpful in your revision for job interviews as well.
Here comes the first part, where we will be discussing some of the Q&As from the booting part. This will be helpful for those who are at an L1- L2 level in your Linux knowledge.
- Which file is responsible for configure Ctrl+Alt+Del key combination to shutdown the system at console.
/etc/inittab è comment out the line “ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a – r now”
- What are the two display manager?
——————- advertisements ——————-
GDM (GNOME Display Manager) — The default display manager for Red Hat Enterprise Linux.
KDM — KDE’s display manager which allows the user to shutdown, restart or log in to the system
- How to switch a run level from one to another?
Init <run level>
- What is happening when we switch into another run level
When init is requested to change the runlevel, it sends the warning signal SIGTERM to all processes that are undefined in the new runlevel. It then waits 5 seconds before forcibly terminating these processes via the SIGKILL signal
- How to find the current run level
Who -r
Rescue mode provides the ability to boot a small Red Hat Enterprise Linux environment entirely from CD-ROM, or some other boot method, instead of the system’s hard drive.
There may be times when you are unable to get Red Hat Enterprise Linux running completely enough to access files on your system’s hard drive. Using rescue mode, you can access the files stored on your system’s hard drive, even if you cannot run Red Hat Enterprise Linux from that hard drive
——————- advertisements ——————-
- How to enter in to rescue mode?
To boot into rescue mode, you must be able to boot the system using one of the following methods 1:
By booting the system from an installation boot CD-ROM.
By booting the system from other installation boot media, such as USB flash devices.
By booting the system from the Red Hat Enterprise Linux CD-ROM #1.
Once you have booted using one of the described methods, add the keyword rescue as a kernel parameter. For example, for an x86 system, type the following command at the installation boot prompt: linux rescue
- How to load a driver at the time of booting in to rescue mode
Type linux dd at the boot prompt at the start of the installation process and press Enter
- If a driver that is part of the Red Hat Enterprise Linux 6 distribution prevents the system from booting, How to blacklist that driver
Boot the system into rescue mode with the command linux rescue rdblacklist=name_of_driver
——————- advertisements ——————-
Open the /mnt/sysimage/boot/grub/grub.conf file with the vi text editor
#vi /mnt/sysimage/boot/grub/grub.conf
kernel /vmlinuz-2.6.32-71.18-2.el6.i686 ro root=/dev/sda1 rhgb quiet rdblacklist=foobar ( edit the kernel line by adding entry rdblacklist=drivername)
Create a new file under /etc/modprobe.d/ that contains the command blacklist name_of_driver
echo “blacklist foobar” >> /mnt/sysimage/etc/modprobe.d/blacklist-foobar.conf
Reboot the system
- What is chroot, what are the uses.
A chroot is an operation that changes the apparent root directory for the current running process and their children
- What is single user mode, how to enter into single user mode ?
Single-user mode provides a Linux environment for a single user that allows you to recover your system from problems that cannot be resolved in networked multi-user environment. You do not need an external boot device to be able to boot into single-user mode, and you can switch into it directly while the system is running
——————- advertisements ——————-
At the GRUB boot screen, press any key to enter the GRUB interactive menu.
Select Red Hat Enterprise Linux with the version of the kernel that you want to boot and press the a to append the line.
Type single as a separate word at the end of the line and press Enter to exit GRUB edit mode. Alternatively, you can type 1 instead of single
- What is emergency mode, how to enter in to emergency mode, main difference between single user mode and emergency mode
Emergency mode, provides the minimal bootable environment and allows you to repair your system even in situations when rescue mode is unavailable. In emergency mode, the system mounts only the root file system, and it is mounted as read-only. Also, the system does not activate any network interfaces and only a minimum of the essential services are set up.
At the GRUB boot screen, press any key to enter the GRUB interactive menu.
Select Red Hat Enterprise Linux with the version of the kernel that you want to boot and press the a to append the line.
Type emergency as a separate word at the end of the line and press Enter to exit GRUB edit mode.
——————- advertisements ——————-
In emergency mode, you are booted into the most minimal environment possible. The root file system is mounted read-only and almost nothing is set up. The main advantage of emergency mode over single-user mode is that the init files are not loaded. If init is corrupted or not working, you can still mount file systems to recover data that could be lost during a re-installation.
In single-user mode, your computer boots to runlevel 1. Your local file systems are mounted, but your network is not activated. You have a usable system maintenance shell.
Hope you have enjoyed reading this post. Please feel free to add your feedback in the comments section.