0% found this document useful (0 votes)
47 views

Extended Questions

This document discusses several methods for isolating CPUs on a Linux system to enhance real-time performance. It describes using the tuned utility and modifying the realtime-variables.conf file to set the isolated_cores option and specify which CPUs to isolate. It also discusses using the nohz and nohz_full kernel parameters, and using tools like taskset and cset to assign processes to isolated CPUs.

Uploaded by

venkatesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Extended Questions

This document discusses several methods for isolating CPUs on a Linux system to enhance real-time performance. It describes using the tuned utility and modifying the realtime-variables.conf file to set the isolated_cores option and specify which CPUs to isolate. It also discusses using the nohz and nohz_full kernel parameters, and using tools like taskset and cset to assign processes to isolated CPUs.

Uploaded by

venkatesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

1) How do you make CPU isolation?

Ans: In multi-processor realtime systems, it is sometimes desirable to isolate some CPUs in the system to
enhance their capability to maintain realtime performance. Normally, when the Linux kernel is running in
an SMP configuration, any CPU may take an interrupt or run a process.
#lstopo-no-graphics --no-io --no-legend --of txt
#numactl –hardware

Isolating CPUs Using tuned's isolated_cores Option


The initial mechanism for isolating CPUs is specifying the boot parameter isolcpus=cpulist on the kernel boot
command line.
# yum install tuned tuned-profiles-realtime
In file /etc/tuned/realtime-variables.conf, set the configuration option isolated_cores=cpulist, where cpulist is the list
of CPUs that you want to isolate.
#isolated_cores=0-3,5,7

Activate the tuned profile using the tuned-adm utility and then reboot:
# tuned-adm profile realtime
# reboot

Upon reboot, verify that the selected CPUs have been isolated by searching for the isolcpus
parameter at the boot command line:
# cat /proc/cmdline | grep isolcpus
BOOT_IMAGE=/vmlinuz-3.10.0-394.rt56.276.el7.x86_64 root=/dev/mapper/rhel_foo-root ro crashkernel=auto
rd.lvm.lv=rhel_foo/root rd.lvm.lv=rhel_foo/swap console=ttyS0,115200n81 isolcpus=0,4

Isolating CPUs Using the nohz and nohz_full Parameters


The nohz and nohz_full kernel boot parameters can also be specified in /etc/tuned/realtime-variables.conf to isolate
CPUs:
#nohz=on
#nohz_full=cpulist

Using Taskset To Assign A Process To an Isolated CPU


To check the CPU affinity of a process with taskset, use the command
# taskset -c -p <pid>
# taskset -c <CPU NUMBER> -p <PID>

For example, to move process 5404 to CPU 2:


# taskset -c 2 -p 5404

Using Cset To Assign A Process To An Isolated CPU

# cset set --cpu <CPU> <CPUSET NAME>

To move processes to a cpuset:


# cset proc --move --pid=<PID>,...,<PID> --toset=<CPUSET NAME>

For example to implement the taskset example using cset:


# cset set --cpu 2 appcpu
# cset proc --move --pid 5404 --toset=appcpu

2) A system is utilizing 100% memory and there is no process running, we knew that rebooting the system will fix
the issue, but how to fix the issue without taking a reboot)
Ans: Linux Server capacity indicates 100% used even after log files have been emptied
If you remove a file that's still open (a process still has it open) the space will not be free'd until that process is
either killed or sent a HUP signal.
If the files removed were from syslog (sysklogd or rsyslog) restart or reload the daemon.
If the files removed were part of Apache or some other web service restart that service.
If this is a custom application restart it. Alternatively, you can try sending a HUP signal (kill -HUP PID) to see if
it will close the file and re-open it.
If you don't know what the process is that has the file open you can use lsof to find open deleted files.
$ lsof -P -n | grep deleted
cat 12313 gene 1w REG 8,1 0 3129916 /tmp/stackexchange.log (deleted)

3) LVM commands are not working, whereas file systems are mounted and those are under LVM (LVM cache).
What could be cause of the issue?
Ans:
Issue System unable to boot receives lvm errors and unable to find root filesystem.
 Booting into rescue mode and executing lvm command, it throws error
