Replace faulty disk in Solaris

[Please proceed with your own risk]

Here’s simple tutorials on how to replace faulty disk on solaris, in this example my customer using RAID 0 (don’t ask me why RAID 0, cause they using this RAID partition is for development only, but sometimes there are many comapnies using RAID 0 because it’s has a highest performance rather than RAID 1 and RAID 5 even with No data protection at all; One drive fails, all data is lost forever), ok enough for the fairy tale :>>, so here we go
-)Figure out which one is the faulty disk and which array affected,you can use these commands

#iostat -En
#metastat

-)umount mounted fs using umount command(you can refer to /etc/vfstab)
#umount /custimadb

-)turn off RAID0 array, in this example d0 is the RAID array, kindly note disks composition
#metaclear d0

-)release the faulty disk from os

#cfgadm -c unconfigure c6t11d0

-)replace faulty disk with the new one (do it carefully, it’s better to labeled all disks before do this step,if you are not too sure which disk is the fauly one, you can use format, select the disk and do a verification (target disk will blinking, but i warn you it’s too fast), and open your eyes, if you have many storages connected to one machine, ask your friends to helps you to keep their eyes on it :) )

-)force the Solaris to recognize new disk, you can either type

#cfgadm -C -c disk
or
#devfsadm -C

-)Recreate RAID0 array

#metainit d0 5 1 c6t11d0 c6t12d0 c6t13d0 c6t14d0 c6t15d0

-)Recreate fs on selected partition

#newfs /dev/md/rdsk/d0

-)Remount file system

#mount /custimadb

[Please proceed with your own risk]

 

Tags: , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Speed up shutdown time for windows 2003

Sometimes Windows servers seems take forever to shutdown escpecialyl the one with Active Directory or ISA or Exhange installed on it. I’ve known several people who’ve caused problems for themself by geting impatient and shutting off the server via the power button, rather than waiting for a graceful shutdown.

You can try this one :

-)Start Registry Editor. To do this, click Start, click Run, type regedit in the Open box, and then click OK.

-)Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
-)Double click on WaitToKillServiceTimeout

-)In the Value data box, type 120000, and then click OK. (in miliseconds)

-)Quit Registry Editor, and all you need to do is reboot the server

Credit to: http://support.microsoft.com/?kbid=827610

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Password are like underwear…

Password are like underwear..
Change yours often

Password are like underwear..
Don’t share them with friends

Password are like underwear..
The longer, the better

Password are like underwear..
Be mysterious

Password are like underwear..
Don’t leave yours lying around

Tags: ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

How to change mysql parameter without restart mysql?

Try these single and simple command from your mysql cli, to change mysql global parameter on the fly (it’s means no need to restart the service)

mysql> set global max_connections=400;

you can check the results using this command

mysql> show global variables;

always be reminded that parameter has been setup using above command will be not persist across restart, you need to put the parameter in /etc/my.cnf so the changes will persist across reboot.

Tags: , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

compex wlu54G [finally] on centos 5.2

i got that usb wifi adapter from my sis few months back, thanks sis :) , but i was figured it out how to make it works on my machine running centos 5.2, it’s working fine with windows based os Hmmmmm…from lsusb i got , it’s a

————————————————–
Bus 001 Device 002: ID 148f:2570 Ralink Technology, Corp. 802.11g WiFi
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x148f Ralink Technology, Corp.
idProduct 0×2570 802.11g WiFi
bcdDevice 0.01
iManufacturer 1 Ralink
iProduct 2 802.11g WLAN
iSerial 0
bNumConfigurations 1

—————————————————————————-
i knew that centos has rt2500usb module build in as module in the kernel itself and it’s loaded automatically when booting up, but the strange thing i cannot associate with any ap that is working fine with other wifi adapter, i thought there must be something wrong with the kernel, because i’m using a non usual kernel on my machine , it’s a “2.6.18-128.1.1.el5.028stab062.3PAE” , it’s a openvz kernel , but it was gave the same results when i boot up with standard kernel

wlan0: authentication with AP xx:xx:xx:xx:xx:xx timed out
and
something like cannot associate to the AP itself

had several times googling and here are the solutions, quite simple solutions in fact
-)download the new driver, looks like there are some incompatibility/bugs with the current driver,
drivers are downloadable through http://www.ralinktech.com/ralink/Home/Support/Linux.html
and compile it
-)prevents current driver being activated during booting, just simply put the module into /etc/modprobe.d/blacklist, it should be something like this
—————————————————————————-
blacklist rt2500usb
—————————————————————————-
-)#reboot
-)check the module whether the new module/driver brought up after rebooted
rt2570 163712 0
-)check if there any new interface appearing after executed ifconfig -a
—————————————————————————-

