Linux & Unix SysAdmin Reference

💻 Linux Admin Interview Guide

Linux & Unix SysAdmin Command Reference — Core Admin Topics · Commands · Q&A · Real-world Scenarios

11 Topics LVM · SAN · Security · Performance Satellite Patching · Kernel · Scripting Best Practices
🗂️ Content reorganized for easier access: Server hardware topics (HP iLO, Dell iDRAC, RAID) are now on the 🖥️ Server Hardware page. Solaris/LDOM/SVM topics are on the 🌞 Solaris page.
💾

LVM & Filesystem Management

Logical Volume Manager — create, extend, reduce, and manage filesystems in enterprise Linux

01

PV → VG → LV Creation Workflow

The fundamental LVM hierarchy: Physical Volumes (PV) → Volume Groups (VG) → Logical Volumes (LV). Always follow this sequence when provisioning new storage.

Step-by-step commands
# Step 1: Identify available disks fdisk -l | grep -i sd # Step 2: Create Physical Volumes pvcreate /dev/sdb pvcreate /dev/sdc /dev/sdd /dev/sde pvs # verify # Step 3: Create Volume Groups vgcreate datavg /dev/sdb vgcreate nnvg /dev/sdc vgcreate jnvg /dev/sdd vgcreate zkvg /dev/sde vgs # verify # Step 4: Create Logical Volumes lvcreate -n data1 -L 500G jnvg lvcreate -n zk -L 250G zkvg lvcreate -n log -L 1000G datavg # Step 5: Format (mkfs) mkfs.ext4 /dev/mapper/datavg-log mkfs.ext4 /dev/mapper/jnvg-data1 # Step 6: Update /etc/fstab echo "/dev/mapper/datavg-log /var/log ext4 defaults 1 2" >> /etc/fstab # Step 7: Mount mkdir -p /var/log mount -a df -kh
QWhat is the difference between PV, VG, and LV?
▸ ANSWER

PV (Physical Volume) — a raw disk or partition initialized for LVM use (e.g., /dev/sdb). It's the building block. VG (Volume Group) — a pool formed by combining one or more PVs. Think of it as a logical disk. LV (Logical Volume) — a slice carved from a VG, equivalent to a partition. It's what you format and mount. The key advantage: LVs can be resized, spanned across disks, and snapshotted without downtime.

QHow do you extend an LV that has no free VG space?
▸ ANSWER

First, expand the VG by adding a new PV: pvcreate /dev/sde then vgextend datavg /dev/sde. After that, lvextend -L +200G /dev/mapper/datavg-log -r (the -r flag resizes the filesystem automatically). For virtual disks, rescan first: echo 1 > /sys/class/block/sdc/device/rescan then pvresize /dev/sdc.

QHow do you safely reduce (shrink) a Logical Volume?
▸ ANSWER

LV shrinking is risky — must shrink filesystem BEFORE reducing LV size, never the other way:

  1. 1Unmount: umount /home
  2. 2Check filesystem: e2fsck -f /dev/mapper/vg-LogVol00
  3. 3Shrink FS first: resize2fs /dev/mapper/vg-LogVol00 10G
  4. 4Reduce LV: lvreduce -L 10G /dev/mapper/vg-LogVol00
  5. 5Re-check FS: e2fsck -f /dev/mapper/vg-LogVol00
  6. 6Remount: mount /home
QWhat causes "LV is in Use" error during lvremove and how to fix it?
▸ ANSWER

This happens when a process holds the LV open. Fix: dmsetup info -c | grep <lvname> to get the major:minor numbers, then lsof | grep "253,9" to find the PID, then kill -9 <PID>, and retry lvremove. Also check if it's mounted: umount -l /mountpoint before removing.

02

LV Extension Commands & Resize Scenarios

# Extend by adding size, auto-resize FS (-r) lvextend -L +100G /dev/mapper/datavg-lib -r lvextend -L +500G /dev/mapper/vg_splunk-lv_splunk -r lvextend -L +3.1T /dev/mapper/oravg-lvoraoltp001 -r # LV extend by expanding virtual disk size first echo 1 > /sys/class/block/sdc/device/rescan pvresize /dev/sdd vgs lvextend -L +200G /dev/mapper/nfsvg-nfslv -r # Swap resize procedure swapoff /dev/mapper/rootvg-lv_swap lvresize -L 16G /dev/mapper/rootvg-lv_swap mkswap /dev/mapper/rootvg-lv_swap swapon -a free -h
QWhat does the -r flag do in lvextend?
▸ ANSWER

The -r flag tells lvextend to also resize the filesystem automatically after extending the LV. Without it, you'd have to run resize2fs /dev/mapper/vg-lv manually. It internally calls the appropriate resize tool based on the filesystem type (resize2fs for ext4, xfs_growfs for XFS, etc.).

QHow do you increase swap space on an existing LVM partition?
▸ ANSWER

1. swapoff /dev/mapper/rootvg-lv_swap — disable swap. 2. lvresize -L 16G /dev/mapper/rootvg-lv_swap — resize LV. 3. mkswap /dev/mapper/rootvg-lv_swap — re-initialize swap. 4. swapon -a — re-enable. 5. Verify with free -h and cat /proc/swaps. Note: mkswap wipes old swap signature — data is lost, so swap should be empty before this.

QHow do you move a home directory to a new LVM partition?
▸ ANSWER

1. Create new LV: lvcreate -n qlikhomelv -L 10G qlikvg. 2. Format: mkfs.ext4 /dev/mapper/qlikvg-qlikhomelv. 3. Mount to temp: mount /dev/mapper/qlikvg-qlikhomelv /mnt. 4. Copy data: cd /home/user; tar -cf /mnt/home.tar *. 5. Backup original dir: mv /home/user /home/user_bkp. 6. Create new dir: mkdir /home/user. 7. Extract: cd /mnt; tar -xf home.tar. 8. Add fstab entry, mount -a, set correct ownership/permissions with chown/chmod.

03

fstab Management & Mount Operations

# Always backup fstab before changes cp -rp /etc/fstab /etc/fstab_bkp-`date +%Y%m%d` # Add entries echo "/dev/mapper/datavg-log /var/log ext4 defaults 1 2" >> /etc/fstab # Comment out entries (disable mount) sed -i '/data/s/^#*/#/g' /etc/fstab # Add ACL support to a mount sed -i '/Cloudera/ s/defaults/defaults,acl/' /etc/fstab mount -o remount,acl /opt/Cloudera # Test without reboot mount -a df -kh
QWhat do the last two numbers in an fstab entry mean?
▸ ANSWER

The 5th field (dump) — 0 means no backup with dump utility, 1 means yes. The 6th field (pass) — controls fsck order at boot: 0 = skip, 1 = check first (root only), 2 = check after root. Never use 1 for non-root filesystems. Best practice: root = 1, data partitions = 2, tmpfs/NFS = 0 0.

QIf an inactive VG is not detected, how do you activate it?
▸ ANSWER

Run lvscan to see the status. If an LV shows as inactive, activate with vgchange -ay /dev/datavgc. This is common after disk replacements or importing VGs from other systems. After activation, mount -a to remount filesystems.

🔌

SAN & Multipath Storage

Storage Area Network management, multipath I/O, FC HBAs, and disk migration procedures

01

SAN Pre/Post Check Commands

# Pre-migration checks date; cat /etc/redhat-release; uname -a multipath -ll # show all multipath devices /etc/powermt display dev=all # EMC PowerPath status inq -sym_wwn # Symmetrix WWN inquiry cat /sys/class/fc_host/host*/port_state # FC HBA port states sanview # SAN topology view vxdmpadm listctlr all # Veritas DMP controllers # Orphan path check multipathd show paths | grep -i orphan # Remove failed/orphan paths multipath -ll | grep -i fail | awk '{print $3}' | \ while read i; do echo 1 > /sys/block/$i/device/delete; done # Scan for new SCSI devices for i in /sys/class/scsi_host/*; do echo "- - -" > $i/scan; done ls /sys/class/scsi_host/ | while read host; do echo "- - -" > /sys/class/scsi_host/$host/scan done
QWhat is multipath I/O and why is it used in enterprise environments?
▸ ANSWER

Multipath I/O (MPIO) allows a server to access storage through multiple physical paths (HBA ports, switches, storage ports) simultaneously. Benefits: (1) High Availability — if one path fails, I/O continues through other paths. (2) Load Balancing — I/O distributed across paths improves throughput. (3) Non-disruptive maintenance — can replace failed paths without downtime. The OS sees one device even though multiple physical paths exist.

QHow do you handle orphan paths in multipath?
▸ ANSWER