# lvs
-bash: lvs: command not found
[root@ ~]# lvdisplay
-bash: lvdisplay: command not found
Solution
 System seems to be missing the lvm binary files under /sbin folder .
 Reinstall the lvm2 package in rescue mode and check to see if all binaries are now made available in /sbin folder.
# yum reinstall lvm2
Root Cause
 lvdisplay display binaries were missing
#ls -al /sbin/lv*
ls: /sbin/lv*: No such file or directory
Diagnostic Steps
# which lvdisplay
/sbin/lvdisplay
#ls -al /sbin/lv*
ls: /sbin/lv*: No such file or directory

4) LVM partial errors, how to fix the issue and what is the possible cause of that error?
Fixing LVM I/O Errors:
Example : Reason of this could be because removing the disk/LUN’s without clean shutdown/unmount or de-
attaching disks from LV’s  . “ /dev/sdf: read failed after 0 of 4096 at 0: Input/output error “
 Solution :
1) Check which Volume Group have the issue , run “vgscan” command .
2) Find out the Logical Volumes attached with that Volume Group .
3) Inactive the logical volumes as :
  # lvchange -an <lv-name>
4) Inactive Volume group as :
 #  vgchange -an <vg-name>
5) Again Scan Volume group using “vgscan” .
6) Now activate the Volume Group :
# vgchange -ay <volume-group-name>
7) Run command “lvscan” , the error should be gone now .
8) Now activate the Logical Volume Name :
# lvchange -ay <lv-name>

5) How we can Share the file systems from Linux to window server without samba server?
Ans: Method: 1 : You can access your Windows share from the Linux command line using the smbclient program.
# sudo apt-get install smbclient
Method: 2 : Using Konqueror
Many Linux distributions use the KDE desktop environment and the Konqueror file manager/browser. If this is
what you are using, you can follow these steps to access your Windows shared folder:
1. Click the K menu icon.
2. Select Internet -> Konqueror.
3. In the Konqueror window that opens, click the Network Folders link, or type remote:/ in the address
bar and press Enter.
4. Click the Samba Shares icon.
5. Click the icon of your Windows Home workgroup.
6. Click the Workgroup icon.
7. Click the icon for your computer.
8. When prompted, enter the username and password for the Windows account that created the share.
9. Click OK.

Method: 3 : Using Nautilus


Many Linux distributions, especially those that use the GNOME desktop environment, use the Nautilus file
manager. If this is what you're using, you can follow these steps to access your Windows shared folder:
1. Open Nautilus.
2. From the File menu, select Connect to Server...
3. In the Service type: drop-down box, choose Windows share.
4. In the Server: field, enter the name of your computer.
5. Click Connect.
Alternatively, in the Nautilus address bar, you can type smb://ComputerName/ShareName and press Enter.
For instance, when you created your Windows Share, if the share name was listed as:
\\YOURCOMPUTERNAME\Users\YourUserName\ShareFolderName
Type smb://YOURCOMPUTERNAME/Users/YourUserName/ShareFolderName and press Enter. Note the
smb: at the beginning, and that on Linux you should use forward slashes instead of backslashes.

6) How to make a modification manually in initrd image. Let’s see, we got an ISO image and we need to make a
change in that, after that we have to compress it back so that it can work properly. How will u do that?
Ans: initrd.img is a compressed cpio archive. Compression method depends on the vendor/person who delivers
and it could be gzip, lzma etc. So to view the contents of initrd.img you have to do,
Method:1
1. Decompress the initrd.img.
o find the type of compression using file command.
 file initrd.img
o  then decompress according to the type of compression
 Ex 1: if gzipped, 
 mv initrd.img initrd.img.gz
 gunzip initrd.img.gz
 Ex 2: if lzma compressed ,
 mv initrd.img initrd.img.lzma
 unlzma initrd.img.lzma (you can use xz command also to decompress as shown
below).
2. Extract the cpio archive.
o mkdir initrd_new
o cd initrd_new
o cpio -id < ../initrd.img
3. View the contents and make the required changes.
4. Pack the cpio archive.
o Repack the modified cpio in newc format.
 find . | cpio -o --format='newc' > ../initrd_new.img
2. Compress the cpio archive using any of the compression method need not to be same as original
compression method. Compression is an optional step and recommended to use.
Ex: Modifying the RHEL initrd.img
Extract the initrd.img
    Extract the initrd.img provided by the RedHat. Redhat initrd.img is an lzma compressed cpio archive. First
