2009-06-26

How to change kernel from 32 to 64 bit on AIX

if your IBMserver is 64 bit but it run at 32 bit
it can mount filesystem max 1 TB
if you want to use filesystem larger than 1 TB you can change kernel to 64 bit
1. Ensure currently kernel is running as 32 bit.
# bootinfo -K
32

2. Run these commands. Require system reboot, so let customer stop all applications first.
# ln -sf /usr/lib/boot/unix_64 /unix
# ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
# bosboot -ad /dev/ipldevice (ipldevice is hdiskx which is the boot disk)
# bootlist -om normal (list bootdevice)
# bosboot -ad /dev/hdisk0 or /dev/hdisk1
# shutdown -Fr

3. After reboot, verify kernel run as 64 bit.
# bootinfo -K
64

If we want to change back kernel from 64 to 32 bit. Use all steps above, but change the commands at step2.
# ln -sf /usr/lib/boot/unix_mp /unix
# ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix
# bosboot -ad /dev/ipldevice (ipldevice is hdiskx which is the boot disk)
# shutdown -Fr

2009-06-25

How to disable users for SSH

you can disable root and deny some user for SSH by edit /etc/ssh/sshd_config

#vi /etc/ssh/sshd_config
....
PermitRootLogin no
....
DenyUsers oracle

-----------
and restart service
for solaris10
#svcadm restart ssh

or solaris9
#/etc/init.d/sshd restart

2009-06-22

How to setup trust server via ssh LINUX

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


Assume we have 2 servers name as "serv1 - 10.3.0.11" and "serv2 - 10.3.0.12"
we would like to remote ssh from serv1 to serv2 without password. so we need to
set trust serv1 on serv2. as the step ...

Assume 2: about username
serv1:KUSER1
serv2:ORACLE


1) on serv1 : login to user "KUSER1" and generate private and public key.
(kuser1)$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/kuser1/.ssh/id_dsa):
Created directory '/home/kuser1/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/kuser1/.ssh/id_dsa.
Your public key has been saved in /home/kuser1/.ssh/id_dsa.pub.
The key fingerprint is:
11:b3:08:5c:4a:3c:4a:f6:70:f0:ab:a7:21:c7:ca:3c kuser1@serv1
$

Note:
after run command. it 'll ask us for location of private and publich key.
default is $HOME/.ssh ( our home/.ssh ). and we'll get 2 files as
id_dsa = private key
id_dsa.pub = public key

2) copy public key to destination server "serv2" on user that you want to remote trust.
this example is "oracle" so login as user "oracle" then create directory .ssh

serv2[/home/oracle]$ mkdir .ssh
serv2[/home/oracle]$ cd .ssh
serv2[/home/oracle/.ssh]$ cat ../id_dsa.pub > authorized_keys
serv2[/home/oracle/.ssh]$ more authorized_keys
ssh-dss AAAAB3NzaC1kc3MAAACBAMjlIX6/UoFG9QioQsBg+DUTK+bu2tnusDkL+4uAVdRW+6pA5eBaOr2cTB4lkNYlQRTMz4+DXrBJm33VPl94CDvfkTIDQ2rw0+2gOHJx
rWikB4e7CCc9M3a6xZI4Zs/QcuCahN7mwuc+caSJiG/oNCCZlbZx8c5OYl0QlNq+B8SdAAAAFQCpaA/suX2jqo0BQnZTCN0wTO+K/wAAAIEAngAn2U+ZbzD2/Z1hfRj1Ms00
4ZV3wk+NyXzbkm39CFc97MuJOB6DPonQrO74nC07hpzvPSmLIOXu1+NHnNqd/sazaAdzWDTuNNodfGUTEbzo31RIrmc01q0UeTT2stRrW0xAboHSFxfUMbC21nrxjlFIBE81
rBTWtlSQr2kmkWkAAACAOQa9lILJYe/8Mk43SEODHJgWh3g5oa0EGKO7AZ34Otn/An2RbjkFLBo+ZDcvpvaaOTkICCXkjJt2Gstixn6uIPp0yBymr+523HSyaw1cIlEpV9qt
3bLqfosJ/UxsFuCu6SqsR6RGHG02dcwU0RAJ4bP8pnRKfZARoZnX5zYwVg8= kuser1@serv1

3) Test connect from serv1 user "kuser1"
(kuser1)$ ssh -l oracle serv2
serv2[/home/oracle]$


Note: if it return new promt as destination server without password require. it's OK.

2009-06-18

How to do show SerialNO. or model for linux server

for LINUX

#/usr/sbin/dmidecode | less
....
....
System Information
Manufacturer: HP
Product Name: ProLiant ML370 G4
Version: Not Specified
Serial Number: XXXXXXXXXX
UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Wake-up Type: Power Switch
Handle 0x0300, DMI type 3, 17 bytes.
Chassis Information
Manufacturer: HP
Type: Tower
Lock: Not Present
Version: Not Specified
Serial Number: XXXXXXXXXX

HOW to do MPXIO on your solaris 10


You can use command #stmsboot -e this command will be reboot you system but it not work in case your internal disk is fiber disk.
You can config by edit file

Before to config MPXIO you must get detial about hba card on your hosts
#cfgadm -alv
...
unavailable fc-private n /devices/pci@9,600000/SUNW,qlc@2/fp@0,0:fc
c1::500000e0155bc3d1 connected configured unknown FUJITSU MAX3147FCSUN146G
.....

