<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hacktopia &#187; Solaris 10</title>
	<atom:link href="http://www.hacktopia.net/wp/category/solaris-10/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hacktopia.net/wp</link>
	<description>The zen of hacking</description>
	<lastBuildDate>Tue, 15 Jun 2010 17:40:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to mirror ZFS root disk on a sparc system.</title>
		<link>http://www.hacktopia.net/wp/how-to-mirror-zfs-root-disk-on-a-sparc-system/</link>
		<comments>http://www.hacktopia.net/wp/how-to-mirror-zfs-root-disk-on-a-sparc-system/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:43:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[Solaris Sparc]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=121</guid>
		<description><![CDATA[First we look to see that everything looks good on our current drive that we are booted off of.  I would also like to note that there is no UFS on this system at all.  We are booting entirely off of the ZFS pool rpool. # zpool status pool: rpool state: ONLINE scrub: none requested [...]]]></description>
			<content:encoded><![CDATA[<p>First we look to see that everything looks good on our current drive that we are booted off of.  I would also like to note that there is no UFS on this system at all.  We are booting entirely off of the ZFS pool rpool.</p>
<blockquote><p># zpool status<br />
pool: rpool<br />
state: ONLINE<br />
scrub: none requested<br />
config:</p>
<p>NAME        STATE     READ WRITE CKSUM<br />
rpool       ONLINE       0     0     0<br />
c0t0d0s0  ONLINE       0     0     0</p>
<p>errors: No known data errors</p></blockquote>
<p>Now verify that the two disks that you want to mirror looks the same at the slave level.</p>
<blockquote><p># format<br />
Searching for disks&#8230;done</p>
<p>AVAILABLE DISK SELECTIONS:<br />
0. c0t0d0 &lt;ST320011A cyl 38790 alt 2 hd 16 sec 63&gt;<br />
/pci@1f,0/ide@d/dad@0,0<br />
1. c0t2d0 &lt;DEFAULT cyl 38790 alt 2 hd 16 sec 63&gt;<br />
/pci@1f,0/ide@d/dad@2,0<br />
Specify disk (enter its number): 0<br />
selecting c0t0d0<br />
[disk formatted, no defect list found]<br />
/dev/dsk/c0t0d0s0 is part of active ZFS pool rpool. Please see zpool(1M).<br />
/dev/dsk/c0t0d0s2 is part of active ZFS pool rpool. Please see zpool(1M).</p>
<p>FORMAT MENU:<br />
disk       &#8211; select a disk<br />
type       &#8211; select (define) a disk type<br />
partition  &#8211; select (define) a partition table<br />
current    &#8211; describe the current disk<br />
format     &#8211; format and analyze the disk<br />
repair     &#8211; repair a defective sector<br />
show       &#8211; translate a disk address<br />
label      &#8211; write label to the disk<br />
analyze    &#8211; surface analysis<br />
defect     &#8211; defect list management<br />
backup     &#8211; search for backup labels<br />
verify     &#8211; read and display labels<br />
save       &#8211; save new disk/partition definitions<br />
volname    &#8211; set 8-character volume name<br />
!&lt;cmd&gt;     &#8211; execute &lt;cmd&gt;, then return<br />
quit<br />
format&gt; ver</p>
<p>Primary label contents:</p>
<p>Volume name = &lt;        &gt;<br />
ascii name  = &lt;ST320011A cyl 38790 alt 2 hd 16 sec 63&gt;<br />
pcyl        = 38792<br />
ncyl        = 38790<br />
acyl        =    2<br />
nhead       =   16<br />
nsect       =   63<br />
Part      Tag    Flag     Cylinders         Size            Blocks<br />
0       root    wm       0 &#8211; 38789       18.64GB    (38790/0/0) 39100320<br />
1 unassigned    wm       0                0         (0/0/0)            0<br />
2     backup    wm       0 &#8211; 38789       18.64GB    (38790/0/0) 39100320<br />
3 unassigned    wm       0                0         (0/0/0)            0<br />
4 unassigned    wm       0                0         (0/0/0)            0<br />
5 unassigned    wm       0                0         (0/0/0)            0<br />
6 unassigned    wm       0                0         (0/0/0)            0<br />
7 unassigned    wm       0                0         (0/0/0)            0</p>
<p>format&gt; disk 1<br />
selecting c0t2d0<br />
[disk formatted, no defect list found]<br />
format&gt;</p></blockquote>
<p>Notice that both disks have 0 &#8211; 38789 Cylinders.  So the disks look good, now we can attach the second disk.</p>
<blockquote><p># zpool attach rpool c0t0d0s0 c0t2d0s0<br />
#<br />
# zpool status<br />
pool: rpool<br />
state: ONLINE<br />
status: One or more devices is currently being resilvered.  The pool will<br />
continue to function, possibly in a degraded state.<br />
action: Wait for the resilver to complete.<br />
scrub: resilver in progress for 0h0m, 3.28% done, 0h24m to go<br />
config:</p>
<p>NAME          STATE     READ WRITE CKSUM<br />
rpool         ONLINE       0     0     0<br />
mirror      ONLINE       0     0     0<br />
c0t0d0s0  ONLINE       0     0     0<br />
c0t2d0s0  ONLINE       0     0     0</p>
<p>errors: No known data errors</p></blockquote>
<p>WoW that was easy to mirror two disks with ZFS.  No need to set up data stores or anything like that.  The fact that the zpool status output specify &#8220;mirror&#8221; means the disks are mirrored and not striped.  If you have multiple zfs pools you can specify zpool status POOLNAME.</p>
<p>Now to try to distroy the disk, ha, ha, ha!</p>
<blockquote><p># dd if=/dev/random of=/dev/rdsk/c0t2d0s0<br />
969+0 records in<br />
969+0 records out</p></blockquote>
<p>Now if that disk was on a normal RAID utility stuch as solstice disk suite SDS or even hardware raid then both disks would be destroyed because they operate at the block level, and will copy the random blocks back do c0t0d0s0</p>
<blockquote><p># zpool status<br />
pool: rpool<br />
state: DEGRADED<br />
status: One or more devices could not be opened.  Sufficient replicas exist for<br />
the pool to continue functioning in a degraded state.<br />
action: Attach the missing device and online it using &#8216;zpool online&#8217;.<br />
see: http://www.sun.com/msg/ZFS-8000-2Q<br />
scrub: resilver in progress for 0h1m, 10.52% done, 0h12m to go<br />
config:</p>
<p>NAME          STATE     READ WRITE CKSUM<br />
rpool         DEGRADED     0     0     0<br />
mirror      DEGRADED     0     0     0<br />
c0t0d0s0  ONLINE       0     0     0<br />
c0t2d0s0  UNAVAIL      0     0     0  cannot open</p>
<p>errors: No known data errors</p></blockquote>
<p>Oha happy ZFS is already working on fixing or resilvering the disk that was written to with random data.</p>
<blockquote><p># zpool status<br />
pool: rpool<br />
state: DEGRADED<br />
status: One or more devices could not be opened.  Sufficient replicas exist for<br />
the pool to continue functioning in a degraded state.<br />
action: Attach the missing device and online it using &#8216;zpool online&#8217;.<br />
see: http://www.sun.com/msg/ZFS-8000-2Q<br />
scrub: resilver completed after 0h0m with 0 errors on Tue Apr 14 12:55:48 2009<br />
config:</p>
<p>NAME          STATE     READ WRITE CKSUM<br />
rpool         DEGRADED     0     0     0<br />
mirror      DEGRADED     0     0     0<br />
c0t0d0s0  ONLINE       0     0     0<br />
c0t2d0s0  UNAVAIL      0     0     0  cannot open</p>
<p>errors: No known data errors</p></blockquote>
<p>Now ZFS is angry because we wrote random data to the disk.</p>
<blockquote><p># zpool online  rpool  c0t2d0s0</p>
<p># installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t2d0s0</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/how-to-mirror-zfs-root-disk-on-a-sparc-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable snmp on Solaris 10</title>
		<link>http://www.hacktopia.net/wp/enable-snmp-on-solaris-10-2/</link>
		<comments>http://www.hacktopia.net/wp/enable-snmp-on-solaris-10-2/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 17:44:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=153</guid>
		<description><![CDATA[So I had some trouble gettin snmp working. I edited /etc/snmp/conf/snmpd.conf with the proper trap and community for my enviroment.  Every time I tried to start snmp I would get erros. checking /var/adm/messages Nov  6 10:09:29 pressman2 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] can&#8217;t read the directory snmpd.conf [errno: Not a directory(20)] me trying to start snmp [...]]]></description>
			<content:encoded><![CDATA[<p>So I had some trouble gettin snmp working.  I edited /etc/snmp/conf/snmpd.conf with the proper trap and community for my enviroment.  Every time I tried to start snmp I would get erros.</p>
<p>checking /var/adm/messages</p>
<blockquote><p>Nov  6 10:09:29 pressman2 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] can&#8217;t read the directory snmpd.conf [errno: Not a directory(20)]</p></blockquote>
<p>me trying to start snmp</p>
<blockquote><p>bash-3.00# svcadm enable svc:/application/management/snmpdx:default</p>
<p>bash-3.00# svcs|grep snmp<br />
offline        10:03:20 svc:/application/management/snmpdx:default</p></blockquote>
<p>On the second line you can see that I check and it was not started or offline.  So then it was time to consult with svcs -x.  That stated that I was missing a prerequisite process that snmp relied on.</p>
<blockquote><p>bash-3.00# svcs -x<br />
svc:/application/management/seaport:default (net-snmp SNMP daemon)<br />
State: disabled since Wed Oct 28 16:25:27 2009<br />
Reason: Disabled by an administrator.<br />
See: http://sun.com/msg/SMF-8000-05<br />
See: snmpd(1M)<br />
Impact: 1 dependent service is not running.  (Use -v for list.)</p></blockquote>
<blockquote><p>bash-3.00# svcs |grep snmp<br />
online         11:25:54 svc:/application/management/snmpdx:default</p></blockquote>
<p>Now everything works like it should.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/enable-snmp-on-solaris-10-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ssh: Connection closed by remote host</title>
		<link>http://www.hacktopia.net/wp/ssh-connection-closed-by-remote-host/</link>
		<comments>http://www.hacktopia.net/wp/ssh-connection-closed-by-remote-host/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 15:42:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=137</guid>
		<description><![CDATA[I was trying to ssh from one Sun Soalris server to another. # ssh  remoteserver ssh_exchange_identification: Connection closed by remote host # ssh -v remoteserver Sun_SSH_1.1.1, SSH protocols 1.5/2.0, OpenSSL 0x0090704f debug1: Reading configuration data /etc/ssh/ssh_config debug1: Rhosts Authentication disabled, originating port will not be trusted. debug1: ssh_connect: needpriv 0 debug1: Connecting to mimi [10.20.55.222] [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to ssh from one Sun Soalris server to another.</p>
<blockquote><p># ssh  remoteserver<br />
ssh_exchange_identification: Connection closed by remote host<br />
# ssh -v remoteserver<br />
Sun_SSH_1.1.1, SSH protocols 1.5/2.0, OpenSSL 0x0090704f<br />
debug1: Reading configuration data /etc/ssh/ssh_config<br />
debug1: Rhosts Authentication disabled, originating port will not be trusted.<br />
debug1: ssh_connect: needpriv 0<br />
debug1: Connecting to mimi [10.20.55.222] port 22.<br />
debug1: Connection established.<br />
debug1: identity file /.ssh/identity type -1<br />
debug1: identity file /.ssh/id_rsa type -1<br />
debug1: identity file /.ssh/id_dsa type -1<br />
ssh_exchange_identification: Connection closed by remote host<br />
debug1: Calling cleanup 0x34ae8(0&#215;0)<br />
#</p></blockquote>
<p>Err it would not let me connect.  As you can see I first tried to ssh, then ssh in verbose mode.  As you can see the output did not really give anything that useful.</p>
<p>I logged into the remote server and all it would tell me is</p>
<blockquote><p>Jul  7 11:37:53 remoteserver sshd[21761]: refused connect from clientserver</p></blockquote>
<p>I wold have to be connected to the serial console to see this message, I was not able to see the message anywhere else.  Not in /var/adm/messages or /var/log/syslog</p>
<p>So what I ended up doing was adding this line to /etc/hosts.allow</p>
<blockquote><p>p_ctminetd,sshd,bpcd,vnetd,vopied,bpjava-msvc: 10.20.55. : allow</p></blockquote>
<p>That line allowed any host in the 10.20.55.* subnet to connect to the server now, and ssh was allowed to connect.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/ssh-connection-closed-by-remote-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable snmp on solaris 10</title>
		<link>http://www.hacktopia.net/wp/enable-snmp-on-solaris-10/</link>
		<comments>http://www.hacktopia.net/wp/enable-snmp-on-solaris-10/#comments</comments>
		<pubDate>Tue, 26 May 2009 16:12:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=131</guid>
		<description><![CDATA[In order to start up snmp on solaris then you need to configure /etc/snmp/conf/snmpd.conf and start it up using smf svcadm enable /application/management/sma]]></description>
			<content:encoded><![CDATA[<p>In order to start up snmp on solaris then you need to configure</p>
<blockquote><p>/etc/snmp/conf/snmpd.conf</p></blockquote>
<p>and start it up using smf</p>
<blockquote><p>svcadm enable /application/management/sma</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/enable-snmp-on-solaris-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPMP Link-based Only Failure Detection with Solaris 10</title>
		<link>http://www.hacktopia.net/wp/ipmp-link-based-only-failure-detection-with-solaris-10/</link>
		<comments>http://www.hacktopia.net/wp/ipmp-link-based-only-failure-detection-with-solaris-10/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 14:51:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris 10]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=102</guid>
		<description><![CDATA[I have done a fair bit of research on this topic.  While most sites will show you how to set up fail over on solris 10 with multiple ip, and probe-based failure detection.  Those two things can cause problems.  First off, most often ip space is at a premium and you want to be able [...]]]></description>
			<content:encoded><![CDATA[<p>I have done a fair bit of research on this topic.  While most sites will show you how to set up fail over on solris 10 with multiple ip, and probe-based failure detection.  Those two things can cause problems.  First off, most often ip space is at a premium and you want to be able to use as few a ip as possible.  So using one ip instead of three is highly appreciated.  Second having to do probe-based failure detection aka pinging the router or another host on the subnet can cause problems if you have many hosts in a data center set up in a similar fashion.  While mpathd can ping a host besides the router, the default behavior is for mpathd to contently be pinging the router making sure it is still there, and if it ceases to be there any more then it will fail over.  This can be as often as once a second.  Also multiple subnets can be served by the same router multiplying the affects.  Router&#8217;s cpu are not very fast, while they might be fast at routing, this is because the routing is accomplished through the hardware, which is carried out through a diffrent CPU.</p>
<p>Just to state the obvious, this is best designed for up time of service, not for aggregate speed because it is a master slave set up not master master set up.  You want to make sure that your two interfaces are in different cards if at all possible and connected to two separate network switches.</p>
<p>Lets start with the config file.</p>
<blockquote><p># cat /etc/default/mpathd<br />
#<br />
#pragma ident   &#8220;@(#)mpathd.dfl 1.2     00/07/17 SMI&#8221;<br />
#<br />
# Time taken by mpathd to detect a NIC failure in ms. The minimum time<br />
# that can be specified is 100 ms.<br />
#<br />
#FAILURE_DETECTION_TIME=2500<br />
FAILURE_DETECTION_TIME=10000<br />
#<br />
# Failback is enabled by default. To disable failback turn off this option<br />
#<br />
FAILBACK=yes<br />
#<br />
# By default only interfaces configured as part of multipathing groups<br />
# are tracked. Turn off this option to track all network interfaces<br />
# on the system<br />
#<br />
TRACK_INTERFACES_ONLY_WITH_GROUPS=yes</p></blockquote>
<p>It is pretty self explanatory with the comments that are present.  It is really nice because the only other changes that have to be made are to the /etc/hostname.ce* files.</p>
<blockquote><p>bash-3.00# cat /etc/hostname.ce0<br />
10.36.133.113 netmask + broadcast + group mainint up<br />
bash-3.00# cat /etc/hostname.ce4<br />
group mainint up</p></blockquote>
<p>if will look like the fowling</p>
<blockquote><p># ifconfig -a<br />
lo0: flags=2001000849&lt;UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL&gt; mtu 8232 index 1<br />
inet 127.0.0.1 netmask ff000000<br />
ce0: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 8<br />
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255<br />
groupname mainint<br />
ether 0:14:4f:d6:f7:b8<br />
ce4: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 9<br />
inet 10.36.133.113 netmask ffffff00 broadcast 10.36.133.255<br />
groupname mainint<br />
ether 0:14:4f:4a:d5:a3</p></blockquote>
<p>You can also fail over the interface by hand by issusing the /usr/sbin/if_mpadm command.</p>
<blockquote><p>bash-3.00# /usr/sbin/if_mpadm  -d ce0<br />
Feb 13 14:47:31 server in.mpathd[185]: Successfully failed over from NIC ce0 to NIC ce4</p></blockquote>
<blockquote><p>bash-3.00# ifconfig -a<br />
lo0: flags=2001000849&lt;UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL&gt; mtu 8232 index 1<br />
inet 127.0.0.1 netmask ff000000<br />
ce0: flags=89000842&lt;BROADCAST,RUNNING,MULTICAST,IPv4,NOFAILOVER,OFFLINE&gt; mtu 0 index 8<br />
inet 0.0.0.0 netmask 0<br />
groupname mainint<br />
ether 0:14:4f:d6:f7:b8<br />
ce4: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 9<br />
inet 10.36.133.113 netmask ffffff00 broadcast 10.36.133.255<br />
groupname mainint<br />
ether 0:14:4f:4a:d5:a3<br />
ce4:1: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 9<br />
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255</p></blockquote>
<p>If you ever want to make any changes, like switch which interface is primary, then it could be helpful to Wittie a quick script to help you out.  Don&#8217;t forget to make it executable by issuing the command chmod u+x script</p>
<blockquote><p>#!/usr/bin/bash<br />
ifconfig=/usr/sbin/ifconfig</p>
<p>$ifconfig ce0 unplumb<br />
$ifconfig ce4 unplumb</p></blockquote>
<p>Make sure that you have unique unique MAC address on the server.  If you do not have unique MAC address it can confuse the switch.</p>
<p>to check that a unique mac is set you can &#8220;ifconfig -a&#8221; and look at the MAC addres or</p>
<blockquote><p>﻿﻿bash-3.00# eeprom |grep mac<br />
local-mac-address?=true</p></blockquote>
<p>If it comes back false then you can fix it by issusing the fowling command</p>
<blockquote><p><code>eeprom "local-mac-address?"=true</code></p></blockquote>
<p>Some useful inks with further reading.</p>
<p>You might have to be logged into sun solve for the first link to work.<br />
<a href="http://sunsolve.sun.com/search/document.do?assetkey=1-61-228885-1">http://sunsolve.sun.com/search/document.do?assetkey=1-61-228885-1</a><br />
<a href="http://docs.sun.com/app/docs/doc/816-0211/6m6nc66s8?a=view">http://docs.sun.com/app/docs/doc/816-0211/6m6nc66s8?a=view</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/ipmp-link-based-only-failure-detection-with-solaris-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
