2016年3月14日星期一

Centos Network Bonding (NIC Teaming Up)

yum install ethtool -y

-----------------------------------------------
Create a new bond NIC called bond0 (192.168.0.100 is the bonding IP)

gedit /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
ONBOOT=yes
DNS1=8.8.8.8
IPADDR=192.168.0.100
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
USERCTL=no
BOOTPROTO=none
NM_CONTROLLED=no

-----------------------------------------------
gedit /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=AA:A8:2A:20:05:C7
NM_CONTROLLED=no
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=none


-----------------------------------------------
gedit /etc/sysconfig/network-scripts/ifcfg-eth1


DEVICE=eth1
HWADDR=AA:A8:2A:20:05:C8
NM_CONTROLLED=no
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

-----------------------------------------------
gedit /etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2
HWADDR=AA:A8:2A:20:05:C9
NM_CONTROLLED=no
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=none



-----------------------------------------------
gedit /etc/sysconfig/network-scripts/ifcfg-eth3

DEVICE=eth3
HWADDR=AA:A8:2A:20:05:CA
NM_CONTROLLED=no
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=none


-----------------------------------------------
gedit /etc/modprobe.d/bonding.conf

alias bond0 bonding
options bond0 mode=1 miimon=100 downdelay=200 updelay=200
-----------------------------------------------



-----------------------------------------------
modprobe bonding

service network restart
-----------------------------------------------



--------------------------------------------------------------- Finished--------------------------------------

check the Bonding status use the command below:

cat /proc/net/bonding/bond0

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

2016年3月3日星期四

Open mdadm & lvm2 via Ubuntu live CD or USB

Start the Ubuntu CD or USB

open terminal

command as below


sudo apt-get install lvm2
sudo apt-get install mdadm
mdadm --assemble --scan

Then use DISK apps to access or mount the raid & LVM.

enjoy!

2016年1月23日星期六

force update windows time with batch file

Create the batch files in startup as below:

@ping time.windows.com -n 1 -w 36000 > nul
w32tm /config /manualpeerlist:"time.windows.com" /syncfromflags:manual /reliable:yes /update
W32tm /resync /force


-------------------------------------
It will try to check time.windows.com(or ntp you want) and your network is up and running then force to update the windows time with time.windows.com.

2016年1月18日星期一

Failed Raid 1 device & wants to readd again(assume the harddisk is status normal)

Raid Status but make sure both harddisk are normal and without bad sector.

[root@server ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda2[0] sdb2[2](F)
      156183808 blocks [2/1] [U_]

md1 : active raid1 sda1[0] sdb1[1]
      104320 blocks [2/2] [UU]

unused devices:

************************************************
if you want to fail the device by command, use this
[root@server ~]#  mdadm /dev/md2 --fail /dev/sdb2
************************************************

* User command to remove the failed device.

[root@server ~]#  mdadm /dev/md2 --remove /dev/sdb2


[root@server ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda2[0]
      156183808 blocks [2/1] [U_]

md1 : active raid1 sda1[0] sdb1[1]
      104320 blocks [2/2] [UU]

unused devices:

[root@server ~]# mdadm /dev/md2 --add /dev/sdb2
mdadm: hot added /dev/sdb2
[root@server ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sdb2[2] sda2[0]
      156183808 blocks [2/1] [U_]
      [>....................]  recovery =  0.1% (185024/156183808) finish=28.0min speed=92512K/sec
md1 : active raid1 sda1[0] sdb1[1]
      104320 blocks [2/2] [UU]

unused devices:


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