System Admin Q & A – XX

Ques 1: – How to migrate LVM partition from One Server To Another Server ?

Ans: – Follow the below mentioned steps to migrate LVM partition from one server to another

Umount the LVM partition
Make the voulme Group inactive using vgchange command

# vgchange -an Voulme-Group-Name

Export the Volume Group using vgexport command

#vgexport Voulme-Group-Name

Now Assign the same storage or volume to new server and scan the physical volume using pvscan command.
Now Import the voulme Group Activate the Voulme Group

# vgimport Voulme-Group-Name

using below command

# vgchange -ay Voulme-Group-Name

Now mount the LVM partition

# mount /dev/mapper/Volume-Group-LVM-Name   /Mount-Point

Ques 2: – What are the static routes & how to add static routes in Linux ?

Ans: – Static routes are for traffic that must not, or should not, go through the default gateway. Static routes are for traffic that must not, or should not, go through the default gateway Static routes will be added usually through “route add” & “ip route” command. The drawback of ‘route’ command is that, when Linux reboots it will forget static routes. But to make it persistent across reboots, you have to add it to /etc/sysconfig/network-scripts/route-eth0

Ques 3: -What is multipathing and Why it is required ?

Ans: – Multipathing is a feature of Red Hat Linux ,it allows you to configure multiple I/O paths from your server to your storage device (SAN, etc). These are physical paths that include HBA, cables and switches. Multipathing aggregates the I/O paths, creating a new device that consists of the aggregated paths. Multipathing is required to remove the single point of failure and provide fault tolerance.

Ques 4: – How To add swap space to the Linux Servers on the Fly ?

Ans: – There are two ways to add swap space to linux server , first create a swap partition and enable swap on the partition and add the swap space using swapon command. Second method if you don’t have enough space on the drive to create partition , so in this case , just create a swap file using dd command , enable swap space on the file.

Ques 5: -How to create a initrd file in redhat linux ?

Ans: – : Initrd is the initial ram disk , it contains the temopary root file system ,w hich helps the kernel to mount real root file system , using mkinitrd command we can create initrd file.

# mkinitrd -o /boot/initrd.$(uname -r).img $(uname -r)

Ques 6: -What is load average in Linux Boxes ?

Ans: – : Load Average is defined as the number of process waiting in the run queue, plus the numbers of process currently executing over 1 ,5 & 15 minutes period of interval. Using the ‘top’ and uptime command we can find the load average of linux servers.

Ques 7: – How To enable timestamps in output of history command ?

Ans: – When we run the “history” command it only gives you command along with the line numbers. Sometimes it’s useful to have a time stamp attached to each command to build a clearer picture. To enable the timestamps in history command we have to set “HISTTIMEFORMAT “ environment variable.


Ques 8: – How do you find how many cpu are in your system and there details?

Ans: – Method:1 By looking into file /etc/cpuinfo for example you can use below command:

# cat  /proc/cpuinfo

Method:2 We can also use the command ‘lscpu’ as shown below :

h4@prod11:~$  lscpu
Architecture:          x86_64
CPU  op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s)  list:   0-3
Thread(s) per  core:    2
Core(s) per  socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 37
Stepping:              5
CPU MHz:               933.000
BogoMIPS:              4787.70
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA  node0 CPU(s):     0-3

Ques 9: – How do you know if the remote host is alive or not ?

Ans: – : We can can use the commands ‘ping & telnet’ to find whether remote host is alive or not. If you are getting the reply of ping command then it means remote host is up and running. Now if you want to know wthether a particular service is running or not then use the telnet command as shown in the above question.

Ques 10: – What is the difference between Swapping and Paging ?

Ans: – Swapping: Whole process is moved from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation and overhead to the system. Swapping systems does not handle the memory more flexibly as compared to the paging systems.

Paging: Only the required memory pages are moved to main memory from the swap device for execution. Process size does not matter. Gives the concept of the virtual memory. It provides greater flexibility in mapping the virtual address space into the physical memory of the machine. Allows more number of processes to fit in the main memory simultaneously. Allows the greater process size than the available physical memory. Demand paging systems handle the memory more flexibly.

Ques 11: – What’s the difference between local, global and universal groups in windows server?

Ans: – Domain local groups assign access permissions to global domain groups for local domain resources. Global groups provide access to resources in other trusted domains. Universal groups grant access to resources in all trusted domains.

Leave a Reply