2017年7月12日星期三

HP Linux Raid info (Tested under Centos 6.9)

HP System Management 
https://h20566.www2.hpe.com/hpsc/swd/public/detail?swItemId=MTX_6c49e131b4dc46fd937a652120 
 
HP Array Controller Unit Command Line Interface HPACUCLI
http://h20564.www2.hpe.com/hpsc/swd/public/detail?swItemId=MTX_d6ebba0f5cd642edace4648b9a 
 
CLI  status show
hpacucli controller slot=0 physicaldrive all show
 
CLI monitoring script example: 

slot=0 means build in controller if you use additional raid then you need to update the controller slot number
#!/bin/bash
###
#If disk and RAID went wrong with HP raid controller this script will send an email 
###
MAIL=info@ljhk.com
HPACUCLI=`which hpacucli`
HPACUCLI_TMP=/tmp/hpacucli.log


  if [ `hpacucli controller slot=0 physicaldrive all show | grep '(Failed|Rebuilding)'| wc -l` -gt 0 ]
  then
   msg="HP RAID Controller Errors"
   #echo $msg
   #$msg2=`hpacucli controller slot=0 physicaldrive all show`
   logger -p syslog.error -t RAID "$msg"
   $HPACUCLI controller slot=0 physicaldrive all show > $HPACUCLI_TMP
   mail -s "$HOSTNAME [ERROR] - $msg" "$MAIL" < $HPACUCLI_TMP
   #rm -f $HPACUCLI_TMP
  #else
  #echo "Everything Good"
   fi

2017年5月9日星期二

Centos 7 install SSH , LAMP(replace mariadb with Mysql-server) & webmin

Install SSH

yum -y install openssh*

after installation complete. start the service

service sshd start


------------------------------------------------------------------------
Install LAMP

yum  -y  install  httpd  php  php-mysql  mariadb mariadb-server

Set MARIADB start when boot and start now

systemctl start mariadb
systemctl enable mariadb
Set Apache start when boot and start now

systemctl start httpd.service
systemctl enable httpd.service
After that , double check the firewall setting to make sure ports are opened correctly.

Edit use this command
vi /etc/sysconfig/iptables

After edit , please restart the service again
/etc/init.d/iptables restart

Double check the firewall status
/sbin/iptables -L -n

---------------------------------------------------------

Download Webmin & install (Remarks, please install & start all service for LAMP before install webmin)

wget http://prdownloads.sourceforge.net/webadmin/webmin-1.831-1.noarch.rpm

then install optional dependencies with :

yum -y install perl perl-Net-SSLeay openssl perl-IO-Tty

and then run the command :

rpm -U webmin-1.831-1.noarch.rpm

more details can be find at :
http://www.webmin.com/rpm.html

2017年3月8日星期三

BOOT Repair for Linux

Boot Ubuntu live CD

Start a terminal and 
 
To add boot-repair to the repository
sudo add-apt-repository ppa:yannubuntu/boot-repair

To Update your repository
sudo apt-get update

To install boot-repair
sudo apt-get install -y boot-repair
Once Installation complete run boot-repair on terminal by typing the following command.
boot-repair

2016年9月28日星期三

SME Linux 8 Backup terminated: pre-backup failed - status: 256

After workstation restore full system and all function and data normal but 
the workstation backup cannot run and have this message

Backup terminated: pre-backup failed - status: 256


The ldap may be down Please use the command below to fix.



sv d /service/ldap
rm -f /var/lib/ldap/__db.00{1,2,3,4,5,6} /var/lib/ldap/alock
rm -f /var/run/openldap/slapd.{pid,args}
sv u /service/ldap

Good luck!

2016年9月22日星期四

PresentationFontCache.exe uses 50%+ of the CPU

Delete all Font*.dat in C:\Windows\ServiceProfiles\LocalService\AppData\Local\  and reboot it.

Good Luck

2016年6月29日星期三

Read mutli session DVD Disc via linux



mount /dev/sr0 /media/dvd -o session=0

if you want to see the session try this command

cdrdao disk-info --device /dev/sr0

2016年5月28日星期六

how to change linux software raid md device name and lvm volume group name

     
 Sometimes you want to move a harddisk or a raid set to other linux machine. But you will find that the raid and lvm setting will have error. It prompt you that the md name and/or lvm name encounter problem due to same name.(normally it caused by the default installation.) You can change the md name and lvm name as below:


connect the old harddisk or raid set in a computer which is no other harddisk and  raid set.

--------------------------------------
change md name


start ubuntu live cd

apt-get install lvm2
if not yet installedin your ubuntu version

apt-get install mdadm
if not yet installedin your ubuntu version

Start with (assume your raid set is md127)

mdadm --detail /dev/md127

or if just only have incomplete raid set like one harddisk in raid 1.
(assume your harddisk partition is sda1)
mdadm --examine /dev/sda1

Version : 0.90

The first line or second line shows the metadata version used by this array. Now, stop the array:

mdadm --stop /dev/md127
mdadm --remove /dev/md127

And assemble it again using the new name. (metadata version is 1.0 or higher, use this:)

mdadm --assemble /dev/md3 /dev/sd[abcdefghijk]1 --update=name

For old metadata structure (most likely 0.90, as it allows for kernel auto-assembly), use this:

mdadm --assemble /dev/md3 --update=super-minor /dev/sd[abcdefghijk]1

-----------------------------------------
change vg name

boot linux rescue or ubuntu live cd/usb

in command prompt or terminal key in

lvm vgscan
lvm lvscan
lvm vgchange -a y
lvm pvscan
lvm lvscan

The last two commands should list your volume group(s) and logical volume(s). We use vgrename to change the name.

lvm vgrename VolGroup00 to-what-you-want-to-be