uncompress the lzma file and then extract the cpio.
mv initrd.img initrd.img.xz
xz --format=lzma initrd.img.xz --decompress
mkdir initrd_mod
cd initrd_mod
cpio -id < ../initrd.img
Modify the initrd contents.
Repack the initrd.img back
    Once the required the changes are made, pack the initrd and compress it back. Remember to create the cpio
archive in newc format.
      find . | cpio --create --format='newc' > ../initrd.img
           cd ..
            xz --format=lzma initrd.img
            mv initrd.img.xz initrd.img

Method:2 For RHEL - 5 ,6


First, create a temporary work directory and switch into it. This will be the location where the initramfs/initrd
contents will be viewed, edited, and re-compressed if required:
mkdir /tmp/initrd
cd /tmp/initrd

Identify compression format of the image


Use the file command on the initramfs/initrd to identify the compression format:
file /boot/initramfs-$(uname -r).img

The $(uname -r) will use the file for the current kernel version. You may also specify a specific file, such
as:
file /boot/initramfs-2.6.32-754.el6.x86_64.img

The most common is a gzip-format image which displays as:


# file /boot/initramfs-$(uname -r).img

/boot/initramfs-2.6.32-754.el6.x86_64.img: gzip compressed data


However, there may also be an XZ/LZMA-format image which displays as:
# file /boot/initramfs-$(uname -r).img
/boot/initramfs-2.6.32-754.el6.x86_64.img: LZMA compressed data

Select the appropriate instructions below to extract or repack the correct image type for your system.
gzip format - Extract / Uncompress
Uncompress and extract the contents of the image in the /boot/ directory:
zcat /boot/initrd-$(uname -r).img | cpio -idmv
gzip format - Repack / Recompress
Still in the working directory, find all files and add them to a new boot image file:
find . | cpio -o -c | gzip -9 > /boot/new.img

xz/LZMA format - Extract / Uncompress


Uncompress and extract the contents of the image in the /boot/ directory:
xz -dc < /boot/initrd-$(uname -r).img | cpio –idmv

xz/LZMA format - Repack / Recompress


Still in the working directory, find all files and add them to a new boot image file:
find . 2>/dev/null | cpio -c -o | xz -9 --format=lzma > /boot/new.img

Method:3 For RHEL - 7 ,8


First, create a temporary work directory and switch into it. This will be the location where the initramfs contents
will be viewed:
mkdir /tmp/initrd
cd /tmp/initrd

Uncompress and extract the contents of the image in the /boot/ directory:
/usr/lib/dracut/skipcpio /boot/initramfs-$(uname -r).img | gunzip -c | cpio –idmv

The $(uname -r) will use the file for the current kernel version. You may also specify a specific file, such as:
/usr/lib/dracut/skipcpio /boot/initramfs-3.10.0-957.el7.x86_64.img | gunzip -c | cpio –idmv

You may now view the contents of the boot image and interact with them:
# ls
bin dev etc init lib lib64 proc root run sbin shutdown sys sysroot tmp usr var
Root Cause
The initramfs file now stores both CPU microcode and the initial boot image in the one "combined" image file.
The CPU microcode is stored with CPIO compression, then the boot image is stored with its own separate
compression.
The kernel processes the one "combined" image file, uncompresses and loads the CPU microcode into the CPU,
then uncompresses the boot image and starts init.
When viewing this combined image file on a booted system, it is necessary to use skipcpio to "skip past" the
CPIO-compressed CPU microcode to access the boot image.

7) how many logical extent (LE) can be in a LVM partition?


Ans: 4 primary partitions (3 partitions and 1 extended partition)
11 logical partitions on the extended partition
In Linux, MBR uses maximum 60 logical partitions under the extended partition. But only primary and logical partitions
are used to feed the Linux data not extended partitions so it means only 63 partitions are useful to feed the data into the
partitions.

8) what is Linear in LV
Ans: Linear Volumes. A linear volume aggregates multiple physical volumes into one logical volume. For example, if
you have two 60GB disks, you can create a 120GB logical volume. The physical storage is concatenated. Creating a
linear volume assigns a range of physical extents to an area of a logical volume in order.

9) What are the Linux boot files?