c2 connected unconfigured unknown
unavailable fc-fabric n /devices/pci@8,600000/SUNW,qlc@1/fp@0,0:fc
c2::201400a0b8325c58 connected unconfigured unknown
unavailable disk n /devices/pci@8,600000/SUNW,qlc@1/fp@0,0:fc::201400a0b8325c58
...

c3 connected unconfigured unknown
unavailable fc-fabric n /devices/pci@8,600000/SUNW,qlc@2/fp@0,0:fc
c3::201500a0b8325c58 connected unconfigured unknown
unavailable disk n /devices/pci@8,600000/SUNW,qlc@2/fp@0,0:fc::201500a0b8325c58

this information is mean
c1 is a internal disk
c2 is disk from SAN
c3 is disk from SAN


next step edit file fp.conf remark in line mpxio-disable=? and config mpxio-disable on your hba card
#vi /kernel/drv/fp.conf
....
...
...
# mpxio-disable="no";
# mpxio-disable="yes";
....
....
name="fp" parent="/pci@8,600000/SUNW,qlc@1" port=0 mpxio-disable="no";
name="fp" parent="/pci@8,600000/SUNW,qlc@2" port=0 mpxio-disable="no";
..

save file and reboot

**************** ************

2009-06-17

How to do mirror on Solaris

How to do mirror OS on Solaris


Example Information:

Harddisk1 = Harddisk2
/ /dev/dsk/c1t0d0s0 size 30Gb
Swap /dev/dsk/c1t0d0s1 size 16GB #### about 2 x RAM size ####
Replica /dev/dsk/c1t0d0s7 size 30MB ### for save metadb

# prtvtoc /dev/rdsk/c1t0d0s2 fmthard -s - /dev/rdsk/c1t1d0s2
this command is copy layout Harddisk1 to Harddisk2


Step:
backup important file :
# cp /etc/system /etc/system.org
# cp /etc/vfstab /etc/vfstab.org

create metadb on replica
# metadb -a -c 3 -f c1t0d0s7 <-- the root disk
# metadb -a -c 3 -f c1t1d0s7 <-- rootmirror disk

create one way sub mirror for root disk
# metainit -f d10 1 1 c1t0d0s0 <-- the root partition

‘d10’ = sub mirror name

create raid 1 ( mirror )
# metainit d0 -m d10

‘d0’ = mirror name
‘d10’ = sub mirror name

edit /etc/vfstab and /etc/system by command.
# metaroot d0

If more file /etc/vfstab you’ll see.
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -

If more file /etc/system you’ll see.
forceload: misc/md_trans
forceload: misc/md_raid

forceload: misc/md_mirror
forceload: drv/pcisch
forceload: drv/qlc

rootdev:/pseudo/md@0:0,0,blk
* End MDD root info (do not edit)
Reboot
# init 6

After system boot up create another sub mirror
# metainit d20 1 1 c1t1d0s0

‘d20’ = sub mirror name

put new sub mirror into mirror
# metattach d0 d20

Put submirror ‘d20’ into mirror ‘d0’

Mirror for swap

Stop used swap.
# swap –l
swapfile dev swaplo blocks free
/dev/dsk/c1t0d0s1 85,1 16 16780208 16779760

# swap –d /dev/dsk/c1t0d0s1


create raid0 (concat) on swap for both disk
# metainit -f d11 1 1 c1t0d0s1
# metainit d21 1 1 c1t0d0s1

create raid1 (mirror) for swap
# metainit d1 –m d11
# metattach d1 d21

enable use swap
# swap –a /dev/md/dsk/d1


edit /etc/vfstab for automount next booting
/dev/md/dsk/d1 - - swap - no -

2009-06-16

how to config SC on SUN

or SunFire xxx can set sc by OS
#scadm show
#scadm usershow
#scadm userpassword admin
#scadm set if_connection ssh
#scadm set if_network true
#scadm set netsc_ipaddr 10.7.0.31
#scadm set netsc_ipgateway 10.7.0.1
#scadm show
#scadm resetrsc

=========for Sun Txxx (Ex. T2000,T5220)
cannot set by OS must connect serial port
sc> showsc
sc> setsc if_network true
sc> setsc if_connection ssh
sc> setsc netsc_ipaddr 10.7.0.175
sc> setsc netsc_ipgateway 10.7.0.1
sc> userpassword admin
sc> resetsc
can resetsc without reboot

how to show WWN on Solaris

########### on Solaris 10 ############
# fcinfo hba-port


################# or Solaris 9###################
#prtconf -vp grep -i wwn
# /usr/sbin/prtpicl -v -c scsi-fcp grep wwn

2009-06-15

How to NTP Client

=========== Configure ================
# vi /etc/inet/ntp.conf
server (IP of NTP Server) prefer
driftfile /var/ntp/ntp.drift

============ Start NTP Daemon =========
# /usr/lib/inet/xntpd
or
# svcadm -v enable svc:/network/ntp #######
========== Test ==============
# ntpq
ntpq> peers
remote refid st t when poll reach delay offset disp
===================================================
* (IP of NTP Server) 10.216.13.50 2 u 786 1024 377 5.97 1.607 3.45

how to IPMP one IP

for Solaris 10 u3 (11/06) or later
#cat  /etc/netmasks
192.168.109.0 255.255.255.0
#cat /etc/hosts
192.168.109.101 testsol10
#cat /etc/hostname.bge0
testsol10 netmask + broadcast + group ipmp0 up
#cat /etc/hostname.bge2
group ipmp0 up
..........