Skip to content
Advertisements

Posts from the ‘Linux’ Category

Logical volume group partition inactive

We rebooted a one of our linux machine which is running a database, After rebooted We can’t able to start the database due to the one of partition of the logical volume group has missing.

[root@ezylebuat ~]# pvs
WARNING: Device for PV EiG4AR-8JDt-bzEj-5si7-Wf4z-xrYC-a8zXgu not found or rejected by a filter.
WARNING: Device for PV HfPGnn-1bgb-j1HH-7Xvd-6hvq-yk14-jMCrkM not found or rejected by a filter.
PV VG Fmt Attr PSize PFree
/dev/sda2 ol lvm2 a– <199.00g 0
[unknown] ol lvm2 a-m <50.00g 0
[unknown] ol lvm2 a-m <50.00g <50.00g

[root@ezylebuat ~]# lvscan
WARNING: Device for PV EiG4AR-8JDt-bzEj-5si7-Wf4z-xrYC-a8zXgu not found or rejected by a filter.
WARNING: Device for PV HfPGnn-1bgb-j1HH-7Xvd-6hvq-yk14-jMCrkM not found or rejected by a filter.
inactive ‘/dev/ol/u01’ [<167.00 GiB] inherit
ACTIVE ‘/dev/ol/swap’ [<32.00 GiB] inherit
ACTIVE ‘/dev/ol/home’ [25.00 GiB] inherit
ACTIVE ‘/dev/ol/root’ [25.00 GiB] inherit

 

Solution :

activate the volume group

 

[root@ezylebuat ~]# vgchange -a y –partial ol
PARTIAL MODE. Incomplete logical volumes will be processed.
WARNING: Device for PV EiG4AR-8JDt-bzEj-5si7-Wf4z-xrYC-a8zXgu not found or rejected by a filter.
WARNING: Device for PV HfPGnn-1bgb-j1HH-7Xvd-6hvq-yk14-jMCrkM not found or rejected by a filter.
4 logical volume(s) in volume group “ol” now active

 