Orphan paths are paths that don't belong to any multipath group. Fix: multipathd show paths | grep -i orphan to identify them, then for each orphan path, get the device name with for i in `multipathd show paths format "%w;%i;%s;%t_%T" | grep undef | awk -F";" '{print $2}'`, find the block device via lsscsi, then delete: echo 1 > /sys/block/$fd/device/delete. Then run multipath -r to reload and service multipathd reload.

QWalk through a SAN migration LV extension procedure.
▸ ANSWER
  1. 1Scan for new LUNs: for i in /sys/class/scsi_host/*; do echo "- - -" > $i/scan; done
  2. 2Verify new LUNs visible: inq | grep -i <LUNID>
  3. 3Check multipath: multipath -ll | grep -i mpathlt
  4. 4Create PV on new mpath device: pvcreate /dev/mapper/mpathlr
  5. 5Extend VG: vgextend datavg /dev/mapper/mpathlr
  6. 6Extend LV: lvextend -L +200G /dev/mapper/datavg-data -r
  7. 7Verify: df -kh
02

FC HBA Troubleshooting & Path Management

# Check FC port states cat /sys/class/fc_host/host*/port_state # Solaris FC HBA checks mpathadm list initiator-port mpathadm list LU luxadm -e port fcinfo hba-port -l # AIX path management lspath | grep -i failed | grep -i fscsi12 chpath -s enabled -l hdisk69 -p fscsi1 # PowerPath powermt display powermt check force # Last resort to re-enable failed path # SCSI ID check (Linux) ls -d /sys/block/sd*/device/scsi_device/*
QWhat is the difference between multipath and PowerPath?
▸ ANSWER

device-mapper-multipath is the open-source Linux kernel solution, configured via /etc/multipath.conf. It's vendor-agnostic. EMC PowerPath is a vendor-specific commercial product from Dell EMC for EMC storage arrays. PowerPath offers advanced features like dynamic load balancing algorithms, better EMC integration, and automated failover. In interviews: know that powermt display dev=all shows PowerPath devices and multipath -ll shows dm-multipath devices.

🗄️

Backup & NetBackup (Veritas)

NetBackup client troubleshooting, certificate management, and log archival

01

NetBackup Error 7641 — Certificate & Host Cache Fix

⚠ Error 7641 — SSL certificate / host cache mismatch. Follow these steps in sequence.
# Step 1: Clear host cache /usr/openv/bin/bpclntcmd -clear_host_cache # Step 2: Stop and restart NB client services /usr/openv/netbackup/bin/goodies/netbackup stop /opt/VRTSpbx/bin/vxpbx_exchanged stop # wait 2 minutes... /usr/openv/netbackup/bin/goodies/netbackup start /opt/VRTSpbx/bin/vxpbx_exchanged start # Step 3: Run certificate script /usr/openv/support/scripts/get_nb_certs.sh # Step 4: Get certificate from master server /usr/openv/bin/nbcertcmd -getCertificate -host your_server -server crebm4600 # Step 5: Display CA cert details /usr/openv/bin/nbcertcmd -displayCACertDetail -server crebm4600 # Check running processes /usr/openv/netbackup/bin/bpps -x
QWhat causes NetBackup error 7641 and how do you resolve it?
▸ ANSWER

Error 7641 relates to host credential/certificate issues preventing client-master server communication. Common causes: expired certificates, stale host cache after server migration, or wrong master server configured. Resolution steps: (1) Clear host cache with bpclntcmd -clear_host_cache. (2) Restart all NetBackup and VxPBX services. (3) Run get_nb_certs.sh to regenerate certificates. (4) Use nbcertcmd -getCertificate to pull a fresh cert from the master server. Always verify services are up with bpps -x after resolution.

QWhat is bpps and how is it different from checking netbackup processes manually?
▸ ANSWER

bpps -x is NetBackup's own process status tool that shows all NB-related daemons in a formatted output with process relationships. It's far more reliable than ps -ef | grep netbackup because it understands the NB process hierarchy and shows the state of each daemon specifically. The -x flag shows extended information including legacy client processes.

02

Log Compression & Archival (find + gzip/bzip2)

A critical operational task — compressing old logs to reclaim disk space. The standard pattern uses find to identify, filter, and compress in a pipeline.

# Compress files older than 31 days, excluding already compressed find /DAPlogs/Citi/Logs -mtime +31 -type f \ | egrep -v "gz$|bz2$" \ | xargs ls -lrt | awk '{print $9}' \ | while read A; do bzip2 $A; done # gzip files older than 30 days in Tanium log dir find /opt/Tanium/TaniumClient/tmp -mtime +30 -type f \ | egrep -v "gz$|bz2$" \ | xargs ls -lrt | awk '{print $9}' \ | while read A; do gzip $A; done # Compress nginx logs with date suffix ls -lrt nginx-*.log | awk '{print $NF}' \ | xargs gzip -S -`date +"%Y%m%d"`.gz # Find and delete files older than 90 days find /tmp -type f -mtime +90 -exec rm {} \; # Check disk usage first du -sh * | sort -hr | head -n 20 find . -xdev -size +1000000c -exec ls -lh {} \; | sort -nrk 5 | head -15
QExplain the find command options: -mtime, -type, -xdev
▸ ANSWER

-mtime +N — files modified more than N days ago (+31 = older than 31 days). -mtime -N — files modified within the last N days. -type f — only regular files (not dirs/symlinks). -xdev — don't cross filesystem boundaries (stays on same device/mount). Critical for log searches so you don't inadvertently scan NFS/tmpfs mounts. -size +1000000c — files larger than 1MB (c = bytes).

QWhat is the difference between gzip and bzip2?
▸ ANSWER

gzip: faster compression/decompression, lower compression ratio, produces .gz files. Best for real-time log compression where speed matters. bzip2: slower but achieves 10-15% better compression, produces .bz2 files. Best for archival where storage savings matter more than speed. In practice: use gzip for active log rotation, bzip2 for long-term archival to tape/cold storage like LTFS.

⚙️

sed, awk & Shell Scripting

Text processing, in-place file editing, loop constructs, and automation patterns

01

sed — In-place File Editing Patterns

# Add line at TOP of file sed -i '1i SERVER = sg3lixnbirmed02' bp.conf # Remove a specific line by pattern sed -i -e 's/SERVER = sg3lixnbirmas02//g' bp.conf sed -i '/kudu/d' /etc/passwd # delete lines matching 'kudu' # Insert line at specific line number sed -i '47i vm.min_free_kbytes = 1048576' /etc/sysctl.conf # Delete a range of lines sed -i '12,15d' file # Comment a line (prepend #) sed -i '\/sbin\/reboot/s/^\(.*\)$/#\1\n/' /var/spool/cron/root # Uncomment a line (remove leading #) sed -i '\/sbin\/shutdown/s/^#//' /var/spool/cron/root # Replace value within matching line sed -i '/ulimit -u/ s/65536/262144/' /etc/profile sed -i '/Cloudera/ s/defaults/defaults,acl/' /etc/fstab # Comment out a line by pattern sed -i 's/^|||splunk_idx||*/#&/' /opt/IBM/ITM/config/K20_MON_PROCESS.cfg # Add line AFTER a match sed -i '/|||splunk_idx||*/a NEW_LINE_CONTENT' /opt/IBM/ITM/config/K20_MON_PROCESS.cfg # Replace with safe temp file (for complex changes) sed '/join-ent/ s/oldpwd/newpwd/' /opt/admin/join > /tmp/jointmp cat /tmp/jointmp > /opt/admin/join
QWhat does the -i flag do in sed and is it safe?
▸ ANSWER

-i means "in-place" — edits the file directly instead of printing to stdout. On GNU sed (Linux) you can use -i alone; on BSD/macOS sed, you must provide a suffix like -i.bak. Best practice: ALWAYS backup before sed -i: cp -p file file.bak && sed -i '...' file. For critical files like /etc/fstab, /etc/passwd, always backup with a timestamp first.

QHow does the substitution flag & work in sed?
▸ ANSWER

In sed's replacement string, & represents the entire matched pattern. So s/^pattern/#&/ means: match ^pattern at start of line, and replace it with # + the entire match. This effectively prepends # to comment out matching lines without having to re-type the pattern in the replacement. Example: sed -i 's/^vm.swappiness/#&/' /etc/sysctl.conf comments out the vm.swappiness line.

QWhat is the difference between sed 'd' and sed 's/pattern//g'?
▸ ANSWER

sed '/pattern/d' deletes the entire line if pattern matches. sed 's/pattern//g' removes only the matched text within a line, leaving an empty line or shortened line. Use /d when you want to completely remove a line (like removing a server entry). Use s// when you want to change a value within a line.

