My DevOps Journey: Week 3 β Exploring Linux Packages, Devices, and File Structure
This week, my DevOps journey led me deeper into the Linux ecosystem, where I explored some crucial concepts. Here's what I learned and how it contributes to my growth as a DevOps enthusiast:
1. Linux Packages and Package Management π¦
What are Packages?
Packages are bundles of files (binaries, configuration, documentation) used for installing software.
Types include Debian (.deb) and Red Hat (.rpm) packages.
Package Managers π₯’
Tools like
apt
,yum
, anddnf
manage software installation, updates, and dependencies.They simplify the process of handling multiple files and dependencies automatically.
Package Repositories ποΈ
Repositories store packages online, making it easy to download and install them via package managers.
They allow automated updates and simplify dependency management.
Managing Dependencies π
Packages often require other packages to function (called dependencies).
Package managers handle these dependencies automatically to ensure smooth installation.
Archiving vs. Compressing
Archiving (e.g.,
tar
): Bundles multiple files into one without reducing file size.Compressing (e.g.,
gzip
): Reduces file size for storage or transfer purposes.
Useful Commands
Install a package:
Debian:
apt install package_name
RPM:
yum install package_name
Remove a package:
Debian:
apt remove package_name
RPM:
yum erase package_name
List installed packages:
Debian:
dpkg -l
RPM:
rpm -qa
Compiling Software from Source
Steps include downloading source code, configuring it, building, and installing manually.
Useful when you want custom setups or when pre-built packages aren't available.
This blog provides a deeper dive into TAR
:
2. Linux Device Management π§
Device Files in
/dev
The
/dev
directory contains files that represent hardware devices (e.g., hard drives, USBs).These files enable communication between programs and hardware via drivers.
Types of Device Files π±
Character Devices (c): Handle data one character at a time (e.g., keyboards).
Block Devices (b): Handle data in blocks (e.g., hard drives).
Major and Minor Numbers
Major Number: Identifies the driver for the device.
Minor Number: Identifies the specific instance of the device.
udev System
- Automatically manages the creation and removal of device files in
/dev
based on connected hardware.
- Automatically manages the creation and removal of device files in
Pseudo Devices
- Virtual devices like
/dev/null
provide special functions.
- Virtual devices like
Tools for Device Management π οΈ
lsusb
: Lists connected USB devices.lspci
: Lists connected PCI devices.dd
: A powerful tool used for copying data between files or devices.
3. Linux File Structure π§
Filesystem Hierarchy π
The root directory
/
contains all system files and directories.Key directories include:
/bin
: Essential command binaries./etc
: Configuration files./home
: User data./usr
: User software./var
: Variable data like logs.
File System Types
Common filesystems include ext4 (default for Linux), NTFS (used in Windows), and XFS (for high performance).
The Virtual File System (VFS) allows applications to work across different filesystems by abstracting their differences.
Journaling in Filesystems π
- Journaling tracks changes, helping ensure data integrity after crashes.
Partition Types
MBR (Master Boot Record): Older partition scheme, max 4 partitions, supports up to 2TB disks.
GPT (GUID Partition Table): Modern standard, supports more partitions and disks larger than 2TB, used with UEFI boot.
Swap Partition π
- Swap acts as virtual memory when RAM is full, temporarily storing data to free up physical memory.
4. Vim Editor and Command Line Practice ποΈ
Continued practicing with Vim editor to improve editing efficiency.
Played around with different Linux commands to solidify hands-on experience with the terminal.
Screenshots of My Work and Linux Commands: π·πͺ
I explored working with the fstab
file, system partition tables, the /dev
directory, and learned how hard drive partitions function in Linux, along with much more.
Final Thoughts: π€
This week, I focused on building a solid foundation in Linux, covering packages, device interaction, and the file structure. These topics are essential for mastering system management, especially in a DevOps role. With each passing week, I feel more confident π in handling Linux environments and improving my workflow with tools like Vim and command-line utilities.
Next Week's Goals π―
In the upcoming week, I plan to dive into one of the most crucial parts of the Linux systemβthe kernel. I'll explore how it works, how to configure it, and get hands-on with it. Additionally, Iβll be learning about init systems, including Upstart and systemd, to understand how they manage the Linux startup process.
Beyond Linux, I'll begin my journey with AWS Cloud βοΈ, exploring how cloud platforms fit into the DevOps ecosystem. Finally, I aim to understand how DevOps practices βΎοΈ streamline the Software Development Life Cycle (SDLC) and enhance overall efficiency.
If you found this blog helpful and want to follow along with my DevOps journey, feel free to subscribe and connect with me on LinkedIn and X.
Letβs grow together! ππ
Subscribe to my newsletter
Read articles from Harsh Butani directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by