2015年12月1日星期二

Centos software raid boot problem most likely on second and other disk.

boot into rescue mode via usb or centos install cd.

chroot /mnt/sysimage
   
 # grub
grub> find /grub/stage1
 (hd0,0)
 (hd1,0)
 (hd2,0)
grub> device (hd0) /dev/sda
grub> root (hd0,0)
grub> setup (hd0)
grub> device (hd0) /dev/sdb
grub> root (hd0,0)
grub> setup (hd0)
grub> device (hd0) /dev/sdc
grub> root (hd0,0)
grub> setup (hd0)
grub> quit


then reboot.




2015年4月9日星期四

Check smart status on HP Smart Array CCISS in Centos


Turn on smart enable

cciss,0 is disk 0
smartctl -s on --device=cciss,0 /dev/cciss/c0d0
smartctl -s on --device=cciss,1 /dev/cciss/c0d0
smartctl -s on --device=cciss,2 /dev/cciss/c0d0

To view smart status
cciss,0 is disk 0
smartctl --all --device=cciss,0 /dev/cciss/c0d0

info source
http://www.smartmontools.org/wiki/Supported_RAID-Controllers

2015年4月3日星期五

Centos Secure Remote Desktop Setting

Install Desktop & VNC Server

# yum -y groupinstall Desktop 

# yum -y install tigervnc-server

Log in to your Centos server (via SSH) as the user you want to use to access VNC.

# cd ~/ 

# vncpasswd 

setup the VNC Connection Password. It is different from the user password.

Edit /etc/sysconfig/vncservers

# vi /etc/sysconfig/vncservers

Edit or Add this two lines

VNCSERVERS="2:yourvncuser" 
VNCSERVERARGS[2]="-geometry 1024x768 -localhost"


    2 — This indicates the port used for the VNC connection. Only the last digit is entered. For example, 1 defines port 5901. 9 indicates use of port 5909.

    1024x768 — This sets the size that VNC renders your desktop. You can change it as you need.


    -localhost — This option limits VNC to allow only local connections. This setting makes the VNC connection more secure when used in conjunction with an SSH tunnel. 


Start the VNC Server Service

# service vncserver start 

# chkconfig vncserver on 


Use SSH to establish a secure tunnel:

Open PuTTY, select the saved session, and then click Load.

In the Category , from Connection click SSH, and then Tunnels. 



Type and enter the following, and click Add:

    Source port — Type 590, plus the port you specified in the VNC configuration file. Because we used port 2 in that example, then we enter 5902.

    Destination — Type localhost:590, plus the port you specified in the VNC configuration file. Because we used port 2 in this example, we would enter 5902.

In the Category section, go to Session.

In the Saved Sessions field, type VNC Tunnel(or your server vnc tunnel as you like), and then click Save.