02

Shell Loops — For Loops Over Server Lists

# Run command on multiple servers via SSH for i in `cat /var/tmp/serverlist.txt`; do ssh $i 'command here' done # SSL cert backup across cluster for i in `cat /var/tmp/serverlist.txt`; do ssh $i 'cp -rp /opt/Cloudera/ssl/* /opt/Cloudera/ssl/backup_ssl_bkp_Oct03' done # Push certs via SCP then extract for i in `cat /var/tmp/serverlist.txt`; do scp master:/var/tmp/certs/Cloudera_ssl.tar $i:/opt/Cloudera/ssl/ done for i in `cat /var/tmp/serverlist.txt`; do ssh $i 'cd /opt/Cloudera/ssl; tar -xvf /opt/Cloudera/ssl/Cloudera_ssl.tar' done # Nested loop: FID per server for i in `cat destsrv`; do for j in `cat fid`; do scp -p src:/opt/gpa/keytabs_for_failed_scp/$j.$i.keytab keytab/ done done # Restart service and check status for i in `cat /var/tmp/serverlist.txt`; do ssh $i 'service cloudera-scm-agent restart' done for i in `cat /var/tmp/serverlist.txt`; do ssh $i 'service cloudera-scm-agent status' done
QWhy use a server list file instead of hardcoding hostnames?
▸ ANSWER

Using a file (cat serverlist.txt) is a best practice because: (1) Easy to modify scope without changing the script. (2) Auditable — the list is a record of what systems were affected. (3) Reusable — same list for pre-check, action, and post-check loops. (4) Reduces typos — hostname is defined once. In large clusters (100+ nodes), hardcoding is impractical. Always verify the list before running destructive operations with a dry-run loop that just echos hostnames.

QHow do you kill multiple processes matching a pattern?
▸ ANSWER

Use a pipeline combining ps, grep, awk/cut, and kill: kill $( ps -ef | egrep "BD_Setup|rpm" | grep -v grep | tr -s " " | cut -d" " -f2 | tr "\n" " " ). The grep -v grep is critical to exclude the grep process itself. Alternatively: pkill -f "pattern" or killall processname. For user-specific: ps -ef | grep 'username' | awk '{print $2}' | xargs kill.

03

ACL Management — setfacl / nfs4_setfacl

# Set ACL for a user on a directory setfacl -m user:user1:rwx /dir/name setfacl -R -m u:colleague:rwX . # recursive, X=execute on dirs only setfacl -m u:wsadmin:rw autosys # read-write only # Set mask (maximum effective permissions) setfacl -R -m m::rwx # NFS4 ACL (for NFSv4 mounts) nfs4_getfacl /nasapps/cde/cdesea1 nfs4_setfacl -R -a A:O:104156563@nfsdomain:rwx /apps/clmreg1/path # Enable ACL on a mount (if not set) mount -o remount,acl /apps # Also update fstab to persist: sed -i '/apps/ s/defaults/defaults,acl/' /etc/fstab
QWhat is the difference between standard Unix permissions and ACLs?
▸ ANSWER

Standard Unix permissions only support 3 permission sets: owner, group, others. ACLs (Access Control Lists) allow fine-grained permissions for any number of users and groups. Example: standard permissions can't grant read-only access to one specific user who isn't in the file's group — ACLs solve this. The + sign in ls -l output indicates ACLs are set. Use getfacl filename to view them. NFSv4 ACLs use different syntax with nfs4_setfacl and support inheritance flags.

📊

Performance Monitoring & SAR

System Activity Reporter, CPU/memory/IO analysis, process troubleshooting

01

SAR — System Activity Reporter Commands

# Navigate to SAR data directory cd /var/log/sa/ # Real-time monitoring sar -f sa12 # CPU from sa file 12 sar -r -f sa12 # Memory utilization sar -b -f sa12 # I/O transfer rates sar -n EDEV -f /var/log/sa/sa21 # Network errors # Filter network stats by interface sar -n EDEV -f /var/log/sa/sa21 \ | egrep 'IFACE|ens192|ens161' \ | egrep 'IFACE|11:|Average' # Batch SAR report across all sa files ls -lrth sa* | grep -v sar | awk '{print $9}' > /tmp/sarfilelist for i in `cat /tmp/sarfilelist`; do sar -f $i | egrep -i 'CPU|average' echo "___" done > /tmp/`uname -n`_CPU.txt for i in `cat /tmp/sarfilelist`; do sar -r -f $i | egrep -i 'Linux|%memused|Average' echo "___" done > /tmp/`uname -n`_Memory.txt # Email the report echo "PFA" | mail -s "SAR REPORT From `uname -n`" \ -a /tmp/`uname -n`_CPU.txt \ -a /tmp/`uname -n`_Memory.txt admin@company.com
QWhat is SAR and where does it store its data?
▸ ANSWER

SAR (System Activity Reporter) is part of the sysstat package. It collects system statistics (CPU, memory, I/O, network) on a scheduled basis via cron (usually every 10 minutes). Data is stored in binary format in /var/log/sa/ as files named saNN where NN is the day of month (e.g., sa15 = 15th of month). The sar command reads these files. Compared to top/vmstat, SAR provides historical trending — invaluable for post-mortem analysis of past performance issues.

QHow do you find top CPU and memory consuming processes?
▸ ANSWER

CPU: ps aux --sort=-%cpu | head -n 15 (descending % CPU). Memory: ps aux --sort -rss | head -n 15 (descending RSS memory). For AIX: topas or svmon -Pt10 for top 10 memory consumers. On Solaris: prstat. For real-time Linux: top then press M for memory sort, P for CPU sort.

QWhat does iostat -xm 2 tell you and when do you use it?
▸ ANSWER

iostat -xm 2 shows extended disk statistics in megabytes, refreshing every 2 seconds. Key columns: %util (disk utilization — if near 100%, disk is bottleneck), await (average I/O wait time in ms — should be low), r/s and w/s (reads/writes per second), svctm (service time). Use when investigating slow applications, high I/O wait in top, or storage performance issues. Compare with multipath -ll to correlate to physical paths.

02

Reboot Reason Investigation

# Find reboot/shutdown reason in logs grep -iv ': starting\|kernel: .*: Power Button\|watching system buttons\|Stopped Cleaning Up' \ /var/log/messages /var/log/syslog \ | grep -iw 'recover[a-z]*\|power[a-z]*\|shut[a-z ]*down\|rsyslogd\|ups' \ | grep -i 'Aug 31 17:' | more # Quick server info check hostname; uname -a; uptime; date; who -br # Check last reboot last reboot | head -5 who -b # last boot time # Check WorkloadAutomation reboot logs cd /opt/CA/WorkloadAutomationAE/SystemAgent/WA1_AGENT/log cat receiver.archive.log | grep reboo
QHow do you investigate an unexpected server reboot?
▸ ANSWER

1. last reboot — check when it happened. 2. uptime — verify current uptime. 3. Check /var/log/messages around the reboot time for OOM killer, kernel panic, hardware errors. 4. Check dmesg for hardware errors. 5. journalctl -b -1 — previous boot journal (systemd). 6. Check ILO/iDRAC logs for hardware events (power loss, thermal). 7. Look for scheduled reboots in crontab: crontab -l | grep reboot. 8. Check crash dumps in /var/crash.

🔒

Security, SELinux & PAM

PAM configuration, SELinux modes, crontab access control, RPM database repair

01

SELinux Management

# Check current SELinux mode getenforce # Enforcing / Permissive / Disabled sestatus # detailed status # Temporary mode change (no reboot) setenforce 0 # Permissive setenforce 1 # Enforcing # Permanent disable (requires reboot) vi /etc/selinux/config # Change: SELINUX=disabled shutdown -r now # View SELinux denials audit2why < /var/log/audit/audit.log
QWhat are the three SELinux modes and when would you use each?
▸ ANSWER

Enforcing: SELinux policy is active and violations are blocked and logged. This is the secure default for production systems. Permissive: Violations are logged but NOT blocked. Use during troubleshooting to determine if SELinux is causing an application issue, or when deploying new applications. Disabled: SELinux is completely off. Avoid in production; re-enabling requires a full filesystem relabel. Interview tip: Always prefer Permissive over Disabled for troubleshooting — it's reversible without a full relabel.

QWhat is the difference between SELINUXTYPE=targeted and mls?
▸ ANSWER

targeted: Only specific processes (network daemons like httpd, sshd, etc.) are protected by SELinux policy. Most processes run in the unconfined domain. This is the default and most common. minimum: A subset of targeted — only the most critical processes are protected. mls: Multi-Level Security — enforces Bell-LaPadula model with sensitivity labels. Used in government/military environments with classified data. Extremely strict, complex to manage.

