Posts for: #Rhel

mounting and unmounting network filesystems in Linux

definitions

NFS is one of the network filesystems available on Linux. An NFS server has the NFS service installed and enabled. It hosts the mounted filesystem that shall be made available to remote systems. This action is called export and involves these files:

  • /etc/exports: where I configure the mounted filesystems that need to be remotely available to the defined machines,
  • /var/lib/nfs/etab: is called the master export table. It is populated as soon as an entry, in a correct format, is recorded in the /etc/exports file and exportnfs -a is run. The exportnfs -a command reads the entries of /etc/exports to do its job. I am simplifying these steps with the expression create an NFS share.

establish a NFS export

Here is my lab topology: rhel10-vm1 (192.168.122.216): NFS server <—> rhel10-vm2 (192.168.122.6): NFS client.

[Read]

local filesysytems and swap in Linux

filesystem concepts

A filesystem (aka filesystem) is the software structure (the formatting) that is located on a storage device or in memory, and dictates how data is organized there.

When a filesystem is located on a storage device, like a disk or DVDROM, then it is called a physical filesystem. When it is located in memory, like for example when the Linux kernel loads the proc filesystem in RAM, then it is called a virtual filesystem.

[Read]

Linux Storage Concepts

units of measurement in storage

When referring to storage capacities, there are two units of measurements:

  • the multiples of 1024, where capacities are written using the IEC notation:
    • 1 kiB = 1 K, one kibibyte
    • 1 MiB = 1 M, one mebibyte
    • 1 GiB = 1 G, one gibibyte
    • 1 TiB = 1 T, one tebibyte
    • etc.
  • the multiples of 1000, which is also used in IT networking for communication speed, throughput or bandwidth. In this case, capacity values are written using this notation:
  • 1 kB: one kilobyte
  • 1 MB: one megabyte
  • 1 GB: one gigabyte
  • 1 TB: one terabyte
  • etc.

Commands that use units of 1024 bytes: fdisk, lsblk, sfdisk, etc.

[Read]

Linux Tuning Profiles

Preprovisioned tuning profiles

user1@rhel10-vm2:~$ ls /usr/lib/tuned/profiles
accelerator-performance  balanced          desktop      intel-sst            network-latency     optimize-serial-console  throughput-performance  virtual-host
aws                      balanced-battery  hpc-compute  latency-performance  network-throughput  powersave                virtual-guest
user1@rhel10-vm2:~$

Verify and change tuning profiles

Verify that the tuned service is installed with DNF:

user1@rhel10-vm2:~$ dnf list --installed | grep tuned
tuned.noarch                                   2.25.1-2.el10_0                @rhel-10-for-x86_64-baseos-rpms   

Verify the status of the service with systemctl:

user1@rhel10-vm2:~$ systemctl status tuned
● tuned.service - Dynamic System Tuning Daemon
     Loaded: loaded (/usr/lib/systemd/system/tuned.service; enabled; preset: enabled)
     Active: active (running) since Fri 2026-08-21 19:29:51 CEST; 1h 15min ago
 Invocation: fa8cec68b5b449ee9d4f13e2ef0a4618
       Docs: man:tuned(8)
             man:tuned.conf(5)
             man:tuned-adm(8)
   Main PID: 936 (tuned)
      Tasks: 4 (limit: 10680)
     Memory: 17.7M (peak: 19.7M)
        CPU: 952ms
     CGroup: /system.slice/tuned.service
             └─936 /usr/bin/python3 -Es /usr/sbin/tuned -l -P

Warning: some journal files were not opened due to insufficient permissions.
user1@rhel10-vm2:~$

Display the list of available tuning profiles:

[Read]

System Logging

Definition

Syslogs contain subsets of information on faults, events, audit & session data, all related the monitored objects. Not all logs depict errors. Syslog can include audit and event logs.

Syslog Facilities

Any program or process capable of generating syslogs.

Syslog Severities

aka syslog severity levels or syslog priorities. The describe different levels of importance. Example of syslog severities: emergency, alert, critical, informational, warnings.

How Linux implements logging

rsyslogd

Verify the version of rsyslogd deployed on a RHEL machine:

[Read]

The Linux Kernel

Finding the kernel packages

The Linux kernel is not a monolithic file but rather a set of RPM packages.

Find out the installed kernel packages:

user1@localhost:~$ rpm -qa *kernel*
kernel-modules-extra-matched-6.12.0-124.8.1.el10_1.x86_64
kernel-tools-libs-6.12.0-124.8.1.el10_1.x86_64
kernel-modules-core-6.12.0-124.8.1.el10_1.x86_64
kernel-core-6.12.0-124.8.1.el10_1.x86_64
kernel-modules-6.12.0-124.8.1.el10_1.x86_64
kernel-modules-extra-6.12.0-124.8.1.el10_1.x86_64
kernel-tools-6.12.0-124.8.1.el10_1.x86_64
kernel-6.12.0-124.8.1.el10_1.x86_64
user1@localhost:~$ 

Find out the kernel version and release:

