Linux System Administrator Q&A
How do you get the kernel version / Command to list OS version in Linux?
To check the kernel version:
uname -r
To list the OS version:
cat /etc/os-release
orlsb_release -a
(if available).
How do you identify if you are working on a physical server or VM?
Run
virt-what
(if installed) to detect virtualization.Alternatively, check
dmesg | grep -i hypervisor
orlscpu
for signs of a hypervisor (e.g., VMware, KVM).You can also use
dmidecode -s system-manufacturer
ordmidecode -t system
to see hardware details—physical servers often show real vendor names (e.g., Dell, HP), while VMs show virtualized names (e.g., VMware, QEMU).
How do you set kernel parameters / Where can I find the file with active parameters?
Active kernel parameters are stored in
/proc/sys/
. You can view them withsysctl -a
.To set a parameter temporarily:
sysctl <parameter>=<value>
(e.g.,sysctl net.ipv4.ip_forward=1
).
How do you set kernel parameters permanently?
Edit
/etc/sysctl.conf
or a file in/etc/sysctl.d/
and add the parameter (e.g.,net.ipv4.ip_forward=1
).Apply changes with
sysctl -p
(reloads settings from/etc/sysctl.conf
) orsysctl -w <parameter>=<value>
for a temporary change.
How to load modules in Linux / Command to list loaded modules?
Load a module:
modprobe <module_name>
(e.g.,modprobe nfs
).List loaded modules:
lsmod
.
How do you check if a filesystem is read-only?
Run
mount | grep <mount_point>
and look forro
(read-only) orrw
(read-write).Alternatively, use
cat /proc/mounts
to check the mount options.
How do you force a filesystem check during boot or repair it?
Force a check on next reboot:
touch /forcefsck
orshutdown -r -F now
.To repair manually: Boot into single-user mode, then run
fsck /dev/<partition>
(e.g.,fsck /dev/sda1
). Use-y
to auto-fix issues.
How do you check CPU power performance in a CFM server?
Assuming "CFM" is a typo or specific context, to check CPU performance generally: Use
lscpu
for specs,top
orhtop
for usage, orcat /proc/cpuinfo
for detailed info.For power/performance tuning, check
cpufreq-info
(ifcpufrequtils
is installed).
How to check and fix disk space issues in a volume?
Check space:
df -h
(human-readable sizes).Find large files:
du -h /path | sort -rh | head
.Fix: Delete unnecessary files, expand the volume (e.g.,
lvextend
for LVM), or resize the filesystem (e.g.,resize2fs
).
Commands to monitor server performance (CPU, memory, disk)?
top
orhtop
: Real-time CPU and memory usage.vmstat 1
: CPU, memory, and I/O stats every second.iostat
: Disk I/O performance (requiressysstat
package).
How to check processes and ports?
Processes:
ps aux
ortop
.Ports:
ss -tuln
(listening ports) ornetstat -tuln
(if installed).
How do you check/set max open files for a specific user?
Check current limit:
ulimit -n
(for the current session) orcat /proc/<pid>/limits
for a process.Set for a user: Edit
/etc/security/limits.conf
, add<username> soft nofile <value>
and<username> hard nofile <value>
, then relog.
How to limit the number of files open by a user?
- Edit
/etc/security/limits.conf
as above (e.g.,<username> hard nofile 1024
), then apply withsysctl -p
or relog the user.
- Edit
Server not reachable—how to troubleshoot?
Check if it’s up:
ping <server_ip>
.Try SSH:
ssh <user>@<server_ip>
—if it fails, check the console (e.g., via ILO/VMware).Verify network:
ip route
(default gateway),ip link
(interface status).
Server rebooted but not available after maintenance/OS upgrade?
Check console for boot messages (stuck at grub, kernel panic?).
Boot into single-user mode (edit grub with
systemd.unit=
rescue.target
) and review logs (journalctl
or/var/log/boot.log
).
Filesystem inconsistencies after reboot, goes read-only—how to fix?
Boot into single-user mode, run
fsck /dev/<partition>
to repair.Remount as read-write:
mount -o remount,rw /
.Check logs (
dmesg
orjournalctl
) for root cause.
User can’t create files/folders—what to check?
Permissions:
ls -ld <path>
(write access?).Inodes:
df -i
(inodes exhausted?).Quota:
quota <username>
(if quotas are enabled).
Passwordless auth enabled but still prompts for password—how to fix?
Check
~/.ssh/authorized_keys
permissions (600) and directory (700).Verify
/etc/ssh/sshd_config
:PubkeyAuthentication yes
,PasswordAuthentication no
.Restart SSH:
systemctl restart sshd
.
How to disable a service in Linux?
Disable at boot:
systemctl disable <service>
.Stop immediately:
systemctl stop <service>
.
Kernel messages?
- View with
dmesg
orjournalctl -k
.
- View with
Kernel panic—how to fix?
Boot into single-user mode (grub: add
single
orsystemd.unit=
rescue.target
).Recreate initrd:
mkinitrd
ordracut -f
(depends on distro), then reboot.
VM is hung, not reachable—how to troubleshoot?
Check console via hypervisor (e.g., VMware vSphere).
Restart VM if needed. Review logs (
journalctl
,dmesg
) after recovery.
How to upgrade the kernel version?
Install new kernel:
yum update kernel
(RHEL) orapt install linux-image-<version>
(Debian).Update grub:
grub2-mkconfig -o /boot/grub2/grub.cfg
(RHEL) orupdate-grub
(Debian), then reboot.
VMware VMs in read-only state due to storage issues—how to fix?
Check affected VMs:
esxcli vm process list
or vSphere UI.Verify storage:
df -h
on each VM, fix withfsck
if needed, then remount (mount -o remount,rw
).
Server in maintenance mode—how to perform filesystem check?
From console, run
fsck /dev/<partition>
(unmount first if possible).Exit maintenance:
reboot
orsystemctl default
.
Backup issue in HANA DB with I/O wait—how to check?
Check I/O:
iostat -x 1
(high%iowait
?).Review HANA logs and OS logs (
journalctl
).Verify disk space (
df -h
) and performance in Azure portal (if applicable).
SPC procedure for OS upgrade—how to find backup FS layout in TIC?
Assuming TIC is a specific system/context, generally: Check
/etc/fstab
for FS layout.Backup layout:
lsblk
orfdisk -l
before upgrade. (Clarify "TIC" for a precise answer.)
Let me know if you need further clarification!