02

PAM Configuration — Crontab Access Control

Issue: In RHEL 7, user FIDs cannot access crontab due to PAM configuration changes from RHEL 5/6.
# Step 1: Add user to /etc/security/access.conf +:USER_Name:cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6 # Step 2: If still failing, edit /etc/pam.d/crond # Change this line: account required pam_access.so # To this: account sufficient pam_access.so # Step 3: Verify su - username crontab -l
QWhat is the difference between PAM 'required' and 'sufficient'?
▸ ANSWER

In PAM, the control flag determines how a module's success/failure affects the overall authentication: required: Must succeed for authentication to pass. If it fails, authentication ultimately fails (but all remaining modules still run — this prevents revealing which module failed). sufficient: If this module succeeds and no prior required module has failed, authentication succeeds immediately — no further modules are checked. requisite: Like required, but failure causes immediate termination. Changing pam_access.so from required to sufficient means if access.conf check passes, cron access is granted without further checks.

03

RPM Database Rebuild Procedure

# Step 1: Backup RPM database mkdir /root/backups.rpm.`date +"%Y-%m-%d"`/ cp -avr /var/lib/rpm/ /root/backups.rpm.`date +"%Y-%m-%d"`/ # Step 2: Remove corrupted lock files rm -f /var/lib/rpm/__db.00* # Step 3: Verify RPM database integrity db_verify /var/lib/rpm/Packages # Step 4: Rebuild the database indices rpm --rebuilddb # Step 5: Clean yum cache yum clean all
QWhen and why does the RPM database get corrupted?
▸ ANSWER

The RPM database (Berkeley DB files in /var/lib/rpm/) gets corrupted when: (1) System crashes or loses power during an RPM operation. (2) Simultaneous RPM/yum processes creating lock conflicts. (3) NFS mounts used for RPM DB (file locking issues). (4) Out-of-space conditions mid-install. Symptoms: rpm -qa hangs or errors, yum fails with DB errors, package operations fail. The rebuild re-creates the index files from the raw Packages database. If db_verify Packages fails, the corruption is severe and may need restoring from backup.

🔑

SSH Key Management & Kerberos Keytabs

SSH key setup, bulk deployment scripts, keytab management, NSCD troubleshooting

01

SSH Key Conversion & Deployment

# SSH with specific cipher (for legacy systems) ssh -t --ciphers=aes256-ctr relww-cob1935 bash # RHEL 6 key → RHEL 7 conversion ssh-keygen-g3 --key-format openssh2 \ --import-public-key pdwtwsf1@server.pub \ pdwtwsf1@server_converted.pub # RHEL 7 → RHEL 6 conversion ssh-keygen-g3 --import-public-key \ tangalang_openssh tangalang@sd-dba7-827f.pub # Import public keys for multiple FIDs for i in `ls`; do ssh-keygen-g3 --import-public-key $i ../ssh-script/keys/$i done # Set correct keytab permissions function setperm { chown $1:$1 /opt/Cloudera/keytabs/$1.*.keytab chmod 600 /opt/Cloudera/keytabs/$1.*.keytab } for j in `cat fid`; do setperm $j; done
QWhat is a Kerberos keytab file and why must it have 600 permissions?
▸ ANSWER

A keytab (key table) file stores Kerberos principal credentials encrypted with the service's secret key, allowing a service to authenticate to Kerberos without a password prompt. It's essentially a long-lived credential file. Permissions must be 600 (owner read-write only) because: anyone who can read a keytab can authenticate as that Kerberos principal. Wider permissions are a critical security vulnerability. In Cloudera/Hadoop clusters, each service (HDFS, HBase, Solr) has its own keytab owned by its service account.

QWhat is Tectia SSH and how does it differ from OpenSSH?
▸ ANSWER

Tectia SSH (formerly SSH Tectia, originally from SSH Communications Security) is the commercial enterprise SSH product. OpenSSH is the open-source implementation. Key differences: Tectia uses its own key format and stores keys in /etc/opt/SSHtectia/keys/. It supports SSH2 protocol and has different authorization file syntax. Keys need to be converted when migrating between Tectia and OpenSSH servers using ssh-keygen-g3. Tectia also supports FIPS 140-2 mode and has centralized certificate management features.

02

NSCD Troubleshooting — Name Service Cache Daemon

# NSCD cache database files ls /var/db/nscd/ # Should see 3 files: passwd, group, hosts # Fix procedure: # 1. Stop nscd service service nscd stop # 2. Backup cache files mkdir /var/db/nscd_bkp cp /var/db/nscd/* /var/db/nscd_bkp/ # 3. Delete corrupted cache files rm -f /var/db/nscd/passwd /var/db/nscd/group /var/db/nscd/hosts # 4. Restart nscd service nscd start # Related: check HAC group membership getent group prv_hac_sd-2cad-109d | grep oracle
QWhat is NSCD and what happens if its cache gets corrupted?
▸ ANSWER

NSCD (Name Service Cache Daemon) caches NSS lookups (passwd, group, hosts) to reduce latency and AD/LDAP query load. Corruption symptoms: getent passwd hangs or returns wrong data, id username fails, SSH authentication issues, sudo failures. The cache files in /var/db/nscd/ can become corrupted after crashes or LDAP inconsistencies. Fix: stop nscd, delete cache files (they rebuild on start), restart. This is a Level 1 troubleshooting step for "user not found" or AD auth failures.

🧠

Kernel Parameters & System Configuration

sysctl tuning, GRUB management, Dracut issues, VCS clustering, Tanium

01

Kernel Parameter Tuning — sysctl

# Set kernel parameters (persistent via sysctl.conf) # Thread and process limits sed -i '/kernel.threads-max/d' /etc/sysctl.conf sed -i '47i kernel.threads-max = 2000000' /etc/sysctl.conf sed -i '/kernel.pid_max/d' /etc/sysctl.conf sed -i 'kernel.pid_max = 2000000' >> /etc/sysctl.conf # Memory management echo "vm.swappiness = 1" >> /etc/sysctl.conf # reduce swap tendency echo "vm.min_free_kbytes = 1048576" >> /etc/sysctl.conf # ~1GB reserve echo "vm.max_map_count = 8000000" >> /etc/sysctl.conf # File limits echo "fs.file-max = 6552837" >> /etc/sysctl.conf # Apply immediately without reboot sysctl -p # Apply to running kernel also echo 2000000 > /proc/sys/kernel/threads-max echo 2000000 > /proc/sys/kernel/pid_max echo 8000000 > /proc/sys/vm/max_map_count # Conditional script (only update if value is lower) [ $( sysctl -n kernel.threads-max ) -lt 2000000 ] && \ echo "kernel.threads-max = 2000000" >> /etc/sysctl.conf
QWhat does vm.swappiness control and what value should it be in production?
▸ ANSWER

vm.swappiness controls how aggressively the kernel swaps out anonymous memory pages (application data) to disk. Range: 0-100. Value 0 = avoid swapping unless OOM is imminent. Value 100 = swap aggressively. For most database servers and performance-critical applications: set to 1 (Hadoop/HBase recommendation). For general servers: 10-30. Default is 60 on RHEL/CentOS. High swappiness = excessive swapping = poor performance. Verify with: sysctl vm.swappiness.

QWhat is vm.max_map_count and when do you need to increase it?
▸ ANSWER

vm.max_map_count limits the number of memory map areas a process can have. Default is 65536. Elasticsearch, Hadoop, Spark, and Java applications with large JVMs often require 262144-8000000. Symptom of too-low value: failed to create JVM, OOM errors, memory mapping failures. Elasticsearch specifically requires at least 262144. The GPA/Hadoop teams in the notes required 8000000. Changing this doesn't require reboot — write to /proc/sys/vm/max_map_count for immediate effect.

02

GRUB2 — Boot Kernel Management (Dracut Issue Fix)

Dracut Prompt Issue: Server drops to dracut emergency shell at boot. Cause: grubenv missing/null or wrong default kernel set.
# Check current grubenv (default kernel) ls -lrt /boot/grub2/grubenv cat /boot/grub2/grubenv # List available kernels (note their order 0,1,2...) awk -F\' /^menuentry/{print\$2} /etc/grub2.cfg # Check current running kernel uname -a # Backup grubenv mv /boot/grub2/grubenv /boot/grub2/grubenv.bkp # Set default kernel (0 = first/newest, 1 = second, etc.) grub2-set-default 1 # set to latest kernel # Remove old kernels (keep latest 2) package-cleanup --oldkernels --count=2
QWhat is the Dracut emergency shell and what causes it?
▸ ANSWER