Ans: /boot is an important folder in Linux. /boot folder contains all the boot related info files and folders such as grub.
conf, vmlinuz image aka kernel etc.
10) let’s see, there is one PV of 130 GB, the requirement is. Need to move this PV into another set of disks (60
Gb & 70 GB) so is it possible and if possible how will u do that?
Ans: Yes, we can through LVM Migration or PVMOVE
Before moving a PV, you should make sure that the Logical Volumes created on top of such PVs does not share
physical extents with other PVs. You can find the extent and device of an LV using the command given below;
# lvdisplay -m
Steps involved
1. Unmount the directory .
# umount /data01
2. Deactivate the active LVs on the device.
# lvchange -a n /dev/data_vg/lv_data01
3. Split the VG to a new temp VG and rescan the PVs
# vgsplit data_vg tempvg PV
# pvscan
The pvscan command will list the available PVs and their VGs.
4. Merge the tempvg to the destination VG
# vgmerge dest_vg tempvg
# pvscan
5. After everything is listed correctly in the pvscan command, activate the LVs.
# lvscan
# lvchange -a n /dev/dest_vg/lv_data01
6. Mount the LVs correctly.
# mount -t [filesystem_type] /device /dir

PVMOVE
For this move the following PV command should be used:
# pvmove -n lv_warehouse [source-PV] [destination-PV]
That means that in the case of lv_data02, the command should look like this:
# pvmove -n lv_data02 /dev/sdb /dev/sdbp

11) sometime, while PVMOVE , it may stuck so what is the possible cause and how to fix that?
Issue
 When trying to execute a pvmove where the physical volume holds more than one logical volume the process
hangs and fails to complete.
 Pvmove hangs when there are other I/O operations occurring on the physical volume
solution
 A workaround exists.  To avoid the hang, use the '-n" option of pvmove to move only one LV at a time.
o Example:
 List of LVS in VG:  lvs --noheadings -o name $vg
 Move one LV:  pvmove -i0 -n $lvname
 If a pvmove hang occurred, is in progress, please refer to the knowledge base article "How to recover from a
stopped or cancelled pvmove" for recovery steps.
Root Cause
 Known issue involving the suspend/resume cycle of pvmove under certain logical volume configurations.
Diagnostic Steps
 To determine whether any LVs share a PV, you can use the below script.  If any of the PVs listed show
more than 1 LV on it, you should use "pvmove -n" to move them individually.
# for p in `pvs --noheadings -oname`; do echo "LVs on" $p; lvs --noheadings -oname,devices | grep -c $p; done
LVs on /dev/sda2
5
LVs on /dev/sdb
2
LVs on /dev/sdc
0

12) how to create a striped logical volume and what is striping in LVM?
Ans: # lvcreate -L 50G -i2 -I64 -n gfslv vg0
The following command creates a striped volume 100 extents in size that stripes across two physical volumes,
is named stripelv and is in volume group testvg . The stripe will use sectors 0-49 of /dev/sda1 and sectors 50-
99 of /dev/sdb1 .

# lvcreate -l 100 -i2 -nstripelv testvg /dev/sda1:0-49 /dev/sdb1:50-99


Using default stripesize 64.00 KB
Logical volume "stripelv" created

13) A few LUNs are showing failed in multipath & storage team has confirmed that there is no issue from their end.
what could be possible cause of the issue from OS end and how to fix it.
Ans: Issue : RHEL 6.10 system attached to HP P9500 Storage Array SAN is showing 1 of 4 LUN paths as
faulty. All LUN's are showing the second path as failed.
 2:0:1:0 sdae 65:224 0 [undef][faulty] HP,OPEN-V
 2:0:1:1 sdaf 65:240 0 [undef][faulty] HP,OPEN-V
 2:0:1:2 sdag 66:0 0 [undef][faulty] HP,OPEN-V
solution
 If a closed ELS event was received, that would explain the lack of connectivity. To reinitialize the exchange, a
LIP would need to be issued for the faulty host. As an example, this can be performed by the following:
# echo 1 > /sys/class/fc_host/host2/issue_lip
The above should reinitialize the login exchange and bring the paths back once a successful path_checker iteration
completes.
Root Cause
 There is a FCP Target port in 'Not Present' port_state and it was determined that there was a configuration change