rausb0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
—————————————————————————-
wala!!!, all seems to be working perfectly , after it’s can associated with the AP , and got the ip address by using dhclient

Reference:

http://harusharris.blogspot.sg/2009/08/compex-wlu54g-finally-on-centos-52.html

Tags: ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Reboot your Linux Machine automatically after a kernel panic

Someday and somehow your Linux machine stuck and when you consoling that machine, there is kernel panic message appears on the screen, here’s little tips , by default the kernel will not reboot after a panic , but this option will cause a kernel reboot after ‘N’ seconds

Tools required:
-)Linux OS running on your Server/Computer/Notebook with root access
-)5 minutes of less

-)Open your /etc/sysctl.conf file
-)Add this line
kernel.panic = 10
-)Save your /etc/sysctl.conf file, you can either reboot your machine or execute this command to reload sysctl to your kernel
sysctl -p

Tags: , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Why we are still need backup regularly even we have RAID1 configured on our server ?

Why we are still need to do backup our system and data regularly even we have hardware RAID1 or RAID5 or whatever RAID level and RAID type configured on our server ?

While most RAID levels are designed to reduce the chance of data loss due to hardware failure, it is still possible to lose data on RAID arrays. Here are a few examples where RAID does not protect against data loss:

-)The drive controller in your system fails and writes random data to multiple disks in your RAID array, corrupting it.
-)The controller cache on your RAID controller fails and writes corrupted data to your disks.
-)The motherboard or RAM fails on your system and causes corrupted data to be written to your disks.
-)Multiple disk failures occur in your RAID array, rendering the array unrecoverable due to corrupted data and/or parity bits.
-)Physical damage to the computer occurs and renders the disks unusable.
-)The computer and its RAID array are stolen.
-)A user accidentally deletes files.

So what are you waiting for? start back up your valued data ,do not 100% depends on hardware RAID and software RAID anymore!
Cheers :)

Tags: , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Kernel panic an Virtuozzo4

On 10 Oct 2009, early morning , one of our server was not accessible while our monitoring system keeps altering us, looks like there was something gone wrong happening, yup i was right, called up DC guy and asked them to console in that server, they saw Kernel panic messages on console, yuck…., this server is used to hosts abaout 20 VPSes, hence because of this all off those VPS were also inaccessible , nothing we can do except do hard reboot, and asked DC guy to do so, and few minutes later, that server was back to reality from it’s deep coma, but when sshed to server, i found server’s load was about 20 , ALAMAK!!!!, “calm dawn …”, i tried to encouraging myself several times

i found that the software RAID that we are using on that server, was being resynchronizing between all disks in that RAID array, and it’ was very very super duper slow, it’s only about 4.5KB/Sec!!!! yuck… , and tried to bring up one of VPS hosted on that server, it was always gives me “cannot lock VE” , there was no other options , i need turned off automatic startup for that virtuozzo service when server booting up

#chkconfig –level 345 vz off

and initiated “shutdown -r now” , not worked, damn!!…. tried “shutdown -r -f -n now” also gave me that the server is shutting down, wait for 3 minutes…., 10 minutes…., 25 minutes…. yuck, enough .. called up data center and ask them to repeat hard reboot sequence , and after rebooted, sshed to server, check for RAID synchronization ,using more /proc/mdstat

———————————————————————————————————–

Personalities : [raid1]
md0 : active raid1 sdb2[1] sda2[0]
4192896 blocks [2/2] [UU]

md2 : active raid1 sdb3[1] sda3[0]
479998016 blocks [2/2] [UU]
[>....................] resync = 0.7% (3745728/479998016) finish=139.4min speed=56924K/sec

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

———————————————————————————————————–

Hmmmm… much much better….after RAID synchronization completed, bring up VZ service and all VPSes back up for serving their “Masters” fiuuuh….

unfortunately it was not solved the problem completely, some of customers that have access to VZ/Power Control Panel , complained that they had problem accessing Plesk Control Panel (8443), login successful but they were always got this error message,

“Plesk is not allowed”