Dracut is the initramfs (initial RAM filesystem) framework in RHEL. During boot, dracut sets up the early boot environment before mounting root filesystem. If dracut can't complete (missing modules, bad fstab entry, disk issue, wrong kernel specified), it drops to a minimal shell prompt for debugging. Common causes: (1) Wrong default kernel in grubenv. (2) Missing or corrupted initramfs. (3) /etc/fstab entry for a non-existent device. (4) LVM volume group not activating. Fix: set correct kernel with grub2-set-default, or regenerate initramfs with dracut -f.

03

VCS (Veritas Cluster Server) — Cluster Management

# VCS command directory cd /opt/VRTS/bin/ # Check cluster status summary ./hastatus -sum ./hastatus -summ | grep PROD-TCON-TW # Display resource state in a group ./hares -display -attribute State -group IPMP-1G -sys crdap-prd1902 # Take group offline / online ./hagrp -offline IPMP-1G -sys crdap-prd1902 ./hagrp -online IPMP-1G -sys crdap-prd1903 # Switch group to another node ./hagrp -switch IPMP -to crdap-prd1903 hagrp -switch DWH_SG -to mwegc-dwhla01u # Freeze / unfreeze a service group hagrp -freeze DWH_SG -sys mwegc-dwhla01u hagrp -unfreeze DWH_SG -sys mwegc-dwhla01u # Clear faulted resource hares -clear twsela_script -sys sdcgcgndmlb08p # Check all resources in a group for i in `hagrp -resources PROD-TCON-TW`; do hares -state $i done | grep -i servername
QWhat is Veritas Cluster Server and what is a Service Group?
▸ ANSWER

VCS (now InfoScale Availability) is a high-availability clustering solution. It monitors resources and automatically fails them over to another node when a fault is detected. A Service Group (SG) is a logical collection of resources (IP, disk, application processes, mount points) that represent a service. They all fail over together as a unit. Key concepts: Resources have dependencies (disk must be mounted before app starts). hastatus -sum shows health at a glance. hagrp -switch is used for planned maintenance to move services off a node gracefully.

QWhat does freezing a VCS service group do?
▸ ANSWER

Freezing a service group (hagrp -freeze) prevents VCS from automatically switching the group to another node even if faults are detected. This is used during planned maintenance — you don't want VCS to failover while you're intentionally stopping services. After maintenance, hagrp -unfreeze re-enables automatic failover. If you forget to unfreeze, manual intervention is required for any subsequent failover. Persistent freezing (-persistent flag) survives VCS restarts.

04

Tanium Client Troubleshooting

# Stop Tanium client service TaniumClient stop # Clear monitor database (fixes memory/disk issues) > /opt/TaniumClient/Tools/Trace/monitor.db # Restart service TaniumClient start # Check tmp directory size cd /opt/Tanium/TaniumClient/tmp ls | wc -l du -sh df -kh # Compress old files in Tanium tmp dir find /opt/Tanium/TaniumClient/tmp -mtime +30 -type f \ | egrep -v "gz$|bz2$" \ | xargs ls -lrt | awk '{print $9}' \ | while read A; do gzip $A; done
QWhat is Tanium and why do enterprise sysadmins manage it?
▸ ANSWER

Tanium is an enterprise endpoint management and security platform that provides real-time visibility and control across all endpoints in an organization. From a sysadmin perspective: the Tanium Client runs on each server and communicates with the Tanium server. Common issues: (1) monitor.db grows too large and causes client to stop working — fix: clear it while service is stopped. (2) /tmp directory fills with trace files — fix: compress old files with find+gzip. (3) Client stops sending data — fix: restart service. It's similar to managing other management agents like IBM ITM or Splunk.

🐢

Linux Server Running Slow? — Pro Level Diagnostic Guide

Diagnose like a pro. Fix the right problem. 10-step systematic approach — Measure · Isolate · Verify · Fix · Prevent

📊 MeasureDon't guess
🔍 IsolateFind the bottleneck
VerifyProve the root cause
🔧 FixResolve & optimise
🛡️ PreventMonitor & automate
Always start with the big picture: $ uptime — check load average (e.g. 10:42:01 up 45 days, 2:15, 2 users, load average: 28.76, 27.91, 25.32). High load > CPU count = overloaded system.
STEP POSSIBLE BOTTLENECK COMMANDS — Run & Analyse WHAT IT TELLS YOU WHAT TO LOOK FOR — Red Flags
01
🖥️ CPU Saturation
Too much CPU being used
Commands
$ mpstat -P ALL 1 5 $ top -b -n1 | head -20 $ pidstat -u 1 $ sar -u 1 5
What it tells you

Shows CPU usage per core, user/system time, context switches, interrupts and per-process CPU usage.

Red Flags
  • High %usr → Application using CPU
  • High %sys → Kernel overhead
  • High %iowait → Wait on I/O (not CPU)
  • High %steal → VM contention
02
🧠 Memory Pressure
Not enough RAM or swapping
Commands
$ vmstat 1 5 $ cat /proc/meminfo $ free -m $ pidstat -r 1
What it tells you

Reveals memory usage, swap activity, page faults, and memory pressure indicators.

Red Flags
  • si/so > 0 → Swap in/out (bad)
  • High pgmajfault/s → Memory pressure
  • Low available memory
  • OOM kills in dmesg
03
💾 Disk I/O Bottleneck
Storage is the real problem
Commands
$ iostat -x 1 5 $ iotop -oPa $ pidstat -d 1 5 $ dstat -d --top-io
What it tells you

Shows disk utilisation, I/O wait, queue depth, read/write latency and which processes are causing it.

Red Flags
  • %util → 100% → Disk saturated
  • await > 20ms → High latency
  • avgqu-sz > 1 → I/O queue buildup
  • Reads/Writes high → Heavy I/O
04
🌐 Network Latency / Throughput
Network issues or congestion
Commands
$ ss -s $ nload $ sar -n DEV 1 5 $ mtr -rwzbc 100 <host>
What it tells you

Analyzes network connections, throughput, packet loss, latency and interface stats.

Red Flags
  • High retransmits / packet loss
  • Many TIME_WAIT connections
  • High latency or jitter
  • Interface errors / dropped packets
05
🔌 TCP Connection Issues
Too many or stuck connections
Commands
$ ss -s $ ss -tan state time-wait | wc -l $ ss -tanp | awk '{print $2}' | sort | uniq -c | sort -nr | head
What it tells you

Shows TCP states, connection counts and potential exhaustion or leaks.

Red Flags
  • TIME_WAIT in hundreds of thousands
  • Many CLOSE_WAIT connections
  • Many connections to same IP:PORT
  • Ephemeral port exhaustion
06
🌍 DNS Resolution
DNS slowness kills apps
Commands
$ dig +stats example.com $ dig @8.8.8.8 example.com $ systemd-resolve --statistics $ cat /etc/resolv.conf
What it tells you

Checks DNS resolution time, failure rate, cache hits/misses and resolver performance.

Red Flags
  • High Query time (>50ms)
  • SERVFAIL / NXDOMAIN errors
  • High cache miss rate
  • Using slow or unreachable DNS
07
⚠️ System / Kernel Errors & Warnings
Kernel or system component issues
Commands
$ dmesg -T | tail -n 50 $ journalctl -k -xe $ journalctl -p err -b $ lsblk -o NAME,STATE,MODEL
What it tells you

Finds kernel errors, hardware issues, driver problems, device resets, OOM kills and other critical events.

Red Flags
  • I/O errors, device resets
  • Out of memory: Kill process
  • EXT4 / XFS errors
  • Hardware / driver failures
08
🔎 Process Analysis
Find the real resource hogs
Commands
$ ps aux --sort=-%cpu | head -20 $ ps aux --sort=-%mem | head -20 $ pmap -x <pid> | less $ lsof -p <pid> | wc -l
What it tells you

Identifies top CPU/RAM consumers, memory maps, open files, threads and resource leaks.

Red Flags
  • Single process using too much CPU
  • High memory RSS
  • Too many open files
  • Thread explosion
09
📂 Filesystem & Inodes
Disk full or inode exhaustion
Commands
$ df -hT $ df -i $ du -xh --max-depth=1 / | sort -h $ ncdu /
What it tells you

Checks disk usage, inode usage, filesystem health and largest directories.

Red Flags
  • Use% = 100%
  • Inodes IUse% = 100%
  • Large log files / growing dirs
  • Read-only filesystem