Use VNC Client to connect the server.

  • Open the PuTTY, select the Centos Server saved session, click Load, and then log in to your server. This opens the SSH Tunnel that you configured before.
  • Open your preferred VNC Client, type localhost:590[n] (where [n] is the port you specified in the VNC configuration file, and then press Enter. In this case is localhost:5902


  • Then it will ask your vnc connection password. After you key in the correct password then you can see this similar screen.


    That's All. Enjoy!

    2015年4月2日星期四

    yum not yet finished

    Sometimes yum not yet finihed some transaction.

    Then you need to use this command to complete them first.

    yum-complete-transaction

    after some download and install. you can yum again!

    Add Desktop mode for Centos minimal installation

    Install Desktop Packages

    # yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"


    You can install the following optional GUI packages.

    # yum -y groupinstall "Graphical Administration Tools"

    # yum -y groupinstall "Internet Browser"

    # yum -y groupinstall "General Purpose Desktop"

    # yum -y groupinstall "Office Suite and Productivity"

    # yum -y groupinstall "Graphics Creation Tools"

    If you want terminal emulator in X windows then you need to install this.

    # yum -y groupinstall "Legacy X Window System compatibility"
    
    
    After that you need to edit the file 
    
    
    /etc/inittab
    
    
    Change id:3:initdefault: to id:5:initdefault:
    
    
    After complete the editing then reboot.
    
    
    Shutdown -r now
    
    
    
    
    *Remarks 
    
    
    If you find downloading the package encounter problem, you can try this
    
    
    yum --enablerepo=updates clean metadata
    
    
    and start again
    
    
    
    
    You can enjoy the Desktop / CLI mode.

    GUI to CLI: Ctrl + Alt + F6 CLI to GUI: Ctrl + Alt + F1

    
    
    
    

    2015年4月1日星期三

    Centos Linux software raid problems reminder

    Linux Software raid is a good arrangement for data protection against harddisk failure.

    But , install Software Raid is not easy expect you use some lazy admin Linux like SME Linux http://wiki.contribs.org.

    Some reminder for you & me are below:

    Boot procedure after power on.

    1. You need to confirm EFI function enabled or not or your server must use it or not.
    If yes , something like high end server, you must create a EFI Boot Partition. If no, you can boot server up.

    2. Some Server use hardware RAID Card. You cannot remove the card and connect the harddisk to system. So, if you still want to use software raid because some reason. You can try to config the RAID CARD that all single harddisk be a RAID 0 array. After that , Linux will see the harddisk as a single harddisk and not a array of group harddisk. Then you can install them with Linux Software Raid.

    3. I use Centos 6.5 to install server. Sometimes cannot boot up after installation. I find that the Grub don't like the hardware RAID. So , we need to boot into rescue mode and chroot /mnt/sysimage.
    Then , uncomment the lines in /etc/grub.conf.

    boot=/dev/cciss/c0d0

    Make sure /boot/grub/device.map is correct and something like that
    (hd0)         /dev/cciss/c0d0
    (hd1)         /dev/cciss/c0d1

    Then run Grub

    /sbin/grub --batch --device-map=/boot/grub/device.map --config-file=/boot/grub/grub.conf --no-floppy
    grub> root (hd0,0)
    grub> setup (hd0)
    grub> root (hd1,0)
    grub> setup (hd1)
    grub> quit

    After that , reboot and should be enjoy!

    or some of them can use this to make it boot -------------------------------------

    boot rescue mode
    chroot /mnt/sysimage
    grub-install /dev/md0




    ----------------------------------------------------------------------
    Sample for Software Raid Partition but use HP P400i hardware raid controller.




    Mount point
    /dev/md0 as /boot
    LogVol01 as /

    If their EFI Boot partittion
    /dev/sda1 as /boot/EFI

    /dev/sda1 which is the partition you created for EFI boot setting.
    But also need to copy this partition on the second harddisk as
    /dev/sdb1.



    Centos 6.5 network not startup after installation & then install SSH,LAMP and webmin

    After startup Centos with root, key in

    setup 

    to start the setup utility

    User the network setting to key in all the network info your server required and save it.

    After that, edit /etc/sysconfig/network-scripts/ifcfg-eth0.

    Find ONBOOT="no"

    Change it into ONBOOT="yes"

    If you user network manager then chkconfig NetworkManager on or
    you use old network service then chkconfig network on

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

    Install SSH

    yum -y install openssh*

    after installation complete. start the service

    service sshd start


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

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

    Set MYSQL start when boot and start now

    chkconfig mysqld on
    /etc/init.d/mysqld start

    Set Apache start when boot and start now

    chkconfig httpd on
    /etc/init.d/httpd start

    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




    SME Server 9.0 Sysmon Installation

    The installation for sysmon on the web of SME Linux is not updated.

    Please try this step that I can install Sysmon on SME9.0

    Sysmon is needed the gettext. So install it.

    yum install gettext --enablerepo=sme8contribs,smecontribs

    Fping is also a needed things. So get and install it.

    wget http://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/fping-3.1-1.el5.rf.i386.rpm

    rpm -Uvh fping-3.1-1.el5.rf.i386.rpm

    The last procedure is download sysmon and install.

    wget http://sme-mirror.firewall-services.com/releases/8/smecontribs/i386/RPMS/smeserver-sysmon-6.2-
    2.el5.sme.noarch.rpm

    rpm -Uvh smeserver-sysmon-6.2-2.el5.sme.noarch.rpm

    After installation, please update the SME 9.0 system via server manager/software installer and reboot.
    If not update, I find that the sysmon cannot draw the graph correctly.

    Please try & enjoy.

    You can use this text include all command

    yum install gettext --enablerepo=sme8contribs,smecontribs
    wget http://rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/fping-3.1-1.el5.rf.i386.rpm
    rpm -Uvh fping-3.1-1.el5.rf.i386.rpm
    wget http://sme-mirror.firewall-services.com/releases/8/smecontribs/i386/RPMS/smeserver-sysmon-6.2-2.el5.sme.noarch.rpm
    rpm -Uvh smeserver-sysmon-6.2-2.el5.sme.noarch.rpm



    2015年3月10日星期二

    win7 cannot login after create a new user.(domain or local) with error. The user profile service failed to logon. User profile cannot be loaded

    The user profile service failed to logon. User profile cannot be loaded.

    You can check this method provided by microsoft.

    http://support.microsoft.com/kb/947215


    But if you find that. You create a new account (local/domain) without problem but cannot login with the error "The user profile service failed to logon. User profile cannot be loaded." Then you can try to check that on C drive.

    C:/User/"User name" exist or not.

    If no, then you need to check the default user folder rights is correct or not.

    It must be read by everyone. If no , then new OS find you login a new user. It will copy the items in the C:/User/default user and C:/User/default. But rights is not correct then the OS can not create the new user directories and information. After that, it cannot load the profile because it had not been copied or created.

    get the ownership by admin user.
    add access right on the folder for everyone group can read.
    restat pc and login with new user id.

    It should work at least for me. ^_^