on the port that cause the port to go down:
Class Device = "0-3"
Class Device path = "/sys/class/fc_remote_ports/rport-2:0-3"
dev_loss_tmo = "30"
fast_io_fail_tmo = "off"
maxframe_size = "4294967295 bytes"
node_name = "0xffffffffffffffff"
port_id = "0xffffffff"
port_name = "0x50060e8016049100"
port_state = "Not Present"
roles = "unknown"
scsi_target_id = "1"
If an FCP Target port does not respond within dev_loss_tmo, the port is placed in 'Not Present' state and access to
targets are blocked, the signature remains to persist the scsi target id binding in case the port is re-established.
All IO, including the multipathd path_checker are blocked.
Diagnostic Steps
Get the output of the following commands:
# systool -c fc_remote_ports -v
# systool -c fc_host -v
# for d in $(ls /sys/block |grep sd); do echo $d - `cat /sys/block/$d/device/state`; done

14)How do you provide an user exclusive permissions to reboot a system?


Ans: First login as a root user:
# echo rocky >> /etc/shutdown.allow
Alternatively, use a text editor such as vi to add a username to etc/shutdown.allow file (max 32 names are allowed at a
time):
# vi /etc/shutdown.allow
Finally, rocky can login and type the following command:
rocky@server1 $ /sbin/shutdown -a -h 0

15)Do you worked on Linux hardening? List few examples


Ans: To improve the security level of a system, we take different types of measures. This could be the
removal of an existing system service or uninstall some software components.
System hardening is the process of doing the ‘right’ things. The goal is to enhance the security level of the
system.
System hardening steps
1. Install security updates and patches
2. Use strong passwords
3. Bind processes to localhost
4. Implement a firewall
5. Keep things clean
6. Security configurations
7. Limit access
8. Monitor your systems
9. Create backups (and test!)
10. Perform system auditing

16)What is zombie process? How you clear it?


Ans: A zombie or a defunct process in Linux is a process that has been completed, but its entry still remains in the
process table due to lack of correspondence between the parent and child processes. ... When the child process has
finished, the wait function signals the parent to completely exit the process from the memory
# kill -s SIGCHLD pid

17)How to check the status of network bonding? What are the different modes of Network bonding in Linux ?
Ans: # cat /proc/net/bonding/bond0
# ifconfig | grep -i bond
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
There are 7 types of Network Bonding:
1. mode=0 (Balance Round Robin)
2. mode=1 (Active backup) ⇒ Explained in this tutorial.
3. mode=2 (Balance XOR)
4. mode=3 (Broadcast)
5. mode=4 (802.3ad)
6. mode=5 (Balance TLB (Adaptive transmit load balancing))
7. mode=6 (Balance ALB (Adaptive load balancing))
18)How to upgrade Kernel in Linux ? list some of the Linux performing tuning done on a linux server?
Ans:
1. Login as root user
2. Check for updates using the yum check-update command
3. Update the system using the yum update command
4. Reboot the server/box using the reboot command
5. Verify new kernel and updates
Step 1 – Note down the current kernel version
Type the following uname command or cat command to view RHEL kernel version and OS info:
$ uname -a
$ uname -r
$ cat /etc/os-release
Step 2 – Backups
Make a backup – it cannot be stressed enough how important it is to make a backup of your system before you
do this. Most of the actions listed in this post are written with the assumption that they will be executed by the
root user running the bash or any other modern shell.
Step 3 – Check for updates
Type the following yum command:
$ sudo yum check-update
Step 4 – Apply/install updates
Type the following yum command:
$ sudo yum update -y
Step 4 – Reboot the RHEL 7.4 box
Type the following reboot command or shutdown command:
$ sudo reboot
OR
$ sudo shutdown -r now
Step 3 – Verify the RHEL 7.5 update
Type the following commands:
$ uname -a
$ uname -r
$ cat /etc/os-release
$ tail -f /var/log/logfilenames
$ dmesg | grep -i 'err|warn|cri'
$ ss –tulpn

