Linux System Administration - Class 11


Linux System Administration

Setting Run Levels

Commands to set run levels:

  • init 0 : Halt/Shutdown
  • init 1 : Single-user mode
  • init 2 : Multi-user mode (no networking)
  • init 3 : Multi-user mode (with networking)
  • init 4 : Unused/User-defined
  • init 5 : Multi-user mode with GUI
  • init 6 : Reboot

Configuration files:

  • /etc/inittab : Sets the default runlevel
  • /etc/grub.conf : Configures the kernel image

Installing an Operating System

Why Install from a Pendrive?

  • Portable and convenient
  • Faster than optical media (CD/DVD)
  • Reusable for multiple installations

OS File Format

  • Standard format: .iso file (disk image)

Steps to Create a Bootable OS Pendrive

  1. Load OS ISO image to pendrive
    • Use Rufus to create a bootable drive
  2. Connect the pendrive to the target server
  3. Boot into BIOS (typically F2, F11, or F12)
  4. Set boot order (prioritize pendrive)
  5. Reboot the server
  6. OS installation begins automatically

Modules and Drivers

Definitions

  • Modules: Drivers or kernel extensions
  • Driver: Software that facilitates communication between the OS and hardware
  • Types:
    • Kernel modules
    • OS modules

Module Management Commands

List Modules

  • lsmod : Lists currently loaded modules
  • cat /etc/modules : Shows configured modules
  • cat /proc/modules : Displays active modules
  • ls /lib/modules : Lists kernel module directory

Install Modules

  • insmod <module_name> : Basic module installation

Install from RPM Packages

  • rpm -ivh <rpm_package_name> : Installs RPM package with verbose output and hash progress

Manage Modules with modprobe

  • modprobe -i <module_name> : Installs a module
  • modprobe -r <module_name> : Removes a module

Difference Between insmod and modprobe

  • modprobe: Automatically resolves and installs dependencies
  • insmod: Requires manual dependency management

Module Information

  • modinfo <module_name> : Displays detailed information about a module

Network-Related Commands

Check Hostname

  • hostname : Displays the system’s hostname

Get IP Address

  • Windows: ipconfig
  • Linux: ifconfig

Ping Command

Check network connectivity:

  • ping <ip_address> : Sends continuous ping requests
  • ping -c <packet_count> <ip_address> : Sends a specific number of packets