quick investigations found that this only affected to customer that using Virtuozzo offline management, by turning this offline management off, there is no issue accessing Plesk Control Panel, but they will lose capability to reboot,shutdown VPS remotely from VZ/Power Control Panel, these are some step by step in how to rectify the issue,

check Vzagagent status and restart it

#vzagent_ctl status

the results should be similar like this

vzagent (pid 28742 21104 20602 12985 12980 11195 11071 10749 10571 10375 10374 9214 9213 9206 9205 9203 9201 9200 9199 9198 9189 9185 9184 9182 9181 9180 9179 9178 9177 9176 9175 9174 9173 9172 9171 9170 9169 9168 9167 9166 9165 9164 9163 9162 9161 9160 9159 9158 9156 9155 9154 9153 9152 9151 7146 2461) is running…

and try to restart it

#vzagent_ctl restart

and if this also does not solve the problem with offline management still active, just try to restart Service Container,

#vzctl restart 1

otherwise you need to reinstall Service Container (VE 1), fortunately in my case , no need to reinstall that Service Container :)

References:

http://forum.parallels.com/showthread.php?t=84022

http://kb.parallels.com/en/659

Tags: , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Installing PHP 5.x on Windows 2008, IIS7 and MsSQL extension

Installing PHP 5.x on Windows Server 2008 isn’t stragight forward just like click NEXT, and FINISH if you are using MSI installer, i need to figured out what’s wrong or what steps i’ve missed ,the problem what i was facing was PHP has been installed correctly BUT MsSQL extensions were not active at all, as you shou;d it in phpinfo page, well off course i can skip this just if customer doesn’t intends to use MsSQL , but infact it’s stated in my Job Order and aslso requested by customer himself, sigh…. , well i hope what i’m sharing here can help you out , i will try to guide you through the step by step, just feel free to add comment if i missed out the steps

-)Make Sure your Windows server 2008 is installed properly with IIS 7 and FastCGIModule ,before you proceed to the next step

-)Download PHP itself, it can be downloaded from php.net , last time i was downloaded and installed “php-5.2.12-nts-win32-installer” MSI installer version , select “FastCGI webserver”

-)Once installed, check and make sure extension directory is points to correct extension folder , when installed the php i was customized it, so it will install php into C:\PHP instead of C:\Program Files (x86)\PHP

-)From “Internet Information Server Manager” you need to add new handler mapping from “Add Module Mapping”

Request path : *.php
Module : FastCGIModule
Executable : c:\php\php-cgi.exe (adjust this if you use another folder)
Name : php (or whatsoever you want)

-)create phpinfo script and put it right inside the root directory of your website and test it out

You will not see any error message while accessing that phpinfo page, but you will not able to see any MsSQL module on it, but if you are lucky you will see it and no use and no points to read the next part after this coma(“,”) ,

but if you accessing that phpinfo page direclty from command line, you will see the error message , saying that “msvcr71.dll is missing” and ask you to reinstall the program, bla bla bla,, msvcr71.dll is one of Microsoft C runtime library and it’s propably bundled with Dot Net Framework 1.1, tried to get that missing file by installing Microsoft C++ 2008 Redistribute , but it wasn’t helps , or i was unlucky at that time? well just download that dll file directly from this URL, and put it inside C:\Windows\SysWOW64 , that’s it, MsSQL will shows up right after that :)

Reference:

http://www.dll-files.com/dllindex/dll-files.shtml?msvcr71

Tags: , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Drive Mapping in Windows 2008

Recently i need to find out on how to create drive mapping or drive alias on Windows 2008, the same result that you can get from ln command in linux or unix operating system. The reason why i need it as in my case there are 2 drives which is C and D , and currently all application are installed on D drive, but i need to change D to E drive since the scripts on previous server all points to E drive instead of D drive ,and just rename the drive is just not a good idea on windows.

There are some commands you can try like “net” and “subst” that can achieved the main goal

net use E: "\\computername\D$"
or
subst E: D:\

but the problem is all of the above will not retain during after server rebooted, although you can add “/PERSISTANT:YES” parameter on net command, the user might need to logon first before the drive mapping in place and this only works on that particular user only and not all users which is not what i wanted, so figured out and i use this one instead

-)open regedit
-)go to:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]
-)Create new “string value”
“E:”=”\\??\\D:\\”
-)Reboot

or create new text file called “subst.reg”

——————————–
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]
“E:”=”\\??\\D:\\”
———————————

And execute that reg file to add to Windows registry.

Tags: , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS