Blog

Linux Installation Guide

Quick Summary: Battle tested Linux installation guide based on over 20 years of accumulated experience on production platforms.

Overview

This guide consists of 20 years of accumulated experience with production platforms. This guide can be used as a generic guideline, regardless of OS. We will be using RHEL. deploy production-ready workloads Using your corporate account, or a (“Free”) developer account, download the RHEL 9.3 DVD ISO installation file: NOTE: You can download Red Hat Enterprise Linux for free with a developer account: https://developers.redhat.com/products/rhel/download Direct download page: https://access.redhat.com/downloads/content/rhel “DVD ISO image file It is a full installation program that contains the BaseOS and AppStream repositories. With a DVD ISO file, you can complete the installation without access to additional repositories.”” Red Hat Enterprise Linux 9.3 Binary DVD Show details File name: rhel-9.3-x86_64-dvd.iso File Size: 9.81 GB SHA-256 Checksum: 5c802147aa58429b21e223ee60e347e850d6b0d8680930c4ffb27340ffb687a8 Last Updated: 2023-10-30 Do not mix workloads. — OS release notes –> NOTE this is 9.4, look for 9.3. Also get otehr sueful links. https://developers.redhat.com/articles/2024/05/01/whats-new-red-hat-enterprise-linux-94#red_hat_enterprise_linux_system_roles_ A DB server should be tuned for databases, an application server – for applications. Read more about Red Hat Enterprise Linux 9.4: https://www.redhat.com/en/blog/simplify-hybrid-cloud-operations-red-hat-enterprise-linux-94 Read the press release for the RHEL 9.4 announcement: https://www.redhat.com/en/about/press-releases/red-hat-simplifies-standard-operating-environments-across-hybrid-cloud-latest-version-red-hat-enterprise-linux Download RHEL 9.4 at no cost: https://developers.redhat.com/content-gateway/file/rhel/Red_Hat_Enterprise_Linux_9.4/rhel-9.4-x86_64-boot.iso?intcmp=7013a0000034ZDPAA2 — Red Hat Enterprise Linux is a fully supported production-grade OS for production use. AMD and Intel 64-bit architectures

Minimum System Requirements

Per Red Hat https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/performing_a_standard_rhel_9_installation/index#system-requirements-reference_installing-RHEL And the bare minimum resources we configure for our images (which we increase as necessary depending on use): CPU: RAM: 4 GiB Storage Boot from ISO, to begin installation.

Storage and Partitioning

Reference: C:\gpstorage1\storage-technical\Technical\Unix\Platforms\Linux\Storage\partitioning*.* NOTE: If this is a bare metal installation with SAN attached storage, work with your SAN administrator to provision and present storage to the system. The SAN admin will provide important information required for setting up DM Multipath [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/pdf/configuring_device_mapper_multipath/red_hat_enterprise_linux-9-configuring_device_mapper_multipath-en-us.pdf]. This image is begin configured for a virtual or cloud environment and assumes this was all provisioned already. DM Multipath provides provides fail-over / redundancy, if any component if an I/O path to the SAN storage fails (cable, switch, or controller), the DM Multipath subsystem automatically switches to an alternate path. The partition mounted on /boot contains the operating system kernel, which allows your system to boot Red Hat Enterprise Linux 9, along with files used during the bootstrap process. Due to the limitations of most firmwares, creating a small partition to hold these is recommended. In most scenarios, a 1 GiB boot partition is adequate. Unlike other mount points, using an LVM volume for /boot is not possible – /boot must be located on a separate disk partition. While a 5 GiB root file system allows you to install a minimal installation, it is recommended to allocate at least 10 GiB so that you can install as many package groups as you want. This is the primary requirements we use for bare metal deployments and it does not apply to virtual and cloud deployments. man hier https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html 4GB of ram, this will be adjusted based on system profile. Recommended partitioning scheme: A general rule of thumb to follow is to keep system partitions separate from non-system storage. Separate mount points will simply storage administration. The system (OS bare metal, ESXi) should be installed on local mirrored SAS storage. For mission-critical / processing-intensive workloads (e.g., application and database workloads) should be configured to use resilient, high performance (low latency) storage with hardware RAID to handle real world application performance. SAS is generally more expensive, and it’s better suited for use in servers or in processing-heavy computer workstations. SATA is less expensive, and it’s better suited for desktop file storage. For ultra-high performance requirements (e.g., on-prem cloud platforms like OCP), use is full flash, like PMAX EMC storage.

Volume Management:

We use Logical Volume Management (LVM) if you anticipate expanding your storage by adding more disks or expanding virtual machine disks after the installation. With LVM, you can create physical volumes on the new drives, and then assign them to any volume group and logical volume as you see fit – for example, you can easily expand your system’s /home (or any other directory residing on a logical volume). Format: We use ext4 for flexibility (we can increase and shrink file systems as needed. XFS can be increased, but it cannot be reduced non-destructively. Therefore, if you plan to alter your partitioning layout later, you should use the ext4 file system instead. /boot partition – recommended size at least 1 GiB /boot contains the operating system kernel and other files that allow the system to boot. In most scenarios, a 1 GiB boot partition is adequate. Unlike other mount points, using an LVM volume for /boot is not possible – /boot must be located on a separate disk partition. When kdump is enabled in system it will take approximately another 40MiB (another initrd with 33MiB) The default partition size of 1 GiB for /boot should suffice for most common use cases. However, it is recommended that you increase the size of this partition if you are planning on retaining multiple kernel releases or errata kernels. / (root): Red Hat recommended minimum 10GiB, 5GiB is required for the system, 10 GiB so you can install additional packages. We’re going to allocate 5 GiB We do not use /home, Red Hat suggests at lest 1 GiB. Our users are created on separate partitions, usually in storage areas (e.g., /storage1). swap partition: Red Hat recommend a size at least 1 GiB. For our default image we use a 1:1 ratio: 4 GiB of RAM and 4 GiB of swap and adjust accordingly based on the system profile For our images, we allocate (reserve) a minimum amount of swap on the local disk. and configure additional swap on more performant external storage It’s important to check with respective software vendors, reference standard documentation to determine system memory recommendations. For applications developed in-house, check with with appropriate teams (e.g., system architects / developers) in-house. Be sure to monitor the amount of swap space used and upgrade your RAM if necessary. Reside on a separate hard disk space. Distributing swap space over multiple storage devices – particularly on systems with fast drives, controllers and interfaces – also improves swap space performance. One great thing about the Linux swapping subsystem is that if you mount two (or more) swap spaces (preferably on two different devices) with the same priority, Linux will interleave its swapping activity between them, which can greatly increase swapping performance. https://softpanorama.org/Internals/Unix_filesystems/linux_swap_filesystem.shtml You can verify that it is being used by running swapon -s. To mount the swap space automatically at boot time, you must add an entry to the /etc/fstab file, which contains a list of filesystems and swap spaces that need to be mounted at boot up. The format of each line is: Since swap space is a special type of filesystem, many of these parameters aren’t applicable. For swap space, add: /dev/hdb1 none swap sw 0 0 /var: The /var directory holds content for a number of applications, including the Apache web server, and is used by the DNF package manager to temporarily store downloaded package updates. Make sure that the partition or volume containing /var has at least 5 GiB. We isolate this partition due to critical logs we’re interested in for security scanning and monitoring. We do not want this partition affecting /. /usr: The /usr directory holds the majority of software on a typical Red Hat Enterprise Linux installation. The partition or volume containing this directory should therefore be at least 5 GiB for minimal installations, and at least 10 GiB for installations with a graphical environment. [root@stllin00 ~]# vgs VG #PV #LV #SN Attr VSize VFree vg00 1 9 0 wz–n- <49.00g <4.00g [root@stllin574 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 50G 0 disk +-sda1 8:1 0 1G 0 part /boot +-sda2 8:2 0 49G 0 part +-vg00-root 253:0 0 2G 0 lvm / +-vg00-swap 253:1 0 4G 0 lvm [SWAP] +-vg00-usr 253:2 0 6G 0 lvm /usr +-vg00-var 253:3 0 6G 0 lvm /var +-vg00-opt 253:4 0 6G 0 lvm /opt +-vg00-opt_hds 253:5 0 8G 0 lvm /opt/hds +-vg00-var_log_hds 253:6 0 2G 0 lvm /var/log/hds +-vg00-rpms 253:7 0 10G 0 lvm /rpms +-vg00-OV 253:8 0 1G 0 lvm /var/opt/OV [root@stllin574 ~]# df -k Filesystem 1K-blocks Used Available Use% Mounted on devtmpfs 16342752 0 16342752 0% /dev tmpfs 16360596 0 16360596 0% /dev/shm tmpfs 16360596 33592 16327004 1% /run tmpfs 16360596 0 16360596 0% /sys/fs/cgroup /dev/mapper/vg00-root 1992552 686604 1184708 37% / /dev/mapper/vg00-usr 6102624 3255396 2516272 57% /usr tmpfs 4194304 7144 4187160 1% /tmp /dev/sda1 996780 220968 707000 24% /boot /dev/mapper/vg00-opt 6119008 3112652 2717348 54% /opt /dev/mapper/vg00-rpms 10218772 472 9677628 1% /rpms /dev/mapper/vg00-var 6110816 785540 5015296 14% /var /dev/mapper/vg00-var_log_hds 1992552 24 1871288 1% /var/log/hds /dev/mapper/vg00-opt_hds 8154588 24 7718752 1% /opt/hds /dev/mapper/vg00-OV 996780 166752 761216 18% /var/opt/OV /dev/mapper/vg01-intel 30787492 23853820 5344424 82% /opt/intel Should take roughly 10 minutes,

Post Install

Once the system boots, log in and quickly configure the interface with this command so we can log into the system. Ue ‘ip addr’ or nmcli to show the interfaces avaiale on the system: [root@localhost ~]# nmcli d show […] GENERAL.DEVICE: enp0s8 […] ~]# List the interface names: ~]# nmcli connection show NAME UUID TYPE DEVICE lo 2719d8eb-b1a6-4f28-a49a-03601a5b7134 loopback lo enp0s8 f402affc-6923-492a-8f49-b2495f9e5ddb ethernet enp0s8 enp0s3 d4503c57-2671-3c1c-85f7-edb724dc35ee ethernet — ~]# ~]# nmcli connection modify enp0s8 ipv4.method manual ipv4.addresses 192.168.1.33/24 ipv4.gateway 192.168.1.1 ipv4.dns 192.0.2.200 ipv4.dns-search xomedia.io ~]# Activate: ~]# nmcli connection up enp0s8 Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3) ~]# Now log in with your favorite terminal (I use MobaXterm) to complete the setup. TIP: MobaXterm has a lot of Unix utilities embedded by default. You can display additional settings of the connection profile with: nmcli connection show enp0s8 Verify: ~]# ip address show enp0s8 2: enp0s8: mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:00:27:10:d7:28 brd ff:ff:ff:ff:ff:ff inet 192.168.1.33/24 brd 192.168.1.255 scope global enp0s8 valid_lft forever preferred_lft forever ~]# ~]# ip route show default default via 192.168.1.1 dev enp0s8 proto static metric 100 ~]# ~]# cat /etc/resolv.conf # Generated by NetworkManager search xomedia.io nameserver 192.0.2.200 nameserver 192.0.2.201 ~]# [root@localhost ~]# ping 192.168.1.30 PING 192.168.1.30 (192.168.1.30) 56(84) bytes of data. 64 bytes from 192.168.1.30: icmp_seq=1 ttl=64 time=0.791 ms 64 bytes from 192.168.1.30: icmp_seq=2 ttl=64 time=0.328 ms 64 bytes from 192.168.1.30: icmp_seq=3 ttl=64 time=1.58 ms — 192.168.1.30 ping statistics — 3 packets transmitted, 3 received, 0% packet loss, time 2087ms rtt min/avg/max/mdev = 0.328/0.898/1.577/0.515 ms [root@localhost ~]# Configure the hostname: ~]# nmcli general hostname ~]# ~]# nmcli general hostname xomedia.io ~]# ~]# nmcli general hostname xomedia.io ~]# Restart The following manual actions can be required if you do not want to reboot the host: Restart systemd-hostnamed manually: # systemctl restart Active shell users must re-login for the changes to take effect. [root@localhost ~]# systemctl restart systemd-hostnamed Active shell users must re-login for the changes to take effect: [root@localhost ~]# logout Connection to 192.168.1.33 closed. ✓  08/02/2024   18:56.39   /home/mobaxterm  ssh -l root 192.168.1.33 Activate the web console with: systemctl enable –now cockpit.socket Register this system with Red Hat Insights: insights-client –register Create an account or view all your systems at https://red.ht/insights-dashboard Last login: Thu Feb 8 18:42:41 2024 from 192.168.1.7 [root@xomedia ~]# Configure /etc/hosts with: ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.33 stllin00.xomedia.io stllin00 #EOF [root@localhost ~]# Reference this link for additional network configuration instructions: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/index

Date and Time

Ensure that your system clock is accurate: ~]# date Fri Feb 9 02:29:34 AM EST 2024 ~]# Local time: Fri 2024-02-09 02:29:42 EST Universal time: Fri 2024-02-09 07:29:42 UTC RTC time: Fri 2024-02-09 07:29:43 Time zone: America/New_York (EST, -0500) System clock synchronized: yes NTP service: active RTC in local TZ: no ~]# If not, you can use this command to adjust it: ~]# date -s “Fri Feb 02 16:35:08 EST 2024” It is important to have an accurate system clock for applications and databases. To configure NTP, follow instructions here: NOTE: It’s best to configure your your gateway router (less hops) as an NTP server, and point NTP to it – speak to your network admin to see if this is (or can) be set up. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/configuring-time-synchronization_configuring-basic-system-settings

