Posts Tagged ‘boot’
ATAD #9 – Linux init and runlevels
A runlevel is a state or mode of operation of the operating system. Runlevels define what services or processes should be running on the system which are listed in the /etc/rc.d/rc(x).d (where x is the number of the runlevel) directory in linux. After init is invoked as the last step of the kernel boot sequence, it looks for the file /etc/inittab file for the default runlevel.
# Default runlevel. The runlevels used by RHS are:
# 0 – halt (Do NOT set initdefault to this).
# 1 – Single user mode. Only the root user can log in.
# 2 – Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 – Full multiuser mode with networking
# This is the most common runlevel for server based systems that do not require GUI.
# 4 – unused or user defined.
# 5 – X11
# Networked, multi-user state with X Window System capability
# 6 – reboot (Do NOT set initdefault to this)
#
id:3:initdefault:
The runlevel program can be used to determing to the current runlevel of the system and the telinit program can be used to change the runlevel of the system on the fly. Note that its also possiblesupply init with the desired runlevel by specifying it as a kernel command line parameter from the grub bootloader (kernel /vmlinuz ro root=/dev/hda1 5)
__tipped__
ATAD #4 – Where is your OS bootable partition?
>The /boot/ partition (or) directory contains static files, like the kernel, that are required to boot the system properly.
The /boot/ partition _can_not_ be on a logical volume group because the boot loader can not read it. If the root / partition is on a logical volume, then its required to create a separate /boot/ partition which is not a part of a volume group. If you are making a RAID partition of /boot/, you must choose RAID level 1, and it must use one of the first two drives (IDE first, SCSI second). Source [RHEL deployment guide]
A neat description of the boot process can be found here
Btw just noticed that MS Windows does support the use of “/” and “\” to traverse across directories. neato.
__tipped__
ATAD #2 – linux swap space
Swap space is used when a system requires memory greater the physical memory (RAM) available. Physical memory is divided into chunks of memory called pages. When the amount of RAM is full, a page of memory which is relatively less used is moved to a preconfigured swap space on the hard drive (HDD).
Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files. The combined sizes of the physical memory and the swap space constitute the amount of virtual memory available.
RedHat recommends swap size be equal to 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB.
So, if:
M = Amount of RAM in GB, and S = Amount of swap in GB, then
If M < 2
then
S = M * 2
else
S = M + 2
fi
However, if you think you will be upgrading the RAM sometime in the near future, consider the total amount of RAM you would be having after your upgrade and decide on the swap space during install time. swap space can also be altered post installation by
1. creating a new swap partition
# lvm lvcreate -n -L (size_in_mb)M
2. creating a new swap file
# dd if=/dev/zero of=/swapfile bs=1024 count=(size)
3. extend swap on an existing logical volume (recommended)
# lvm lvresize (lvol) -L +(size_in_mb)M
Remember to boot the system in rescue mode before altering the swap space as the swap space can not be in used when being modified.
Further reading: swapoff, mkswap, swapon
__tipped__