Method-2:
Performing the Upgrade
[root@lab ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@lab ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Updating / installing...
1:elrepo-release-7.0-3.el7.elrepo ################################# [100%]

To check the available kernel packages


[root@lab ~]# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
elrepo-kernel                      | 2.9 kB 00:00:00
elrepo-kernel/primary_db          | 1.7 MB 00:00:00
Available Packages
kernel-ml.x86_64                   4.12.10-1.el7.elrep        elrepo-kernel
Install the kernel packages using yum command
[root@lab ~]# yum --enablerepo=elrepo-kernel install kernel-ml
Installed:
kernel-ml.x86_64 0:4.12.10-1.el7.elrepo
Dependency Installed:
linux-firmware.noarch 0:20170606-56.gitc990aae.el7
Complete!
Edit the “/etc/default/grub” file and set default boot order to “0”
[root@lab ~]# vi /etc/default/grub
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true
Upgrade the grub configuration for latest kernel. RE-compile your grub configuration to boot with latest
Kernel version
[root@lab ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.12.10-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-4.12.10-1.el7.elrepo.x86_64.img
done
Now Reboot the machine
To check the kernel latest version
[root@lab ~]# uname -r
4.12.10-1.el7.elrepo.x86_64
19)how do you scan new LUN in RHEL server? how you create an alias name for new this new LUN in native
multipathing software?
Ans: Scanning FC-LUN’s in Redhat Linux
# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
Find out how many host bus adapter configured in the Linux box.you can use “systool -fc_host -v” to verify
available FC in the system.
# ls /sys/class/fc_host
host0 host1
In this case,you need to scan host0 & host1 HBA.
If the system virtual memory is too low ,then do not proceed further.If you have enough free virtual
memory,then you can proceed with below command to scan new LUNS.
# echo "1" > /sys/class/fc_host/host0/issue_lip
# echo "- - -" > /sys/class/scsi_host/host0/scan

Scanning SCSI DISKS in Redhat Linux


1. Finding the existing disk from fdisk.
[root@mylinz1 ~]# fdisk -l |egrep '^Disk' |egrep -v 'dm-'
Disk /dev/sda: 21.5 GB, 21474836480 bytes
2. Find out how many SCSI controller configured.
[root@mylinz1 ~]# ls /sys/class/scsi_host/host
host0 host1 host2
In this case, you need to scan host0,host1 & host2.
3. Scan the SCSI disks using below command.
[root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan

20)How you remove a device map(say /dev/mpath1) from OS?


Ans: Issue : Unable to remove the multipath device after unmapping the LUN from the server.
 Attempting to flush a multipath map with "multipath -f" or "multipath -F" results in "map in use":
# multipath -f mpath7
mpath7: map in use
 The multipath command still shows the multipath device, with path(s) to the unmapped LUN as follows:
# multipath -ll mpath7
mpath7 (36090a01870982994dcb8d4405ed03cbf) dm-7 ,
[size=4.4T][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][enabled]
\_ #:#:#:# - #:# [failed][faulty]
Resolution
 Locate any subsystem or process holding the multipath device open.  See diagnostic steps for possible tools and
techniques.
 For any subsystem or process holding the multipath device open, stop the process, or issue commands to release
the multipath device.
 Some examples of possible holders of a multipath device and the commands to release it:
1. A filesystem exists on the multipath device and is currently mounted.
 Unmount the filesystem and if it exists in /etc/fstab, remove it.
2. One or more partition mapping(s) still exists on the multipath device.
 Use "kpartx -d" on the multipath device to remove the device partition mapping(s).
3. The multipath device was used by LVM, and still has device mapper state in the kernel.
1. Use "lvchange -an" to deactivate any logical volume(s) associated with the multipath device.  A list of
logical volumes associated with the multipath device may be found by examining the output of " lvs -o
+devices".
2. If "lvchange -an" fails, the logical volume is only partially removed, or there are blocked processes with
I/O outstanding on the device, use "dmsetup remove -f" followed by "dmsetup clear" on the multipath
device.  See dmsetup man page for full explanation of these commands.
o Once all holders of the device have been removed, the multipath device should be flushed with
"multipath -f".
Root Cause
 The multipath device was held open by at least one process or subsystem.
Diagnostic Steps
 Use 'lsof' to attempt to find anyone holding the device open.
 Check 'dmsetup' output for any device mapper maps that depend on the multipath device
 Check the if there is a device for mpath7 in /dev/mapper/mpath7
 Check multipath -v4 -ll

21)what is udev? lists the udev rule you worked on?


