GRUB - GRand Unified Bootloader¶
The default boot loader for Redhat Linux and Fedora Supports MD5 password protection /boot/grub/grub.conf is the configuration file for Grub /boot/grub/grub.conf Changes to grub.conf takes effect immeditely Grub reads the configuration file at boot time, so the grub.conf file must be on a filesystem GRUB understand. These include ext2/ext3, FAT, reiserfs, minix and FFS. If MBR becomes corrupted and GRUB need to be re-installed, it can be done with command /sbin/grub-install.
To re-install GRUB on MBR of /dev/hda
# /sbin/grub-install /dev/hda
To create encrypted passwords:
# /sbin/grub-md5-crypt # cat grub.conf default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz password --md5 $1$NonT51$hBjZLFkXmEQiXDjX.a77t0 hiddenmenu title Fedora Core (2.6.12-1.1447_FC4) root (hd0,0) kernel /vmlinuz-2.6.12-1.1447_FC4 ro root=LABEL=/ initrd /initrd-2.6.12-1.1447_FC4.img
- Run once at boot time
- Sets Kernel parameters in /etc/sysctl.conf
- Sets system clock
- Loads keymaps
- Enable swap partitions
- Sets hostname
- Cheks root filesystem and mounts
- Add RAID devices if any
- Enable disk Quotas
- Check and mount other Filesystems
- Runs each time the system enters a run level
- Run after the run level specifig scripts
- Common place for custom modification
The following commands are used to control the services
ntsysv: It is a console based interactive utility that allows you to control what services run when entering a given run level. It configures the current run level by default. By using the --level option, you can configure other run levels.
chkconfig: chkconfig provides a simple command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy by relieving system administrators of the task of directly manipulating the numerous symbolic links in those directories.
usage: chkconfig --list [name] chkconfig --add <name> chkconfig --del <name> chkconfig [--level <levels>] <name> <on|off|reset>)
redhat-config-services: It is an X client that presents a display of eash of the services that are started and stopped at each run level. Services can be added, deleted, or re-ordered in the run levels 3 through 5 with this utility.
service: It is used to start or stop a standalone service immediately. Most services accept the arguments start, stop, restart, reload, condrestart and status.
Boot single user mode¶
when the boot prompt shows hit space bar select the boot kernal path press "e" to edit the line apend "single" word in the end of the boot kernal or apend init=/bin/bash in the end of the boot kernal hit enter and press b to boot, this will land in single user mode if the root is not mounted then follow below commands mount -oremount,rw / mount -v (check the mounted file systems)
Turning ON/OFF SELinux temporarily
Disabling SELinux temporarily is the easiest way to determine if the problem you are experiencing is related to your SELinux settings. To turn it off, you will need to become the root users on your system and execute the following command:
echo 0 > /selinux/enforce
This temporarily turns off SELinux until it is either re-enabled or the system is rebooted. To turn it back on you simply execute this command:
echo 1 > /selinux/enforce
SELinux to log warnings instead of block You can also configure SELinux to give you a warning message instead of actually prohibiting the action. This known as permissive mode. To change SELinux's behavior to permissive mode you need to edit the configuration file. On RHEL systems that file is located at /etc/selinux/config. You need to change the SELINUX option to permissive like so:
Note that these changes will not take effect until the system is rebooted.
To completely disable SELinux instead of setting the configuration file to permissive mode :
You will need to reboot your system or temporarily set SELinux to non-enforcing mode to create the desired effect.