[root@rhel ~]# pvdisplay /dev/sdb: read failed after 0 of 4096 at 0: Input/output error echo 1 > /sys/class/scsi_device/0:0:1:0/device/delete
Posts Tagged ‘rhel’
LVM Removing PV device
LVM Missing UUID
Boot to rescue mode then…
lvm pvdisplay lvm pvcreate --restorefile /etc/lvm/backup/VolGroup00 VolGroup00 --uuid <missing-uuid> <device-/dev/sdas> lvm vgcfgrestore --file /etc/lvm/backup/VolGroup00 VolGroup00
HP RAID Controller Diagnostics using hpacucli on Red Hat Enterprise Linux
rpm -ivh hpacucli-8.60-8.0.noarch.rpm
3 examples below…
ctrl all show
ctrl all show config
ctrl all show config detail
[root@hp ~]# hpacucli ctrl all show Smart Array P410 in Slot 2 (sn: SOME SERIAL) Smart Array P410i in Slot 0 (Embedded) (sn: SOME SERIAL)
[root@hp ~]# hpacucli ctrl all show config Smart Array P410 in Slot 2 (sn: SOME SERIAL) array A (SAS, Unused Space: 0 MB) logicaldrive 1 (820.2 GB, RAID 50, OK) physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK) physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK) physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 146 GB, OK) physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 146 GB, OK) physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 146 GB, OK) physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 146 GB, OK) physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 146 GB, OK) SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 (WWID: SOME SERIAL) Smart Array P410i in Slot 0 (Embedded) (sn: SOME SERIAL) array A (SAS, Unused Space: 0 MB) logicaldrive 1 (546.8 GB, RAID 1+0, OK) physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK) physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK) physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 146 GB, OK) physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 146 GB, OK) physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 146 GB, OK) physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 146 GB, OK) physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 146 GB, OK)
[root@hp ~]# hpacucli ctrl all show config detail Smart Array P410 in Slot 2 Bus Interface: PCI Slot: 2 Serial Number: SOME SERIAL Cache Serial Number: PBCDF0CRHZ300W RAID 6 (ADG) Status: Disabled Controller Status: OK Chassis Slot: Hardware Revision: Rev C Firmware Version: 3.00 Rebuild Priority: Medium Expand Priority: Medium Surface Scan Delay: 15 secs Surface Scan Mode: Idle Queue Depth: Automatic Monitor and Performance Delay: 60 min Elevator Sort: Enabled Degraded Performance Optimization: Disabled Inconsistency Repair Policy: Disabled Wait for Cache Room: Disabled Surface Analysis Inconsistency Notification: Disabled Post Prompt Timeout: 0 secs Cache Board Present: True Cache Status: OK Accelerator Ratio: 25% Read / 75% Write Drive Write Cache: Disabled Total Cache Size: 1024 MB No-Battery Write Cache: Disabled Cache Backup Power Source: Capacitors Battery/Capacitor Count: 1 Battery/Capacitor Status: OK SATA NCQ Supported: True Array: A Interface Type: SAS Unused Space: 0 MB Status: OK Logical Drive: 1 Size: 820.2 GB Fault Tolerance: RAID 50 Number of Parity Groups: 2 Heads: 255 Sectors Per Track: 32 Cylinders: 65535 Strip Size: 64 KB Status: OK Array Accelerator: Enabled Parity Initialization Status: Initialization Completed Unique Identifier: 600508B100103956595631505A380300 Disk Name: /dev/cciss/c1d0 Mount Points: None Logical Drive Label: A0209451SOME SERIAL7F50 Parity Group 0: physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK) physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 146 GB, OK) physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 146 GB, OK) Parity Group 1: physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK) physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 146 GB, OK) physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 146 GB, OK) physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 146 GB, OK) physicaldrive 1I:1:1 Port: 1I Box: 1 Bay: 1 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1RN0300009051BF0U Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 1I:1:2 Port: 1I Box: 1 Bay: 2 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1SWW500009051BDJQ Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 1I:1:3 Port: 1I Box: 1 Bay: 3 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1STSP00009051YRRF Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 1I:1:4 Port: 1I Box: 1 Bay: 4 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1S7H800009051H7ZU Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 2I:1:5 Port: 2I Box: 1 Bay: 5 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB182KT00009051H7YY Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 2I:1:6 Port: 2I Box: 1 Bay: 6 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB182AF00009051H20G Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 2I:1:7 Port: 2I Box: 1 Bay: 7 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1SV2D00009051BGS0 Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 2I:1:8 Port: 2I Box: 1 Bay: 8 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB181MN00009051Z0TS Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 Device Number: 250 Firmware Version: RevC WWID: SOME SERIAL Vendor ID: PMCSIERA Model: SRC 8x6G Smart Array P410i in Slot 0 (Embedded) Bus Interface: PCI Slot: 0 Serial Number: SOME SERIAL RAID 6 (ADG) Status: Disabled Controller Status: OK Chassis Slot: Hardware Revision: Rev C Firmware Version: 3.00 Rebuild Priority: Medium Expand Priority: Medium Surface Scan Delay: 15 secs Surface Scan Mode: Idle Wait for Cache Room: Disabled Surface Analysis Inconsistency Notification: Disabled Post Prompt Timeout: 0 secs Cache Board Present: False Drive Write Cache: Disabled SATA NCQ Supported: True Array: A Interface Type: SAS Unused Space: 0 MB Status: OK Logical Drive: 1 Size: 546.8 GB Fault Tolerance: RAID 1+0 Heads: 255 Sectors Per Track: 32 Cylinders: 65535 Strip Size: 128 KB Status: OK Unique Identifier: 600508B1001030394241393441301000 Disk Name: /dev/cciss/c0d0 Mount Points: /boot 101 MB OS Status: LOCKED Logical Drive Label: A000A241SOME SERIAL0ABC Mirror Group 0: physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK) physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK) physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 146 GB, OK) Mirror Group 1: physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 146 GB, OK) physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 146 GB, OK) physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 146 GB, OK) physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 146 GB, OK) physicaldrive 1I:1:1 Port: 1I Box: 1 Bay: 1 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1SVAA00009051H17G Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 1I:1:2 Port: 1I Box: 1 Bay: 2 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1SV9Y00009051K2C3 Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 1I:1:3 Port: 1I Box: 1 Bay: 3 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1RP4R00009051AHF9 Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 1I:1:4 Port: 1I Box: 1 Bay: 4 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1S8Y3000090462D2G Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 2I:1:5 Port: 2I Box: 1 Bay: 5 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1SXSC00009051JQNT Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 2I:1:6 Port: 2I Box: 1 Bay: 6 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1SYHC00009049MP37 Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 2I:1:7 Port: 2I Box: 1 Bay: 7 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1T7HD000090335RAR Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 2I:1:8 Port: 2I Box: 1 Bay: 8 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 15000 Firmware Revision: HPDE Serial Number: 3TB1SVN600009041KXNP Model: HP EH0146FAWJB PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown
Installing & Configuring DHCP on Red Hat Enterprise Linux
yum install dhcp -y cp /etc/dhcpd.conf /etc/dhcpd.conf.orig cat > /etc/dhcpd.conf << EOF ddns-update-style interim; ignore client-updates; allow booting; allow bootp; option option-128 code 128 = string; option option-129 code 129 = text; next-server TFTP.IP; filename "/pxelinux.0"; subnet IP.SUBNET netmask 255.255.255.0 { option routers GW.IP; #Default Gateway option subnet-mask 255.255.255.0; option domain-name "test.local"; option domain-name-servers DNS1; #option netbios-name-servers WINS1; range dynamic-bootp DHCP1 DHCP2; #DHCP Range to assign default-lease-time 43200; max-lease-time 86400; } EOF cp /etc/sysconfig/dhcpd /etc/sysconfig/dhcpd.orig cat > /etc/sysconfig/dhcpd << EOF DHCPDARGS=eth0 EOF service dhcpd restart chkconfig dhcpd on
Installing memcacehd for apache on red hat enterprise linux
yum install memcached.x86_64 php-pecl-memcached.x86_64 -y chkconfig memcached on service memcached start service httpd restart
Installing & Configuring NTP on Linux CentOS & RHEL
yum install ntp -y
mv /etc/ntp.conf /etc/ntp.conf.orig cat > /etc/ntp.conf << EOF restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 server 0.centos.pool.ntp.org server 1.centos.pool.ntp.org server 2.centos.pool.ntp.org fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift keys /etc/ntp/keys EOF chkconfig ntpd on service ntpd restart ntpq -p
Installing & Configuring PXEboot TFTP Server for Kickstart on RHEL or CentOS
- PXEboot TFTP Server
- Kickstart Server
yum install tftp-server xinetd -y
cat > /etc/xinetd.d/tftp << EOF service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } EOF cp /usr/lib/syslinux/pxelinux.0 /tftpboot/. chmod 644 /tftpboot/pxelinux.0 mkdir /tftpboot/pxelinux.cfg cat > /tftpboot/pxelinux.cfg/default << EOF default install prompt 1 display pxeboot.msg label install kernel vmlinuz append initrd=initrd.img label kickstart-server01 kernel vmlinuz append ksdevice=eth0 console=ttyS0,38400 console=tty0 load_ramdisk=1 initrd=initrd.img network ks=http://10.10.10.10/server01.cfg EOF cd /tftpboot wget http://mirrors.atlanticmetro.net/centos/5/os/i386/isolinux/vmlinuz wget http://mirrors.atlanticmetro.net/centos/5/os/i386/isolinux/initrd.img wget http://mirrors.atlanticmetro.net/centos/5/os/i386/isolinux/memtest wget http://mirrors.atlanticmetro.net/centos/5/os/i386/isolinux/boot.msg wget http://mirrors.atlanticmetro.net/centos/5/os/i386/isolinux/splash.lss mv boot.msg pxeboot.msg service xinetd restart
Issue with LDAP on RHEL or CentOS
If you bump into the following message on your box.
Checking configuration files for slapd: bdb_db_open: unclean shutdown detected; attempting recovery. bdb_db_open: Recovery skipped in read-only mode. Run manual recovery if errors are encountered.
Change the ownership of /var/lib/ldap/DB_CONFIG to be owned by the user ldap and group ldap, then restart ldap.
chown ldap:ldap /var/lib/ldap/DB_CONFIG service ldap restart
If you do have a issue with your database, you can try to repair it.
/usr/sbin/slapd_db_recover -v -h /var/lib/ldap
Installing & Configuring SNMP on RHEL or CentOS
The script below was used to install and configure SNMP on a RHEL or CentOS box to act as a SNMP agent. This is a minimal configuration which can be tweaked for more functionality. In summary, the script does the following:
- Install net-snmp
- Setup snmpd.conf (minimal) configuration file
- Enable net-snmp to startup upon bootup
- Startup net-snmp
yum install net-snmp -y cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig <br />
cat > /etc/snmp/snmpd.conf << EOF rocommunity public com2sec local localhost public com2sec network_1 172.16.0.0/24 public com2sec network_2 192.168.0.0/24 public group MyROGroup_1 v1 local group MyROGroup_1 v1 network_1 group MyROGroup_2 v2c network_2 view all-mibs included .1 80 access MyROGroup_1 "" v1 noauth exact all-mibs none none access MyROGroup_2 "" v2c noauth exact all-mibs none none EOF chkconfig snmpd on service snmpd restart
Installing & Configuring NTP on RHEL or CentOS
The script below was used to configure the RHEL or CentOS host to act as an NTP client to the CentOS NTP pool. In summary, the script below does the following:
- Install ntp
- Setup the ntp.conf configuration file
- Enable ntp to startup upon bootup
- Startup ntp
- Execute ntpq to verify the box is acting as a ntp client
yum install ntp -y cp /etc/ntp.conf /etc/ntp.conf.orig <br />
cat > /etc/ntp.conf << EOF restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 server 0.centos.pool.ntp.org server 1.centos.pool.ntp.org server 2.centos.pool.ntp.org fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift keys /etc/ntp/keys EOF chkconfig ntpd on service ntpd restart ntpq -p