user1@localhost:~$ uname --help
Usage: uname [OPTION]...
Print certain system information.  With no OPTION, same as -s.

  -a, --all                print all information, in the following order,
                             except omit -p and -i if unknown:
  -s, --kernel-name        print the kernel name
  -n, --nodename           print the network node hostname
  -r, --kernel-release     print the kernel release
  -v, --kernel-version     print the kernel version
  -m, --machine            print the machine hardware name
  -p, --processor          print the processor type (non-portable)
  -i, --hardware-platform  print the hardware platform (non-portable)
  -o, --operating-system   print the operating system
      --help        display this help and exit
      --version     output version information and exit

GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation <https://www.gnu.org/software/coreutils/uname>
or available locally via: info '(coreutils) uname invocation'
user1@localhost:~$ 
user1@localhost:~$ uname -v
#1 SMP PREEMPT_DYNAMIC Fri Oct 17 13:03:58 EDT 2025
user1@localhost:~$ uname -r
6.12.0-124.8.1.el10_1.x86_64
user1@localhost:~$ 

Kernel-related files

in the /boot directory

With the exception of the efi and grub2 directories, which deal with the bootloader for UEFI and BIOS systems respectively, the rest of the files and subdirectories under the /boot/ directory are related to the kernel.

[Read]

Linux GRUB2

Grub2 is a popular bootloader for BIOS and UEFI systems. It typically displays boot entries in a black background during system start. Each of these boot entries seem to be a reference to a set of configuration instructions that are defined in files. Such files are located under /boot/loader/entries/ according the the man page of grubby.

user1@rhel10-vm2:~$ ls /boot/loader/entries/
ls: cannot open directory '/boot/loader/entries/': Permission denied
user1@rhel10-vm2:~$ 
user1@rhel10-vm2:~$ sudo ls /boot/loader/entries/
995c0067e7c140f28c8539b917f55418-0-rescue.conf
995c0067e7c140f28c8539b917f55418-6.12.0-55.43.1.el10_0.x86_64.conf
user1@rhel10-vm2:~$ 

When my lab VM is booting, grub2 shows only two boot entries. And I found only two files under /boot/loader/entries/.

[Read]

Linux Units

Linux units

Units are configuration files that describe the resources that are managed by systemd. They are stored in four file system paths. If I do a manual search I can approximately tell where they are:

Wassim@linux:~$ find / -mindepth 1 -name systemd 2>/dev/null
/home/Wassim/Documents/ddupdate/systemd
/home/Wassim/.config/systemd
/run/systemd
/run/udev/tags/systemd
/run/user/1000/systemd
/etc/xdg/systemd
/etc/systemd
/var/lib/systemd
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/49/e51263e53d04900556e2f97ac2b27201f632f604d68d67f50323f9a99389fdb0/files/lib/systemd
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/49/e51263e53d04900556e2f97ac2b27201f632f604d68d67f50323f9a99389fdb0/files/share/licenses/gnome/systemd
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/50/a8da766dd0273a67539d2b98358ed6809d8e729280baf63428108837135229d3/files/lib/systemd

<---- output omitted ---->

/var/lib/snapd/snap/gnome-3-38-2004/143/usr/lib/systemd
/usr/lib/systemd
/usr/lib/systemd/systemd
/usr/lib64/systemd
/usr/lib64/python3.12/site-packages/systemd
/usr/share/licenses/systemd
/usr/share/doc/systemd
/usr/share/systemd
/usr/share/cockpit/systemd
Wassim@linux:~$ 

/run/systemd seem to store runtime unit files, because /run/ typically contains runtime data, so it can not be a permanent location of systemd unit files. There is also /etc/systemd and /usr/lib/systemd/system/. The latter appears to store system units:

[Read]

Linux Learning Map

Exam Objectives

  • Understand and use essential tools
    • Access a shell prompt and issue commands with correct syntax
    • Use input-output redirection (>, », |, 2>, etc.)
    • Use grep and regular expressions to analyze text
    • Access remote systems using SSH
    • Log in and switch users in multi-user targets
    • Archive, compress, unpack, and uncompress files using tar, gzip, and bzip2
    • Create and edit text files
    • Create, delete, copy, and move files and directories
    • Create hard and soft links
    • List, set, and change standard ugo/rwx permissions
    • Locate, read, and use system documentation including man, info, and files in /usr/share/doc

Manage software

- Configure access to RPM repositories
- Install and remove RPM software packages
- Configure access to Flatpak repositories
- Install and remove Flatpak software packages

Create simple shell scripts

- Conditionally execute code (use of: if, test, [], etc.)
- Use Looping constructs (for, etc.) to process file, command line input
- Process script inputs ($1, $2, etc.)
- Processing output of shell commands within a script

Operate running systems

- Boot, reboot, and shut down a system normally
- Boot systems into different targets manually
- Interrupt the boot process in order to gain access to a system
- Identify CPU/memory intensive processes and kill processes
- Adjust  process scheduling
- Manage tuning profiles
- Locate and interpret system log files and journals
- Preserve system journals
- Start, stop, and check the status of network services
- Securely transfer files between systems

Configure local storage

  • List, create, and delete partitions on GPT disks

[Read]