Linux Technical Interview QA with Practical Sessions

Why take this course?
-
Number of volume groups in LVM: There's no strict limit set by the Linux Logical Volume Manager (LVM) for the number of volume groups you can create, except for the theoretical limits imposed by the file system and hardware capabilities. However, practical limits may be influenced by the amount of storage and available resources.
-
Increasing logical volumes on the fly: Yes, it is possible to increase the size of a logical volume without downtime using LVM tools like
lvextend
orlvresize
. -
Reducing logical volumes: You can reduce the size of a logical volume using
lvreduce
. This operation can be performed online (on-the-fly) if the reduction does not require moving extents beyond the current size. -
Increasing logical volumes: To increase the size of a logical volume, you can use
lvextend
to extend the volume to accommodate more space orlvresize
to change the size of the logical volume. -
Scanning new LUN or disk for LVM PV: You can use
vgs
(Volume Group Scanner) to scan disks and find out if they are already part of a volume group, or you can usepvcreate
followed byvgscan
to recognize new physical volumes. -
Scanning disks for existing volume group: Use
vgchange -a vgname
to activate a volume group and then runvgs
. -
Scanning a logical volume from an existing volume group: Once the volume group is active, you can scan it for logical volumes with
vgs
followed bylvdisplay
. -
Deactivating/stopping a logical volume: Use
lvchange -an /dev/<VG_Name>/<LV_Name>
to deactivate the logical volume. -
Activating a deactivated logical volume: Use
lvchange -a yes /dev/<VG_Name>/<LV_Name>
to activate it again. -
Deactivating/disabling a volume group: You can use
vgchange -an <VG_Name>
to deactivate all logical volumes in the volume group and effectively disable it. To re-enable it, activate the logical volumes withlvchange
and then runvgextend
. -
Enabling/activating a volume group: Activate the logical volumes within the volume group with
lvchange -a yes
, followed byvgextend <VG_Name>
. -
Logical volume mirroring: To find out if disks are being used for mirroring, you can check the volume group metadata using
vgs
orlvdisplay
. -
Listing imported volume groups: Use
lvs
orvgs
to list all volume groups accessible by the system. -
Listing available logical volumes: Use
lsblk
,lvlist
, orvgdisplay
followed by--logs
to list all logical volumes in a volume group. -
Listing available physical volumes: Use
pvdisplay
orpvscan
to list all the physical volumes that LVM recognizes. -
Detailed volume group information: Use
vgdisplay <VG_Name>
.
Linux Boot Process:
- The boot process starts with the system's firmware (BIOS or UEFI) powering on the hardware and starting the bootloader.
- The BIOS/UEFI reads the MBR (Master Boot Record), which contains the bootloader code and a partition table defining the partitions on the disk.
- The GRUB (GRand Unified Bootloader) is a common bootloader that provides a menu to select different kernels or recovery modes. Grub2 replaced GRUB in many distributions and includes additional features like UEFI support.
- The kernel initializes the hardware, loads the necessary drivers, and starts user-space applications like
init
or systemd.
Process Management:
- A process is an instance of a program in execution. The command to list all processes is
ps
. - Custom properties can be used with
ps
by specifying options likeaux
,-%p
,--sort={column}
, etc. - PID (Process IDentifier) uniquely identifies a process. PPID (Parent Process IDentifier) shows the parent of a process. For example, if you run
ps aux | grep httpd
and see7893 1234555 tty7 R+ 0:22 /usr/sbin/httpd
,7893
is the PID,1234555
is the PPID. - Nice values range from -20 to 19, where higher numbers (lower nice values) get more CPU resources. Use
renice
ornice{cmd}
to set a process's nice value. - 'D Uninterruptible sleep mode' indicates a process sleeping awaiting I/O operations.
- 'Z' stands for zombie; a process in this state has finished execution but still has an entry in the process table to reap resources. 'p' or 'P' stands for sleeping on IO, and 's' stands for sleep system clock interruption, where the process waits for a timer to wake up.
Process Management Commands:
ps aux
: Shows detailed information about running processes.kill -l
: Lists all signal names (useful forkill
ortkill
commands).kill {PID}
: Sends a SIGTERM signal to the process with the given PID.renice {PID} {nice_value}
: Changes the nice value of the running process.top
,htop
: Interactive process viewers that provide real-time system monitoring and management capabilities.
Remember, these are just some of the common questions and commands you might encounter during a technical interview focused on Linux process management and LVM. It's important to have a good understanding of the underlying concepts as well as the practical application of these commands.
Course Gallery




Loading charts...