Ans: Udev is the device manager for the Linux 2.6 kernel that creates/removes device nodes in the /dev directory
dynamically. It is the successor of devfs and hotplug. It runs in userspace and the user can change device names using
Udev rules. Udev depends on the sysfs file system which was introduced in the 2.5 kernel.

22) how you rename an interface name? say eth0 to eth1?


Ans: Edit the file /etc/udev/rules.d/70-persistent-net.rules to change the interface name of a network device.
Rename network interface from eth0 to wan0
To rename interface eth0 to wan0, edit /etc/udev/rules.d/70-persistent-net.rules file and change NAME="eth0" to
NAME="wan0".
# PCI device 0x11ab:0x4363 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:00:00:00:00:00",ATTR{dev_id}=="0x0", ATTR{type}=="1",
KERNEL=="eth*", NAME="wan0"
For Centos/RHEL etc.
Rename the network interface configuration file:
# cd etc/sysconfig/network-scripts/
# mv ifcfg-eth0 ifcfg-wan0
Edit the network interface configuration file and replace all occurrences of the old name eth0 with the new one
wan0:
# vi /etc/sysconfig/network-scripts/ifcfg-wan0
# reboot
# ifconfig -a

22)how you activate a logical volume which is in deactivate state?


Ans: To deactivate the logical volume/ volume group
lvchange -an /dev/vg_name/lv_name
vgchange -an vg_name
To activate the logical volume/ volume group
lvchange -ay /dev/vg_name/lv_name
vgchange -ay vg_name

23)how you take a LVM configuration backup?


Ans: # vgcfgbackup /dev/vg-01
Volume group "vg-01" successfully backed up.

24)How you reduce a LVM file system?


Ans: # lvreduce -L 400M /dev/vg00/lv00
# mkfs.xfs -f /dev/vg00/lv00
or
# resize2fs /dev/vg_tecmint/LogVol01

lvextend -L +2T <lvm>


# xfs_growfs <lvm mountpoint>

25) what is the difference between a drvier and firmware? how do you update a firmware on a server?
Ans: Device drivers are operating system-specific and hardware-dependent. A device driver acts as a translator between
the hardware device and the programs or operating systems that use it.
Firmware is a software program permanently etched into a hardware device such as a keyboards, hard drive, BIOS, or
video cards.
26)how you check RAID status on a Linux server?
Ans: # cat /etc/mdadm.conf
Or
#cat /proc/mdstat

27)How do you find if a free PCI slot in linux?


Ans: # lspci -vmm | grep -B1 -A2 ‘^Class.*Ethernet’
Or
# sudo dmidecode -t 9 | grep -A3 “System Slot Information” | grep -c -B1 “Available”

28)System got rebooted automatically? How do you find the root cause?

29)System is running very slow? how do you troubleshoot it?

30)The system simply hangs after POST. The screen is completely blank. The option to Boot Installed Systems are not
available? How do you fix this issue?

31)how do you extend a gluster FS?


Ans: # vgs VGgluster
# lvextend --resizefs -L+500M VGgluster/brick1
~~~
The size has been updated on the client :
~~~
# df /glusterfs/mountpoint

32)what is the role of RICCI in Redhat cluster suit?


Ans: luci is a server that runs on one computer and communicates with multiple clusters and computers via ricci. ricci is
an agent that runs on each computer (either a cluster member or a standalone computer) managed by Conga.

33)List the cluster changes which is not required a restart?


34)Explain about locking types ?
Ans: 2 Types of Linux File Locking (Advisory, Mandatory Lock Examples) File locking is a mechanism which allows
only one process to access a file at any specific time. By using file locking mechanism, many processes can read/write a
single file in a safer way.

35)How do you push rpm in a custom channel?


36)How you automate post build activities using satellite server?

37)How do you prevent fork bomb issue?


Ans: Avoid use of fork in any statement which might end up into an infinite loop. Just login as root, and edit this file, to
add users and configure, their limit. You can try Running the command in Virtualbox if you want to run it.
Limiting user processes is important for running a stable system. To limit user process just add user name or group or all
users to # /etc/security/limits.conf file and impose process limitations.
# vi /etc/security/limits.conf
Following will prevent a “fork bomb”:
vivek hard nproc 300
@student hard nproc 50
@faculty soft nproc 100
@pusers hard nproc 200

38)How to find out if some one did rm -rf command in Linux server.

You might also like