Kernel

— https://softpanorama.org/Internals/Unix_filesystems/linux_swap_filesystem.shtml The Linux 2.6 kernel added a new kernel parameter called swappiness to let administrators tweak the way Linux swaps. It is a number from 0 to 100. In essence, higher values lead to more pages being swapped, and lower values lead to more applications being kept in memory, even if they are idle. Kernel maintainer Andrew Morton has said that he runs his desktop machines with a swappiness of 100, stating that “My point is that decreasing the tendency of the kernel to swap stuff out is wrong. You really don’t want hundreds of megabytes of BloatyApp’s untouched memory floating about in the machine. Get it out on the disk, use the memory for something useful.” One downside to Morton’s idea is that if memory is swapped out too quickly then application response time drops, because when the application’s window is clicked the system has to swap the application back into memory, which will make it feel slow. The default value for swappiness is 60. You can alter it temporarily (until you next reboot) by typing as root: echo 50 > /proc/sys/vm/swappiness If you want to alter it permanently then you need to change the vm.swappiness parameter in the /etc/sysctl.conf file. —

Mail

Modify the following lines in /etc/mail/sendmail.cf with your mail serve settings: ~]# cp -p /etc/mail/sendmail.cf /etc/mail/sendmail.cf.orig # who I masquerade as (null for no masquerading) (see also $=M) DMCALA.xomedia.io # “Smart” relay host (may be null) DSstlmail1.xomedia.io ~]# systemctl sendmail restart