10
</> Application & Dependencies
App, DB or external service slowness
Commands
$ systemctl status <service> $ curl -w '%{time_total}\n' <url> $ mysqladmin processlist $ redis-cli info stats
What it tells you

Validates application health, external dependencies, DB performance and response times.

Red Flags
  • Service flapping / restarting
  • Slow API / external calls
  • DB locks / too many connections
  • High response time
FLOW

Pro Troubleshooting Flow

🔁
Reproduce Confirm the slowdown
🔢
Check Big 4 CPU, Memory, Disk, Network
🔍
Drill Down Find the offending process / cause
Validate Confirm with metrics & logs
🛠️
Fix & Prevent Resolve, Monitor, Automate
TIPS

⏱️ Time Saving Tips

  • ✔ Use sar for historical analysis
  • ✔ Use dstat for a quick overview
  • ✔ Collect data before and after the issue
  • ✔ Automate log collection on incidents
  • ✔ Build dashboards. Don't rely on memory
RULES

⭐ Golden Rules

  • ⭐ Measure first, then act
  • ⭐ Don't optimise the wrong thing
  • ⭐ Logs don't lie. Users sometimes do
  • ⭐ Document the root cause
  • ⭐ Automate to prevent recurrence
TOOLS

🧰 Boden Tools

  • nmon — system monitor
  • perf — kernel profiling
  • bpftrace — eBPF tracing
  • bcc-tools — BPF Compiler Collection
  • prometheus + grafana — metrics & dashboards
💡 Pro Tip:  "A slow server is a symptom. A systematic approach finds the cure."  ·  Stay curious. Keep learning. Keep automating.
⚙️

kernel-devel — Linux Kernel Development Package

Header files and build files for the Linux kernel — required for compiling kernel modules, drivers, and enterprise software prerequisites

01

What is kernel-devel?

kernel-devel is a Linux package that contains the header files and build files for the Linux kernel. It is primarily used when software needs to compile kernel-dependent modules or drivers against the currently running kernel.

What's inside kernel-devel
  • Kernel header files (*.h)
  • Makefiles required for building kernel modules
  • Kernel configuration files
  • Symbol definitions and interfaces exposed by the kernel
Example location
/usr/src/kernels/$(uname -r)/
02

Why Db2 Checks for kernel-devel

During installation, Db2's prerequisite checker verifies that the system has the development files needed for certain low-level integrations and kernel-related operations. Even though Db2 itself is not a kernel module, IBM includes this check to ensure the system has a complete build environment and compatible kernel interfaces.

Key point: The installed kernel-devel version must match the output of uname -r exactly. A version mismatch will cause the prerequisite check to fail.
03

Common Use Cases for kernel-devel

🔌 Third-party Drivers
  • Network drivers
  • Storage drivers
  • GPU drivers
🧩 Building Kernel Modules
  • VMware Tools
  • VirtualBox Guest Additions
  • Security / monitoring agents
🏢 Enterprise Software
  • IBM Db2
  • Oracle products
  • Backup and monitoring solutions
04

Difference Between Kernel-Related Packages

Package Purpose
kernelThe running Linux kernel itself
kernel-develFiles needed to build kernel modules (must match running kernel version)
kernel-headersUserspace header files for compiling applications
gccC compiler — required to actually build modules
makeBuild utility — drives the compilation process
05

Commands — Check & Verify on Your Server

Check if kernel-devel is installed
rpm -q kernel-devel
Check the running kernel version
uname -r
Check if the matching version exists
rpm -qa | grep kernel-devel
⚠️ Version match is critical for Db2:
The kernel-devel version must exactly match uname -r output.

Example:
# Check running kernel uname -r 3.10.0-1160.el7.x86_64 # You must have this exact package installed: kernel-devel-3.10.0-1160.el7.x86_64 # Install matching version if missing: yum install kernel-devel-$(uname -r) # Verify after install: rpm -q kernel-devel-$(uname -r)
🛰️

Red Hat Satellite 6/7 — Lifecycle Environments & Patching

Architecture, content views, activation keys, patching workflows, Hammer CLI, troubleshooting — deep L3 operational reference

3.1 — Satellite Architecture
Q1

Explain the Red Hat Satellite architecture — all major components and how they interact.

▸ ANSWER
  • Foreman: the core of Satellite — handles host provisioning, lifecycle management, and the web UI. Provides the host model, host groups, lifecycle environments, and content views.
  • Katello: the content management layer. Handles syncing from Red Hat CDN, creating content views, managing lifecycle environments, applying errata, and activation keys. Built on Pulp for content storage.
  • Pulp 3: the content repository management backend. Stores synced RPM packages, errata, kickstart trees, and file content.
  • Candlepin: the subscription management component. Tracks Red Hat subscriptions, registers hosts, and manages entitlements.
  • Capsule Server (Smart Proxy): optional distributed component. Syncs content from Satellite and serves it locally to registered clients. Reduces WAN bandwidth. Runs Pulp, DHCP, DNS, TFTP for local provisioning.
  • Satellite DB: PostgreSQL database storing all Satellite metadata — host records, content view versions, lifecycle environments, activation keys, tasks.
  • Client tools: subscription-manager (registers host, manages repos), remote execution (REX) via SSH for job dispatch.
Data flow: Red Hat CDN → Satellite (sync) → Capsule (sync from Satellite) → Registered RHEL Hosts (yum/dnf updates)
Q2

What is the difference between a Satellite Organization and a Location? Why does it matter for patching?

▸ ANSWER
Organization
Logical grouping of resources by business unit or department. Each org has its own: content views, lifecycle environments, activation keys, subscriptions, repositories, and hosts. A host belongs to exactly one org. In multi-tenant environments (MSPs), each customer is typically a separate org.

