What happens in background when you connect a server first time using ssh When you connect to a server for the first time, the server prompts you to confirm that you are connected to the correct system. The following example uses the ssh command to connect to a remote host named host03: # ssh host03 […]
Archives for October 2017
DNS configuration file /etc/named.rfc1912.zones explained
The /etc/named.rfc1912.zones file is listed in the include section of the /etc/named.conf file. The /etc/named.rfc1912.zones file contains five zone sections. Domains are grouped into zones and zones are configured through the use of zone files. The zone statement defines the characteristics of a zone, the location of its zone file, and zone- specific options, which […]
How to recover deleted Logical volume (LV) in LVM using vgcfgrestore
You have accidentally removed a logical volume lv01 from the Volume group vg01. Now you want to recover the LV without losing the data. Follow the steps given below to recover LV (lv01) under VG (vg01). # lvremove vg01/lv01 Do you really want to remove active logical volume vg01/lv01? [y/n]: y Logical volume “lv01” successfully […]
UNIX / Linux : How to change the niceness (priority) of a process
What is process priority (niceness) All process when spawned, they are assigned a priority based on a numeric value called as “nice value“. The priority of a process denotes how much processor time allocated to that process. There are 40 niceness values, with –20 being the highest and +19 the lowest. Most system-started processes use […]
How to make alias command work in bash script or bashrc file
‘set alias‘ for any command and the alias command will work fine on the interactive shell, whereas aliasing doesn’t work inside the script. 1. Interactive shell # alias ls1=’ls -lrt’ # ls1 total 0 -rw-r–r– 1 root root 0 Oct 12 12:14 file1 -rw-r–r– 1 root root 0 Oct 12 12:14 file2 2. Inside the […]
How to recreate LVM device files under /dev directory using vgmknodes
After a server crash or due to a human error, volume group device files are not seen under /dev directory. The device files were removed from the filesystem after the system crash, probably due to a filesystem corruption. # cd /dev # ls vg01 ls: cannot access vg01: No such file or directory If you […]
Linux / UNIX : How to create extended partition using fdisk
Whats is a disk partition Partitioning divides a disk drive into one or more logical disks. Each partition is treated as a separate disk with its own file system. Partition information is stored in a partition table. There are 2 types of partitions that can be created using the fdisk utility : Primary Partitions Extended […]
How to find the mounting options of currently mounted filesystem
You can set the mounting options of a filesystem in the file /etc/fstab. For example : # cat /etc/fstab | grep data /dev/mapper/vg01-lv01 /data ext4 defaults 0 2 Viewing mount options of filesystem 1. To see what options a mounted filesystem is utilizing run the mount command can be ran without any arguments. You can […]
How to mount USB flash drive in Linux
To mount USB flash drive on any Linux system you will first need to know the disk partition name for the USB drive. Finding the partition name is an easy task. Follow the steps below to find the partition name and mounting it on a directory of your choice. 1. Check for the /var/log/messages file […]
How to merge 2 volume groups (VGs) into one using vgmerge in LVM
The ask here is to merge 2 volume groups with existing LVs and there should be no data loss. For the purpose of this post, we have 2 VGs – vg01 and vg02. Both have one LV each created inside them as shown below : # vgs VG #PV #LV #SN Attr VSize VFree cl […]