bagaimana cara mengubah hostid di Solaris
The Hostid is a globally unique ID for a Sun Solaris Machine. Sometimes, you need to change this hostid for whatever purpose. For example, you current machine is down for hardware failure and you purchased a new machine. However, all your current running software or License are based on this old hostid, and you must bring the new machine up within a very short time. The quick solution is to change the new machine’s hostid to be as same as the old one.
There are several ways to do so, including using a program to flush NVRAM which will change the hostid permanently. I did following experiment to change the Hostid in a Solaris 10 machine temperately. It adds several lines in the /etc/rc2.d/S20sysetup file. If you want to restore the original hostid, you just need to remove these lines and reboot the machine.
Example Change hostid from c93256a to 850168ae
No | Item | Hostid | Decimal | Hex Value | Remak |
1 | Host ID Original | c93256a | 210969962 | 32 31 30 39 36 39 39 36 32 | - |
2 | New Host ID | 850168ae | 2231462062 | 32 32 33 31 34 36 32 30 36 32 | - |
Step by step How to Change the Hostid of a Sun Oracle Solaris Machine?
Step 1: Convert Hostid 850168ae<hexdecimal format> to Decimal format <2231462062>
sample convert 850168ae<hexdecimal format> to 2231462062 <Decimal format >
Step 2: Convert Decimal format <2231462062> to Hex Value format <32 32 33 31 34 36 32 30 36 32>
sample convert 2231462062<Decimal format> to 32 32 33 31 34 36 32 30 36 32 <Hex Value format>
No | Hostid | Decimal | Hex Value | Pad Hex(12 Char String) |
1 | c93256a | 210969962 | 32 31 30 39 36 39 39 36 32 | 32 31 30 39 36 39 39 36 32 00 00 00 |
2 | 850168ae | 2231462062 | 32 32 33 31 34 36 32 30 36 32 | 32 32 33 31 34 36 32 30 36 32 00 00 |
Step 3: backup S20sysetup with #cp /etc/rc2.d/S20sysetup to /etc/rc2.d/S20sysetup.old
root@teguht #cd /etc/rc2.d
root@teguht #ls
K05appserv K16apache S10lu S42ncakmod S72autoinstall S89PRESERVE S98deallocate
K06mipagent K27boot.server S20sysetup S47pppd S73cachefs.daemon S90loc.ja.cssd hostid.org
K15imq README S40llc2 S70uucp S81dodatadm.udaplt S94ncalogd
root@teguht #cp S20sysetup S20sysetup.old
root@teguht #ls
K05appserv K16apache S10lu S40llc2 S70uucp S81dodatadm.udaplt S94ncalogd
K06mipagent K27boot.server S20sysetup S42ncakmod S72autoinstall S89PRESERVE S98deallocate
K15imq README S20sysetup.old S47pppd S73cachefs.daemon S90loc.ja.cssd hostid.org
root@teguht #
Step 4: Change the /etc/rc2.d/S20sysetup file & save
At the bottom of this file, add following code:
# Change hostid to 850168ae
# Convert to decimal value = 2231462062
# Use HEXADECIMAL to BINARY conversion, HEX to Decimal converter, Hexdecimal convertor for heavy lifting
#
# Convert decimal value to ASCII chars = 32 32 33 31 34 36 32 30 36 32
# Use above web site for this too
#
# Pad ASCII char string to twelve values using zeros
# Result 32 32 33 31 34 36 32 30 36 32 00 00
# If string is only ten chars pad with "00 0" to make eleven
#
# Set the hostid to 807a6e94 - Let's do it!!
echo "hw_serial/v 32 32 33 31 34 36 32 30 36 32 00 00" | mdb -kw
# That's it! Success
# don't forget to always visit http://fakta-dan-unik.blogspot.com/search/label/Solaris
# Testing by Teguh Triharto
== Before add code ==
root@teguht #cat S20sysetup
#!/sbin/sh
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)sysetup 1.27 06/06/05 SMI"
if [ -z "$_INIT_PREV_LEVEL" ]; then
set -- `/usr/bin/who -r`
_INIT_PREV_LEVEL="$9"
fi
[ $_INIT_PREV_LEVEL != S -a $_INIT_PREV_LEVEL != 1 ] && exit 0
# Uncomment this line to print the complete system configuration on startup
#[ -x /usr/sbin/prtconf ] && /usr/sbin/prtconf
# If there are trademark files, print them.
[ -d /etc/tm ] && /usr/bin/cat /etc/tm/* 2>/dev/null
#
# Run rctladm to configure system resource controls based on the settings
# previously saved by rctladm. See rctladm(1m) for instructions on how to
# modify resource control settings.
#
if [ -f /etc/rctladm.conf ] && [ -x /usr/sbin/rctladm ]; then
/usr/sbin/rctladm -u
fi
root@teguht #
== After add code ==
root@teguht #cat S20sysetup
#!/sbin/sh
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)sysetup 1.27 06/06/05 SMI"
if [ -z "$_INIT_PREV_LEVEL" ]; then
set -- `/usr/bin/who -r`
_INIT_PREV_LEVEL="$9"
fi
[ $_INIT_PREV_LEVEL != S -a $_INIT_PREV_LEVEL != 1 ] && exit 0
# Uncomment this line to print the complete system configuration on startup
#[ -x /usr/sbin/prtconf ] && /usr/sbin/prtconf
# If there are trademark files, print them.
[ -d /etc/tm ] && /usr/bin/cat /etc/tm/* 2>/dev/null
#
# Run rctladm to configure system resource controls based on the settings
# previously saved by rctladm. See rctladm(1m) for instructions on how to
# modify resource control settings.
#
if [ -f /etc/rctladm.conf ] && [ -x /usr/sbin/rctladm ]; then
/usr/sbin/rctladm -u
fi
# Change hostid to 850168ae
# Convert to decimal value = 2231462062
# Use HEXADECIMAL to BINARY conversion, HEX to Decimal converter, Hexdecimal convertor for heavy lifting
#
# Convert decimal value to ASCII chars = 32 32 33 31 34 36 32 30 36 32
# Use above web site for this too
#
# Pad ASCII char string to twelve values using zeros
# Result 32 32 33 31 34 36 32 30 36 32 00 00
# If string is only ten chars pad with "00 0" to make eleven
#
# Set the hostid to 807a6e94 - Let's do it!!
echo "hw_serial/v 32 32 33 31 34 36 32 30 36 32 00 00" | mdb -kw
# That's it! Success
# don't forget to always visit http://fakta-dan-unik.blogspot.com/search/label/Solaris
# Testing by Teguh Triharto
root@teguht #
Step 5 : Check Hostid before change (# Showrev)
root@teguht #showrev
Hostname: teguht
Hostid: c93256a
Release: 5.10
Kernel architecture: i86pc
Application architecture: i386
Hardware provider:
Domain:
Kernel version: SunOS 5.10 Generic_147441-01
root@teguht #hostid
0c93256a
root@teguht #
Step 6: Run #sh S20sysetup or ./S20sysetup or reboot Machine (# shutdown -i6 -g0 -y)
root@teguht #./S20sysetup
hw_serial: 0x32 = 0x32
hw_serial+1: 0x31 = 0x32
hw_serial+2: 0x30 = 0x33
hw_serial+3: 0x39 = 0x31
hw_serial+4: 0x36 = 0x34
hw_serial+5: 0x39 = 0x36
hw_serial+6: 0x39 = 0x32
hw_serial+7: 0x36 = 0x30
hw_serial+8: 0x32 = 0x36
hw_serial+9: 0 = 0x32
hw_serial+0xa: 0 = 0x0
initcls: 0x54 = 0x0
root@teguht #
Step 7 : Check Hostid after change (# Showrev)
root@teguht #showrev
Hostname: teguht
Hostid: 850168ae
Release: 5.10
Kernel architecture: i86pc
Application architecture: i386
Hardware provider:
Domain:
Kernel version: SunOS 5.10 Generic_147441-01
root@teguht #hostid
850168ae
.::: Step by step How to Rollback and Change the Hostid Original of a Sun Oracle Solaris Machine? :::.
Step 1 : Copy /etc/rc2.d/S20sysetup.old to /etc/rc2.d/S20sysetup
root@teguht #cd /etc/rc2.d
root@teguht #ls
K05appserv K16apache S10lu S40llc2 S70uucp S81dodatadm.udaplt S94ncalogd
K06mipagent K27boot.server S20sysetup S42ncakmod S72autoinstall S89PRESERVE S98deallocate
K15imq README S20sysetup.old S47pppd S73cachefs.daemon S90loc.ja.cssd hostid.org
root@teguht #cp S20sysetup.old S20sysetup
root@teguht #ls
K05appserv K16apache S10lu S40llc2 S70uucp S81dodatadm.udaplt S94ncalogd
K06mipagent K27boot.server S20sysetup S42ncakmod S72autoinstall S89PRESERVE S98deallocate
K15imq README S20sysetup.old S47pppd S73cachefs.daemon S90loc.ja.cssd hostid.org
root@teguht #
Step 2 : Check script original
root@teguht #cat S20sysetup
#!/sbin/sh
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)sysetup 1.27 06/06/05 SMI"
if [ -z "$_INIT_PREV_LEVEL" ]; then
set -- `/usr/bin/who -r`
_INIT_PREV_LEVEL="$9"
fi
[ $_INIT_PREV_LEVEL != S -a $_INIT_PREV_LEVEL != 1 ] && exit 0
# Uncomment this line to print the complete system configuration on startup
#[ -x /usr/sbin/prtconf ] && /usr/sbin/prtconf
# If there are trademark files, print them.
[ -d /etc/tm ] && /usr/bin/cat /etc/tm/* 2>/dev/null
#
# Run rctladm to configure system resource controls based on the settings
# previously saved by rctladm. See rctladm(1m) for instructions on how to
# modify resource control settings.
#
if [ -f /etc/rctladm.conf ] && [ -x /usr/sbin/rctladm ]; then
/usr/sbin/rctladm -u
fi
root@teguht #
Step 3 :Reboot Machine (# shutdown -i6 -g0 -y)
root@teguht #shutdown -i6 -g0 -y
Shutdown started. Tue Jul 3 13:21:15 WIT 2012
Changing to init state 6 - please wait
Broadcast Message from root (pts/2) on teguht Tue Jul 3 13:21:16...
THE SYSTEM teguht IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged
Cannot send to device dtremote because it's not a tty
pretty good writeup
ReplyDeleteTeguh Triharto Learning Center: :: How To Change The Hostid In Solaris :::. >>>>> Download Now
ReplyDelete>>>>> Download Full
Teguh Triharto Learning Center: :: How To Change The Hostid In Solaris :::. >>>>> Download LINK
>>>>> Download Now
Teguh Triharto Learning Center: :: How To Change The Hostid In Solaris :::. >>>>> Download Full
>>>>> Download LINK