Configuring Your System

Not that we’ve completed the required post-installation steps, we’re going to configure basic system settings.
  • Configure services with systemd for service management.
  • Administer users and groups.
  • Configure NTP using chrony.
  • configure the environment settings.
  • Installing software with dnf

Installing Software

We’re going to configure ‘Simple Content Access’ to install software. https://access.redhat.com/articles/simple-content-access#how-do-i-enable-simple-content-access-for-red-hat-subscription-management-2 Register your system on Customer portal: subscription-manager register –username <$INSERT_USERNAME_HERE> –password <$INSERT_PASSWORD_HERE> ~]# subscription-manager register –username john.doe@example.com –password ******* Registering to: subscription.rhsm.redhat.com:443/subscription The system has been registered with ID: 42f93340-31cc-4d68-be24-2608d7e9e4c6 The registered system name is: xomedia.io ~]# Red Hat provides very nice tooling like Red Hat Hybrid Cloud Console, a dashboard-based SaaS application that enables you to view subscription usage and manage your systems via your Red Hat account. Register your systems to Red Hat Insights: ~]# insights-client –register Successfully registered host xomedia.io Automatic scheduling for Insights has been enabled. Starting to collect Insights data for xomedia.io Writing RHSM facts to /etc/rhsm/facts/insights-client.facts … Uploading Insights data. Successfully uploaded report from xomedia.io to account 11764866. View the Red Hat Insights console at https://console.redhat.com/insights/ ~]# Verify registration: ~]# subscription-manager identity system identity: 42f93340-31cc-4d68-be24-2608d7e9e4c6 name: xomedia.io org name: 11283961 org ID: 11283961 ~]# Set the intended role of the system: ~]# subscription-manager syspurpose role –set “Red Hat Enterprise Linux Server” Warning: Provided value “Red Hat Enterprise Linux Server” is not included in the list of valid values – RHEL Server – RHEl Workstation role set to “Red Hat Enterprise Linux Server”. ~]# Set the intended Service Level Agreement (SLA) of the system: ~]# subscription-manager syspurpose service-level –set “Self-Support” service_level_agreement set to “Self-Support”. ~]# Set the intended usage of the system: ~]# subscription-manager syspurpose usage –set “Development/Test” usage set to “Development/Test”. ~]# Verify: ~]# subscription-manager syspurpose –show { “addons”: [], “role”: “Red Hat Enterprise Linux Server”, “service_level_agreement”: “Self-Support”, “usage”: “Development/Test” } ~]# Visit the following URLs to view your account subscription and systems: https://access.redhat.com/management https://console.redhat.com/insights/