Key rule: Content views and lifecycle environments are org-scoped. You cannot share a content view across organizations — each org is self-contained from a content perspective.
Location
Physical or logical grouping representing a datacenter, region, or site. Used to route provisioning (which capsule serves this location's DHCP/DNS/TFTP). A host belongs to a location.

Patching relevance: Selecting the wrong org means you do not see the right hosts or content. Trying to promote a content view version from Org-A into Org-B is not possible.
3.2 — Lifecycle Environments
Q3

Explain the Lifecycle Environment concept in Satellite. How do you design a typical lifecycle path for enterprise patching?

▸ ANSWERA Lifecycle Environment (LCE) represents a stage in the software promotion pipeline — analogous to SDLC stages. Environments are chained:

LibraryDEVSITUATPREPRODPROD
  • Library — the source environment. Contains all synced content from CDN. Content views are built from Library. Never directly register hosts to Library.
  • Hosts are pinned to an environment — a production host registered to PROD only sees packages that have been explicitly promoted to PROD. It will NOT see a new package until the content view version is promoted to PROD.
  • Time-delayed promotion: enforce that a CV version must sit in UAT for 7 days before promoting to PROD — gives time for testing. This is manual governance.
# Create lifecycle environment via Hammer CLI hammer lifecycle-environment create --name 'PROD' --prior 'PREPROD' --organization 'MyOrg' # Via Satellite API POST /api/v2/environments {path, organization_id}
Q4

What is a Content View in Satellite? Explain its components and the publish/promote workflow.

▸ ANSWERA Content View (CV) is a filtered, version-controlled snapshot of repository content. It controls exactly which packages, errata, and files are available to hosts in each lifecycle environment.

Components:
  • Repositories — which yum repos, file repos, and docker repos are included.
  • Filters — include/exclude specific packages or errata by name, version, date, or type.
  • Published versions — each publish creates an immutable version with a snapshot of content at that point in time.
  • Composite Content View (CCV) — a CV made of other CVs. Used to combine OS content (RHEL BaseOS + AppStream) with middleware content into one deployable unit.
# Publish a new content view version hammer content-view publish --name 'RHEL8-Base' --organization 'MyOrg' # Promote to PROD hammer content-view version promote \ --content-view 'RHEL8-Base' \ --version '1.12' \ --to-lifecycle-environment 'PROD' \ --organization 'MyOrg'
Publishing does NOT affect hosts — it only creates the version in Library. Promote the version through environments after validation.
Q5

What is an Activation Key and how does it control what a host gets when it registers to Satellite?

▸ ANSWERAn Activation Key (AK) is a pre-configured registration token that automatically applies settings to a host upon registration.

What AK configures on registration:
  • Organization — which org the host joins.
  • Lifecycle Environment — which LCE the host is pinned to (e.g., PROD).
  • Content View — which CV the host uses.
  • Subscriptions — which Red Hat subscriptions are attached.
  • Host Collections — which groups the host is added to (used for bulk job targeting).
  • Enabled repositories — which repos are enabled by default.
# One-command registration — applies all AK settings subscription-manager register --org='MyOrg' --activationkey='PROD-RHEL8-AK' # Multiple stacked AKs subscription-manager register --org='MyOrg' --activationkey='base-ak,security-ak,app-ak' # Create AK via Hammer hammer activation-key create \ --name 'PROD-RHEL8-AK' \ --lifecycle-environment 'PROD' \ --content-view 'RHEL8-Base' \ --organization 'MyOrg'
Best practice: one AK per lifecycle environment per OS version — DEV-RHEL8-AK, UAT-RHEL8-AK, PROD-RHEL8-AK. This ensures hosts are pinned correctly.
3.3 — Patching Workflows in Detail
Q6

Walk me through the complete end-to-end patching workflow in Red Hat Satellite — from CDN sync to applying patches to production servers.

▸ ANSWERFull enterprise patching workflow — the core L3 operational procedure:
  1. CDN Sync: Satellite syncs latest packages and errata from Red Hat CDN.
    hammer repository synchronize --name 'RHEL8-BaseOS' --product 'RHEL8' --organization 'MyOrg'
    Confirm sync completes without errors in Content > Sync Status.
  2. Review new errata: Content > Errata — filter by "New" or by CVE. Identify applicable security/bugfix errata for the upcoming patch cycle.
  3. Update Content View: if CV has date-based filters, update the filter date to include new errata. Publish a new CV version with version notes (e.g., "March 2025 Patch Set").
  4. Promote to DEV: promote new CV version to DEV. Hosts in DEV now see new packages. Run yum clean all on DEV hosts to refresh metadata cache.
  5. Test in DEV: Hosts > All Hosts > filter LCE=DEV > Schedule Remote Job > "Apply Errata". Verify application health post-patch.
  6. Promote to UAT then PROD: after successful DEV validation (48–72hr), promote same CV version to UAT. After UAT sign-off, promote to PROD.
  7. Apply patches to PROD: Hosts > select PROD hosts > Schedule Remote Job > Apply Errata. Schedule during change window. Use yum update --security -y for security-only updates.
  8. Verify: Hosts > host detail > Errata tab — should show 0 applicable errata. Generate compliance report.
Q7

What is the difference between "Apply Errata" and "yum update" in the Satellite context? When do you use each?

▸ ANSWER
MethodWhat It DoesWhen to Use
Apply Errata (Satellite REX)Targets specific errata IDs (e.g., RHSA-2024:1234). Satellite installs only the affected packages. Gives precise, auditable control.PROD — when you know exactly what is being changed. CVE-mandated patches.
yum update -yUpdates ALL installed packages to latest available in subscribed repositories. Less controlled — may update packages not covered by specific errata.DEV environments or when you want full currency.
yum update --securityUpdates only packages for which security errata exist.Middle ground between errata-specific and full update.
REX — Package UpdateRuns yum update <package-list> for specific packages.When you need to update one specific package without touching others.
Errata visibility: Hosts > host > Errata tab shows exactly which errata are applicable, installable, and whether they are security/bugfix/enhancement. This data comes from Satellite cross-referencing installed packages against CDN errata metadata.
Q8

How do you use Host Collections in Satellite for bulk patching? What is the workflow?

▸ ANSWERHost Collections are static or dynamic groups of hosts used for bulk operations — the primary way to apply patches to sets of servers efficiently.
  • Creating Host Collections: Hosts > Host Collections > Create. Add hosts manually or via search filter (dynamic). Example collections: RHEL8-PROD-AppServers, RHEL8-PROD-DBServers.
  • Bulk patching: Hosts > Host Collections > select collection > Run Job > Apply Errata > select errata by type or ID > Schedule.
  • Remote Execution (REX): Satellite uses SSH-based REX to push commands. Hosts must have the satellite-capsule's public key in /root/.ssh/authorized_keys.
  • Concurrency control — critical for production: set "Concurrency Level" in job settings. Never patch all production hosts simultaneously. Use time-delayed scheduling or staggered execution.
  • Monitor job: Monitor > Jobs — shows real-time status per host, stdout/stderr output, success/failure count.
  • Post-job: run a compliance report — Hosts > All Hosts > filter collection > check Errata count column — should be 0.
# Add hosts to collection hammer host-collection add-host --name 'PROD-AppServers' --hosts 'server01,server02' --organization 'MyOrg' # List job invocations hammer job-invocation list hammer job-invocation output --id <job-id>
Q9

How do you handle a Satellite-registered host that stops receiving yum metadata updates (host shows old package list in Satellite)?

▸ ANSWERRoot cause candidates: katello-agent not running (deprecated in Satellite 6.7+), subscription-manager facts are stale, REX connection failing, host was re-installed without re-registering, certificate expired.
# Step 1: Refresh entitlement certificates from Satellite subscription-manager refresh # Step 2: Force refresh package metadata yum clean all && yum makecache # Step 3: Check Satellite connection curl -k https://<satellite-fqdn>/katello/api/v2/ping # Step 4: Check subscription status subscription-manager status # Step 5: Trigger fact upload via REX job subscription-manager facts --update # Step 6: If certificate expired — clean and re-register subscription-manager clean subscription-manager register --org='MyOrg' --activationkey='PROD-AK'
Check Satellite logs: /var/log/foreman/production.log and /var/log/foreman-proxy/proxy.log for errors related to the host.
3.4 — Hammer CLI Reference
Q10

What is Hammer CLI and what are the most important commands an L3 admin must know?

▸ ANSWERHammer is Satellite's command-line interface — essential for scripting, automation, and bulk operations.
# ── Organization & Lifecycle Environments ── hammer organization list hammer lifecycle-environment list --organization 'MyOrg' hammer lifecycle-environment create --name 'PROD' --prior 'PREPROD' --organization 'MyOrg' # ── Content Views ── hammer content-view list --organization 'MyOrg' hammer content-view publish --name 'RHEL8-Base' --organization 'MyOrg' hammer content-view version list --content-view 'RHEL8-Base' --organization 'MyOrg' hammer content-view version promote --content-view 'RHEL8-Base' \ --version '1.12' --to-lifecycle-environment 'PROD' --organization 'MyOrg' # ── Hosts & Errata ── hammer host list --organization 'MyOrg' --lifecycle-environment 'PROD' hammer host errata list --host 'server01.example.com' hammer host errata apply --host 'server01.example.com' --errata-ids RHSA-2024:1234 # ── Sync & Products ── hammer repository synchronize --name 'RHEL8-BaseOS' --product 'RHEL8' --organization 'MyOrg' # ── Activation Keys ── hammer activation-key list --organization 'MyOrg' hammer activation-key create --name 'PROD-AK' --lifecycle-environment 'PROD' \ --content-view 'RHEL8-Base' --organization 'MyOrg' # ── Host Collections ── hammer host-collection list --organization 'MyOrg' hammer host-collection add-host --name 'PROD-AppServers' --hosts 'server01,server02' --organization 'MyOrg' # ── Satellite Maintenance ── satellite-maintain service status satellite-maintain service restart --only=pulpcore-worker@* foreman-rake katello:delete_orphaned_content
Q11

How does Satellite handle subscription management? What is the difference between Simple Content Access (SCA) and the traditional subscription-attach model?

▸ ANSWER
AspectTraditional ModelSimple Content Access (SCA)
Host accessEach host must explicitly attach one or more Red Hat subscriptionsAll hosts in the org can access all entitled content — no per-host attachment
Satellite enforcementTracks consumed vs entitled counts. Hosts exceeding count show as "Insufficient"Tracks usage for reporting but does not enforce per-host count limits
Registration commandregister + separate attach --auto stepregister only — access via AK is immediate
EnableN/A (default)Satellite UI > Subscriptions > Manage Manifest > Simple Content Access toggle. Or via Red Hat Customer Portal.
Common issue: manifest not refreshed after purchasing new subscription — hosts cannot access new product repos until manifest is re-imported.
hammer subscription refresh-manifest --organization 'MyOrg'
Q12

What is a Capsule Server in Satellite and when is it required? How do you configure host registration to a Capsule?

▸ ANSWERSatellite Capsule is a distributed Satellite component that reduces WAN bandwidth by caching synced content locally. It also provides local DHCP, DNS, TFTP for provisioning remote sites.
  • Required when: hosts are in remote sites with limited WAN to central Satellite, or when Satellite is in one datacenter and hosts are in another region.
  • Capsule syncs from Satellite: Satellite > Infrastructure > Capsules > select capsule > Synchronize. Choose: optimize (incremental) or complete (full sync).
  • Host registration to Capsule:
subscription-manager register \ --org='MyOrg' \ --activationkey='PROD-AK' \ --serverurl=https://<capsule-fqdn>:8443/rhsm \ --baseurl=https://<capsule-fqdn>/pulp/repos # Capsule health check (run on capsule) satellite-maintain service status # Capsule troubleshoot logs /var/log/foreman-proxy/proxy.log
3.5 — Satellite Patching Scenarios
🔴 Scenario: Satellite: Content View Promotion Fails to PROD

You attempt to promote a content view version from PREPROD to PROD as part of the monthly patch cycle. The promotion task fails after 45 minutes with: "Pulp task timed out. Publish failed." 180 PROD servers are waiting for this patch. Change window closes at 2:00 AM.

Interviewer Probe Questions
  • What is your immediate diagnosis process?
  • Where do you check Satellite and Pulp logs for the root cause?
  • What Satellite maintenance commands do you use to resolve Pulp task failures?
  • If promotion cannot be completed, what is your fallback patching strategy?
  • How do you communicate status to stakeholders during the incident?
Strong Candidate Demonstrates
  • Immediate: check Monitor > Tasks in Satellite UI — find the failed task, read the full error message. Note the Pulp task UUID.
  • Log locations: /var/log/foreman/production.log (Satellite app), /var/log/foreman-proxy/proxy.log (capsule), journalctl -u pulpcore-worker@* (Pulp 3 workers)
  • Common Pulp failure causes: Pulp workers crashed/hung, disk space exhausted on /var/lib/pulp, database connection timeout.
  • df -h /var/lib/pulp — if full: clean orphan artifacts: satellite-maintain content clean-orphans
  • Restart Pulp workers: satellite-maintain service restart --only=pulpcore-worker@* — clears stuck tasks.
  • Fallback if window closing: patch hosts using already-promoted content in PREPROD (temporary LCE change for PROD hosts, or apply errata directly via Satellite REX).
  • Stakeholder comms: update change record every 30 minutes. If window will be missed, escalate to change manager for window extension or deferral to emergency change.
⚠️ Red Flags — Weak Answers
  • Attempting to force-promote without investigating — may corrupt the content view version
  • Not checking disk space first — most common cause of Pulp failures
🔴 Scenario: Satellite: 50 Hosts Show "Applicable Errata" After Patching

After completing a patch cycle, your compliance report shows 50 PROD hosts still have applicable security errata — even though the patch job showed 100% success. The change window is now closed. The security team is asking for an explanation.

Interviewer Probe Questions
  • Why would a patch job succeed but hosts still show applicable errata?
  • How do you verify what actually happened on those 50 hosts?
  • What Satellite and host-side checks do you run?
  • How do you determine if these are genuinely missing patches or a Satellite data issue?
  • What is the remediation plan within existing change control?
Strong Candidate Demonstrates
  • Root causes: (1) Packages updated but host fact upload not triggered — Satellite shows old installed package list. (2) Package conflicts caused some packages to be held back. (3) New errata released after the patch job ran. (4) Some hosts failed patching silently due to repo issues.
  • Verify on sample host: rpm -q <package-from-errata> — compare installed version vs errata-required version. If package IS updated, the issue is stale Satellite data.
  • Trigger fact refresh via Satellite REX: Run Job > "Upload package profile" on affected hosts. Or: subscription-manager facts --update on hosts.
  • Check yum history: yum history listyum history info <transaction-id> — shows exactly what was installed.
  • Check for held-back packages: yum check-update. Check versionlock: yum versionlock list.
  • If genuine missing patches: raise emergency change and apply missing errata via REX job targeting only the 50 affected hosts.
  • Security team response: provide yum history output as proof. If Satellite shows stale data, provide direct RPM query output from hosts as evidence.
⚠️ Red Flags — Weak Answers
  • Claiming the job succeeded without verifying on the actual hosts
  • Applying patches outside change control without an emergency change
🔴 Scenario: Satellite: Host Cannot Register — SSL Certificate Error

A new RHEL 8 server build fails to register to Satellite during automated provisioning. The error: "SSL: CERTIFICATE_VERIFY_FAILED. Unable to verify the first certificate." All other servers in the same environment register successfully.

Interviewer Probe Questions
  • What are the possible causes of this SSL error during Satellite registration?
  • What is the correct CA certificate installation procedure for Satellite clients?
  • How do you diagnose and fix the certificate trust issue on the new host?
  • What causes one host to fail while others succeed?
  • How do you verify the fix and complete registration?
Strong Candidate Demonstrates
  • Root causes: (1) Satellite CA certificate not installed. (2) Wrong CA certificate version — Satellite CA may have been regenerated. (3) Host was built from a golden image that predates the current Satellite CA. (4) System clock skew — SSL certificate validity depends on correct time (chrony/NTP).
  • Install correct CA: curl -k https://<satellite-fqdn>/pub/katello-ca-consumer-latest.noarch.rpm -o /tmp/katello-ca.rpm && rpm -ivh /tmp/katello-ca.rpm
  • Verify CA: ls /etc/rhsm/ca/ — should show katello-server-ca.pem. Check time sync: timedatectl statuschronyc tracking.
  • If built from stale image: remove old CA: rpm -e katello-ca-consumer → re-install fresh CA from Satellite URL.
  • Verify fix: curl https://<satellite-fqdn>/katello/api/v2/ping — should return 200 without -k flag. Then register: subscription-manager register --org='MyOrg' --activationkey='PROD-AK'
  • For provisioning automation: ensure kickstart/build template always pulls fresh katello-ca RPM from current Satellite URL. Do NOT bake CA into golden image — it becomes stale after CA rotation.
🔴 Scenario: Satellite: CDN Sync Failing — Repositories Stuck at Partial Completion

The scheduled weekly CDN sync has failed for 3 days. Satellite shows "Sync Incomplete" for 4 repositories. RHEL 8 BaseOS and AppStream repositories are stuck at 62% and 78% respectively. A patch cycle is due in 2 days.

Interviewer Probe Questions
  • What are the common causes of CDN sync failures in Satellite?
  • What logs and commands do you use to diagnose the failure?
  • How do you force a clean re-sync of a specific repository?
  • What can you do to proceed with the patch cycle if sync cannot be completed in time?
  • How do you prevent recurring sync failures?
Strong Candidate Demonstrates
  • Common causes: network connectivity to CDN (cdn.redhat.com), expired/invalid manifest, Pulp storage full, proxy configuration issues, corrupted repository metadata, Pulp worker issues.
  • Check network: curl -v https://cdn.redhat.com. Check proxy: cat /etc/rhsm/rhsm.conf | grep proxy.
  • Check Pulp workers: systemctl status pulpcore-worker@* | grep -i fail. Check disk: df -h /var/lib/pulp. Clean orphans: foreman-rake katello:delete_orphaned_content
  • Force re-sync: Satellite UI > Content > Products > RHEL8 > RHEL8-BaseOS > Sync Now. Or: hammer repository synchronize --name 'RHEL8-BaseOS' --product 'RHEL8' --organization 'MyOrg' --async
  • Fallback for patch cycle: work with existing promoted content view version. Apply available security patches from the last successful sync. Document coverage gap for security team.
  • Prevention: schedule syncs 4–5 days before patch cycle (not 2 days). Monitor sync completion via alert. Set up Satellite monitoring on task success rate.
⚠️ Red Flags — Weak Answers
  • Deleting and re-adding a repository without understanding impact on published CVs — CVs referencing that repo may be affected
REF

Satellite / Hammer CLI Quick Reference Cheat Sheet

TaskHammer / satellite-maintain Command
List orgshammer organization list
List lifecycle environmentshammer lifecycle-environment list --organization 'Org'
List content viewshammer content-view list --organization 'Org'
Publish content viewhammer content-view publish --name 'CV' --organization 'Org'
Promote CV to LCEhammer content-view version promote --content-view 'CV' --to-lifecycle-environment 'PROD' --organization 'Org'
List host erratahammer host errata list --host 'hostname'
Apply errata to hosthammer host errata apply --host 'hostname' --errata-ids RHSA-2024:1234
Sync a repositoryhammer repository synchronize --name 'repo' --product 'RHEL8' --organization 'Org'
Register hostsubscription-manager register --org='Org' --activationkey='AK'
Refresh host factssubscription-manager facts --update
Refresh entitlementssubscription-manager refresh
Check Satellite servicessatellite-maintain service status
Restart Pulp workerssatellite-maintain service restart --only=pulpcore-worker@*
Clean orphan contentforeman-rake katello:delete_orphaned_content
Check host compliancehammer host list --organization 'Org' | grep -v 'fully updated'
Refresh manifesthammer subscription refresh-manifest --organization 'MyOrg'