Linux System Administration - Class 11
Linux System Administration
Setting Run Levels
Commands to set run levels:
init 0: Halt/Shutdowninit 1: Single-user modeinit 2: Multi-user mode (no networking)init 3: Multi-user mode (with networking)init 4: Unused/User-definedinit 5: Multi-user mode with GUIinit 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:
.isofile (disk image)
Steps to Create a Bootable OS Pendrive
- Load OS ISO image to pendrive
- Use Rufus to create a bootable drive
- Connect the pendrive to the target server
- Boot into BIOS (typically
F2,F11, orF12) - Set boot order (prioritize pendrive)
- Reboot the server
- 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 modulescat /etc/modules: Shows configured modulescat /proc/modules: Displays active modulesls /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 modulemodprobe -r <module_name>: Removes a module
Difference Between insmod and modprobe
modprobe: Automatically resolves and installs dependenciesinsmod: 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 requestsping -c <packet_count> <ip_address>: Sends a specific number of packets