Complete Linux Administration Interview Preparation: 200+ Commands, Troubleshooting, LVM, NFS, SSH & Boot Issues - Textnotes

Complete Linux Administration Interview Preparation: 200+ Commands, Troubleshooting, LVM, NFS, SSH & Boot Issues


A complete Linux Admin interview preparation guide with 200+ real commands, troubleshooting scenarios, LVM/NFS/SSH/boot issue solutions, and real-world patching workflows.

1) 200+ Admin Commands (Most Asked in Interviews)

System Information


uname -a
hostnamectl
lsb_release -a
dmidecode -t system

User & Group Management


useradd devuser
passwd devuser
groupadd admin
usermod -aG admin devuser
id devuser

File & Directory Management


ls -lrt
mkdir -p /data/app
cp -rvf source/ dest/
mv file1 file2
rm -rf /tmp/*

Permissions


chmod 755 script.sh
chown root:root /etc/ssh/sshd_config
setfacl -m u:dev:rwx /data

Network Commands


ip addr show
ip route show
nmcli connection show
ss -tulnp
nc -zv 10.0.0.5 22
ping -c 4 google.com
traceroute yahoo.com

Disk & LVM


fdisk -l
pvcreate /dev/sdb
vgcreate vgdata /dev/sdb
lvcreate -L 10G -n lvdata vgdata
mkfs.ext4 /dev/vgdata/lvdata
mount /dev/vgdata/lvdata /mnt

Package Management


yum install httpd -y
dnf update -y
rpm -qa | grep kernel
yum history list

Service Management


systemctl status sshd
systemctl restart network
systemctl enable httpd
systemctl stop firewalld

Logs


journalctl -xe
tail -f /var/log/messages
grep -i error /var/log/secure

2) Troubleshooting Scenarios (Most Asked in Interviews)

Scenario 1: Server is Slow

Checklist:


top
vmstat 1 5
iostat -xz 1 3
free -h
dmesg | tail

Probable Reasons:

  1. High CPU load
  2. Memory leak
  3. I/O wait
  4. Zombie processes

Scenario 2: Application Not Accessible

Check service


systemctl status httpd

Check port


ss -tulnp | grep 80

Check firewall


firewall-cmd --list-all

Check SELinux


getenforce
semanage port -l | grep http

Scenario 3: Disk Full


df -h
du -sh /* | sort -h
journalctl --vacuum-size=500M

Trim logs


truncate -s 0 /var/log/messages

Scenario 4: High CPU by a Process


top -c
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head
kill -9 <pid>

Scenario 5: SSH Not Working

Check port config


grep Port /etc/ssh/sshd_config

Check firewall


firewall-cmd --list-ports

Restart


systemctl restart sshd

Check key auth


chmod 600 ~/.ssh/authorized_keys

3) LVM, NFS, SSH, Boot Issue Troubleshooting

LVM Troubleshooting

Not Enough Space in VG


vgs
vgextend vgdata /dev/sdc

LV Not Mounting


lvscan
fsck /dev/vgdata/lvdata
mount -a

Extend File System


lvextend -L +5G /dev/vgdata/lvdata
resize2fs /dev/vgdata/lvdata

NFS Troubleshooting

Check NFS Mount


mount -t nfs server:/data /mnt
showmount -e server

Check Firewall


firewall-cmd --add-service=nfs --permanent

Check SELinux


setsebool -P nfs_export_all_rw 1

Permission Issues


chown -R nfsuser:nfsuser /data
chmod 755 /data

SSH Troubleshooting

Permission Denied (publickey)

Check file permissions:


chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub

Host key mismatch


ssh-keygen -R server-ip

Boot Issues & GRUB Troubleshooting

Scenario: Kernel Panic

Run fsck:


fsck -y /dev/sda2

Scenario: Wrong fstab Entry

Boot into rescue mode → edit with:


nano /etc/fstab

GRUB Not Loading

Reinstall GRUB:


grub2-install /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfg

Boot into Single-User Mode

At GRUB menu:

Press e → add rd.break

Change root password:


mount -o remount,rw /sysroot
chroot /sysroot
passwd root
touch /.autorelabel

4) Real Patching & Maintenance Workflows

1) Pre-Patching Tasks


uptime
df -h
free -h
systemctl list-units --failed
cp -r /etc /backup/etc_prepatch/

Check running users:


who

2) Kernel Update


yum update kernel -y
grubby --default-kernel

3) Reboot Planning

  1. Communicate with team
  2. Create change ticket
  3. Get downtime approval
  4. Check services before reboot

4) Post-Patching Checks


uname -r
systemctl status <services>
df -h
journalctl -xe

Check application status:


curl -I http://localhost

5) Rollback Plan

  1. Boot from old kernel
  2. Disable problematic services
  3. Restore config backups