[root@ezylebuat ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.7G 0 7.7G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 8.9M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/ol-root 25G 16G 9.5G 63% /
/dev/mapper/ol-home 25G 39M 25G 1% /home
tmpfs 1.6G 40K 1.6G 1% /run/user/0
/dev/sda1 1014M 266M 749M 27% /boot
/dev/sdb1 99G 31G 63G 34% /backup
/dev/mapper/ol-u01 117G 101G 17G 86% /u01

 

[root@ezylebuat ~]# lvdisplay
WARNING: Device for PV EiG4AR-8JDt-bzEj-5si7-Wf4z-xrYC-a8zXgu not found or rejected by a filter.
WARNING: Device for PV HfPGnn-1bgb-j1HH-7Xvd-6hvq-yk14-jMCrkM not found or rejected by a filter.
— Logical volume —
LV Path /dev/ol/u01
LV Name u01
VG Name ol
LV UUID OoQvh4-9PRs-zVY3-ZFbO-SGn9-qUng-iJR2wL
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2018-01-17 11:43:54 +0300
LV Status available
# open 1
LV Size <167.00 GiB
Current LE 42751
Segments 2
Allocation inherit
Read ahead sectors auto
– currently set to 8192
Block device 249:4

 

After volume group activated , I can able to start the database . Even though  I can see the some of the HDD server failure, So  I plan to migrate the database to other machine.

Advertisements

mailx sender address picks the OS user account instead of sender address

We’re trying to send email from redhat 7 terminal using with below command,

mailx -s “Test mail” mazar@xxxx.com -r ezylebdb@alerts.xxxx.net

But its sender by OS hostname

Solution :

Send by like below

mailx -r ezylebdb@alerts.xxxx.net -s “Test mail” mazar@xxxx.com

 

creating local repository yum install linux

Follow the below procedure

[root@ebs-app-xx-xx u01]# yum repolist

[root@ebs-app-xx-xx u01]# yum list installed | grep createrepo

createrepo.noarch                         0.9.9-28.el7             @anaconda/7.5

[root@ebs-app-xx-xx u01]# createrepo /u01/Packages/

 

[root@ebs-app-xx-xx u01]# cd /etc/yum.repos.d

[root@ebs-app-xx-xx yum.repos.d]# ls -tlr

total 4

-rw-r–r–. 1 root root 358 Nov  4 22:55 redhat.repo

Now, create custom repository

[root@ebs-app-xx-xx yum.repos.d]# cat custom.repo

[customrepo]

name=Custom Repository

baseurl=file:///u01/Packages/

enabled=1

gpgcheck=0

 

you can check how much packages in the repository

 

[root@ebs-app-xx-xx yum.repos.d]# yum repolist

Now, we can install the rpm packages from the repository

 

[root@ebs-app-xx-xx Packages]# yum install tigervnc-1.8.0-5.el7.x86_64.rpm

 

Issue faced :

 

if  repository giving below error message,then your repository is corrupted.

 

Error Downloading Packages:

InstallMedia: [Errno 256] No more mirrors to try.

 

Solution:

Refer

https://access.redhat.com/solutions/203603

 

Remove this file if there is no X server

Try to start VNC, you may get the below error

 

[root@fusiondev ~]# vncserver

Warning: fusiondev.xxxxx.com:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server fusiondev.xxxx.com:1

New ‘fusiondev.xxxxx.com:2 (root)’ desktop is fusiondev.xxxxx.com:2

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/fusiondev.xxxxx.com:2.log

 

Solution :

[root@fusiondev tmp]# rm -rf /tmp/.X1-lock

[root@fusiondev tmp]# rm -rf /tmp/.X11-unix/X1

[root@fusiondev tmp]# vncserver

New ‘fusiondev.xxxxxx.com:1 (root)’ desktop is fusiondev.xxxxxx.com:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/fusiondev.xxxxxx:1.log

Start and stop firewall OEL 7

Check the status

[root@ezylebuat ~]# systemctl status firewalld
● firewalld.service – firewalld – dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-01-17 06:37:59 EST; 24min ago

Stop the firewall

[root@ezylebuat ~]# systemctl  stop firewalld 

[root@ezylebuat ~]# systemctl status firewalld
● firewalld.service – firewalld – dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2018-01-17 07:04:09 EST; 3s ago
Docs: man:firewalld(1)

Disable the firewall( After reboot,It will not enable automatically)

[root@ezylebuat ~]# systemctl disable firewalld

Enable the firewall

[root@ezylebuat ~]# systemctl enable firewalld

Start the firewall

[root@ezylebuat ~]# systemctl  firewalld start

find the files older than 30 days in linux

cd /u01/app/12c/oracle/trace

find *.trc -maxdepth 1 -mtime +30 -type f -exec ls -l {} \;

 

 

Change hostname in OEL 7

Method 1 :  nmtui  tool on terminal

Method 2 : [root@EDB-LEB-4-53 ~]# hostnamectl status
Static hostname: EDB-LEB-4-53.ace-ins.com
Icon name: computer-vm
Chassis: vm
Machine ID: 11cc4d26c75c476db3fa89a66a0fcae9
Boot ID: afc4b181973e40b9ab46ca774e6130c4
Virtualization: vmware
Operating System: Oracle Linux Server 7.0
CPE OS Name: cpe:/o:oracle:oracle_linux:7.0:GA:server
Kernel: Linux 3.8.13-35.3.1.el7uek.x86_64
Architecture: x86_64

 

[root@EDB-LEB-4-53 ~]# hostnamectl set-hostname ezylebuatdb.damana.com
[root@EDB-LEB-4-53 ~]# hostnamectl status
Static hostname: ezylebuatdb.damana.com
Icon name: computer-vm
Chassis: vm
Machine ID: 11cc4d26c75c476db3fa89a66a0fcae9
Boot ID: afc4b181973e40b9ab46ca774e6130c4
Virtualization: vmware
Operating System: Oracle Linux Server 7.0
CPE OS Name: cpe:/o:oracle:oracle_linux:7.0:GA:server
Kernel: Linux 3.8.13-35.3.1.el7uek.x86_64
Architecture: x86_64

 

Diagnostic-Code: SMTP; 550 host unknown

When we’re trying to send mail to localdomain through mailx from linux box. It says “Diagnostic-Code: SMTP; 550 host unknown”  and mail not sent.

Solution :

Edit sendmail.cf

# “Smart” relay host (may be null)
DS[10.x.x.xx]

restart the sendmail service and send the mail is successful

10.x.x.xx — mailbox server

 

 

 

 

delete argument too long linux

When you’re trying to delete files in linux , you receive following error message

bash: /bin/rm: Argument list too long

Solution :

go to that directory and execute below command

find . -name ‘filename*’ -print0 | xargs  -0 rm

vncserver configuration

Step 1:  Login as root user

Install vncserver rpm package, check whether its already installed or not

vnc-server-4.1.2-14.el5_5.4.x86_64.rpm

[root@ebsdev ~]# rpm -q vnc-server-4.1.2-14.el5_5.4.x86_64
vnc-server-4.1.2-14.el5_5.4
[root@ebsdev ~]#

Step 2: password for vncserver

[root@ebsdev ~]# vncpasswd
Password:
Verify:
[root@ebsdev ~]#

Step 3:

[root@ebsdev ~]# vncserver
xauth: creating new authority file /root/.Xauthority

New ‘ebsdev.ace-ins.com:1 (root)’ desktop is ebsdev.ace-ins.com:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/ebsdev.ace-ins.com:1.log

Step 4:

[root@ebsdev ~]# vi .vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ –x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ –r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
twm &

remove the command from unset and exec

[root@ebsdev ~]# vi .vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ –x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ –r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
twm &

Step 5:

[root@ebsdev ~]# vncserver -kill :1
Killing Xvnc process ID 20106
[root@ebsdev ~]#

Step 6:

[root@ebsdev ~]# vncserver

New ‘ebsdev.ace-ins.com:1 (root)’ desktop is ebsdev.ace-ins.com:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/ebsdev.ace-ins.com:1.log

[root@ebsdev ~]#

Step 7: Download vncviewer

http://www.realvnc.com/download/viewer/

Step 8:  connect the host with vncviewer

Note : Some times you cann’t able connect your host, in this case check your firewall of linux and If already vncserver process aviable, kill the session using by vncserver -kill :1 

If you want to connect the server which was installed on RHEL 7, you just install “tigervnc-server-1.8.0-5.el7.x86_64.rpm” and then start vncserver & you can able to connect the server using vncviewer from your pc.

 

bip_11

 

bip_12

 

bip_13