users and Groups

To display user and group IDs: $ id uid=1000(example.user) gid=1000(example.user) groups=1000(example.user),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 To create a new user account: ~]# useradd xoneill To assign a new password to a user account belonging to example.user: ~]# passwd xoneill Create a group named staff with group ID 5000, use: ~]# groupadd -g 5000 staff Verification: ~]# tail /etc/group staff:x:5000: To add a user to a group: ~]# usermod -a -G staff xoneill Verification: To verify the new user is added, use the id utility. # id xoneill uid=5000(xoneill) gid=5000(xoneill) groups=5000(xoneill)

References

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/performing_a_standard_rhel_9_installation/index Performing a standard RHEL 9 installation Important changes in RHEL 9.x: Performing a standard RHEL 9 installation: This document provides an overview of changes in RHEL 9 since RHEL 8 to help you evaluate an upgrade to RHEL 9. Considerations in adopting RHEL 9 Key differences between RHEL 8 and RHEL 9 https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/considerations_in_adopting_rhel_9/index Simple Content Access https://access.redhat.com/articles/simple-content-access Getting Started with RHEL System Registration https://access.redhat.com/documentation/en-us/subscription_central/1-latest/html/getting_started_with_rhel_system_registration/index Registration Assistant Registering a System – Red Hat Enterprise Linux 9 https://access.redhat.com/labs/registrationassistant/rhel9/?tech=subscription&service=rhsm&process=sca&hasInsights=true&service_level=Self-Support&service_usage=Development%2FTest&service_role=Red%20Hat%20Enterprise%20Linux%20Server&select_system_purpose=1 Managing software with the DNF tool: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/managing_software_with_the_dnf_tool/index In this playbook we demonstrate how to perform an enterprise-grade installation of Red Hat. Red Hat Linux is a commercial open-source Linux distribution developed by Red Hat anbd targeted towards the commcerical market. Red Hat has been a market leader for a very long time, with SUSE also holding a notable share. These are 2 platofrms we both use and cover in our articles. Red Hat Enterprise Linux, has long maintained a strong presence in the enterprise operating system market Red hat is used in the cloud (off prem, on prem, hybrid)… from cloud services and Kubernetes to containers and serverless, is the operating system; frequently, this operating system is Linux. Red Hat is proud of the leadership position we have long maintained in the enterprise operating system market, providing the Linux foundation to drive enterprise IT innovation forward.

Storage

For production implementations, storage and file system planing is necessary. Storage and file system layout should reflect both best practice of an OS ‘server’ install and also planned relative to the application the system will be supporting.

  • Cloud environments: Follow best practice per each vendor.
  • Virtual environments: Follow best practice per each vendor.
  • Bare metal: Configure the OS on internal mirrored drives.

Installing everything in ‘/’ (default in many distros) is only ideal for personal, workstation and hobby installs. The partition / file system layout should be uniform across all DEV, Staging, Test and Production environments

The following is a real-world customer production implementation on RHEL 8.x. This particular layout is based on based on 2+ decades of experience on a platform that services 25+ million subscribers.

We’re using a single VG:

[root@host574 ~]# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  vg00   1   9   0 wz--n- <49.00g   <4.00g

File systems are isolated from each other, if a single file system fills up, it does not take down the entire system.

[root@host574 ~]# lsblk
NAME                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                    8:0    0   50G  0 disk
+-sda1                 8:1    0    1G  0 part /boot
+-sda2                 8:2    0   49G  0 part
  +-vg00-root        253:0    0    2G  0 lvm  /
  +-vg00-swap        253:1    0    4G  0 lvm  [SWAP]
  +-vg00-usr         253:2    0    6G  0 lvm  /usr
  +-vg00-var         253:3    0    6G  0 lvm  /var
  +-vg00-opt         253:4    0    6G  0 lvm  /opt
  +-vg00-opt_hds     253:5    0    8G  0 lvm  /opt/hds
  +-vg00-var_log_hds 253:6    0    2G  0 lvm  /var/log/hds
  +-vg00-rpms        253:7    0   10G  0 lvm  /rpms
  +-vg00-OV          253:8    0    1G  0 lvm  /var/opt/OV

Here, /opt/intel is pretty sizable, so we decided to isolate it from /opt.

[root@host574 ~]# df -k
Filesystem                     1K-blocks       Used  Available Use% Mounted on
devtmpfs                        16342752          0   16342752   0% /dev
tmpfs                           16360596          0   16360596   0% /dev/shm
tmpfs                           16360596      33592   16327004   1% /run
tmpfs                           16360596          0   16360596   0% /sys/fs/cgroup
/dev/mapper/vg00-root            1992552     686604    1184708  37% /
/dev/mapper/vg00-usr             6102624    3255396    2516272  57% /usr
tmpfs                            4194304       7144    4187160   1% /tmp
/dev/sda1                         996780     220968     707000  24% /boot
/dev/mapper/vg00-opt             6119008    3112652    2717348  54% /opt
/dev/mapper/vg00-rpms           10218772        472    9677628   1% /rpms
/dev/mapper/vg00-var             6110816     785540    5015296  14% /var
/dev/mapper/vg00-var_log_hds     1992552         24    1871288   1% /var/log/hds
/dev/mapper/vg00-opt_hds         8154588         24    7718752   1% /opt/hds
/dev/mapper/vg00-OV               996780     166752     761216  18% /var/opt/OV
/dev/mapper/vg01-intel          30787492   23853820    5344424  82% /opt/intel


Thanks for Reading!

Please help keep our service free by donating towards our running costs.

If you enjoyed this article, please sign up to get an email whenver we post:


Ember Quail


Back to Blog Home

To top