
<?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>tek-ops &#187; Projects</title>
	<atom:link href="http://www.tek-ops.com/archives/category/projects/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tek-ops.com</link>
	<description></description>
	<lastBuildDate>Tue, 03 Nov 2009 02:20:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Enterprise iSCSI storage with OpenSolaris and COMSTAR</title>
		<link>http://www.tek-ops.com/archives/350</link>
		<comments>http://www.tek-ops.com/archives/350#comments</comments>
		<pubDate>Wed, 28 Oct 2009 23:11:36 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=350</guid>
		<description><![CDATA[
The goal of this project is to build enterprise-grade iSCSI storage that is modular enough to meet any iSCSI needs.
I chose OpenSolaris for the flexibility we get from ZFS, which everyone has at least heard of, but also for its Common SCSI Target (COMSTAR) project.   I&#8217;ll only be discussing the iSCSI target portion of this [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--></p>
<p>The goal of this project is to build enterprise-grade iSCSI storage that is modular enough to meet any iSCSI needs.</p>
<p>I chose OpenSolaris for the flexibility we get from ZFS, which everyone has at least heard of, but also for its Common SCSI Target (<a href="http://hub.opensolaris.org/bin/view/Project+comstar/">COMSTAR</a>) project.   I&#8217;ll only be discussing the iSCSI target portion of this project, but I recommend reading more on the capabilities of COMSTAR outside of the iSCSI space.</p>
<p><strong>HARDWARE</strong></p>
<p>Since we talking about building our own storage array, lets look at some hardware options.  My personal preference for a chassis is the Supermicro <a href="http://www.supermicro.com/products/chassis/4U/?chs=846">SC846</a> for the redundant power, an option for two internal disks so that you can use all 24 hot-swap for just storage, and the ability to use 3.5&#8243; and 2.5&#8243; drives.</p>
<p>If you prefer only go for 2.5&#8243; drives you might want to check out <a href="http://www.supermicro.com/products/chassis/2U/?chs=216">SC216</a> which will also provide 24 disks, but in only 2 Rack Units of space.</p>
<p>The next important decision is the HBA(s) you will be using.  Keep in mind that since we&#8217;ll be using ZFS for this project, we do not want a RAID card, but instead a JBOD card.  Trust me on this on, RAID cards can turn out to be a nightmare, plus JBOD HBA&#8217;s are cheaper.  My personal preference in HBA for OpenSolaris is the <a href="http://lsi.com/storage_home/products_home/host_bus_adapters/sas_hbas/internal/sas3081e-r/index.html">LSI 3081</a> card for the Fusion-MPT chip.  You don&#8217;t have to buy LSI brand, but I definitely recommend an HBA with Fusion-MPT.  Since these provide 8 SATA ports, you&#8217;ll need 3 of them to support 24 disks.</p>
<p>The last major hardware decision is networking.  My preference for 1GB is a NIC with the <a href="http://www.intel.com/design/network/products/lan/controllers/82571eb.htm">82571EB</a> chip.  Intel offers a single port card, the <a href="http://www.intel.com/network/connectivity/products/pro1000mt_server_adapter.htm">Intel PRO/1000 MT</a>, and a dual-port version, the <a href="http://www.intel.com/Products/Server/Adapters/PRO1000PT-DualPort/PRO1000PT-DualPort-overview.htm">Intel PRO/1000 PT</a>.</p>
<p>For 10GB I recommend a NIC with the <a href="http://ark.intel.com/Product.aspx?id=36918">82598EB</a> chip.  For a dual-port CX-4 version I use the <a href="http://www.intel.com/Products/Server/Adapters/10-GbE-CX4-DualPort/10-GbE-CX4-DualPort-overview.htm">EXPX9502CX4</a> card or if you prefer dual port SR fiber go with the <a href="http://www.intel.com/products/server/adapters/10-gbe-xfsr-adapters/10-gbe-xfsr-adapters-overview.htm">EXPX9502AFXSR</a> card.</p>
<p>Just to be clear, all of the hardware recommendation I have made I currently use with OpenSolaris servers and are confirmed by Sun to be supported in OpenSolaris.</p>
<p><strong>CONFIGURATION</strong></p>
<p>Let&#8217;s start with a fresh install of <a href="http://www.opensolaris.com/get/index.jsp">OpenSolaris</a>.</p>
<p><span style="text-decoration: underline;">Mirror OS disk</span></p>
<p>First, lets mirror our OS disk for added reliability.  In this example, OpenSolaris was install on disk c9d0s0.  Our second OS disk is c10d0s0.</p>
<p>1. Create a solaris disk label on the second disk</p>
<pre># format c10d0s0</pre>
<p>Select &#8220;fdisk&#8221; then &#8220;create 100% Standard Solaris Partition over the full Disk&#8221;</p>
<p>2. Next, we need to copy the Solaris slice layout from the OS disk to the second disk. (note we use s2, this is very important)</p>
<pre># prtvtoc /dev/rdsk/c9d0s2 | fmthard -s - /dev/rdsk/c10d0s2</pre>
<p>3. Next, we&#8217;ll attach the mirror disk to the OS zpool</p>
<pre>#  zpool attach -f rpool c9d0s0 c10d0s0</pre>
<p>4. Last, we need to make the second disk bootable</p>
<pre># installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c10d0s0</pre>
<p><span style="text-decoration: underline;">Static IP</span><br />
If you don&#8217;t want to rely on always getting the same DHCP IP, you&#8217;ll probably want to statically configure the IP of your storage server.</p>
<p>First, we need to disable the NetworkAutomagic service</p>
<pre># svcadm disable network/physical:nwam</pre>
<p>Next, enable the config file-based networking service</p>
<pre># svcadm enable network/physical:default</pre>
<p>Now we must configure the IP statically.  This is done by creating a /etc/hostname. file.  In this example I&#8217;ll use the e1000g0 interface.</p>
<pre> vi /etc/hostname.e1000g0
192.168.1.200</pre>
<p>Configure the netmask for the management IP</p>
<pre># vi /etc/netmasks
192.168.1.0 255.255.255.0</pre>
<p>Configure the default gateway</p>
<pre># vi /etc/defaultrouter
192.168.1.1</pre>
<p>Tell system to use standard file-based DNS</p>
<pre># cp /etc/nsswitch.dns /etc/nsswitch.conf</pre>
<p>Now, Configure DNS servers</p>
<pre># vi /etc/resolv.conf
nameserver 192.168.1.4</pre>
<p><span style="text-decoration: underline;">Configure IP Multi-Pathing (IPMP)</span><br />
If you went with a dual-port card, or two cards, it&#8217;s advisable to use IPMP so that a single link down doesn&#8217;t make your iSCSI volumes unaccessible.</p>
<p>In this example I&#8217;m using two e1000g interfaces and creating the IPMP interface iscsi0.</p>
<pre># vi /etc/hostname.iscsi0
ipmp group san0 192.168.1.200 up</pre>
<p>The primary interface of the IPMP group is e1000g0</p>
<pre># vi /etc/hostname.e1000g0
group san0 -failover up</pre>
<p>The backup interface is e1000g1</p>
<pre># vi /etc/hostname.e1000g1
group san0 -failover standby up</pre>
<p><span style="text-decoration: underline;">Enable COMSTAR</span><br />
Install stmf (library and service for COMSTAR)</p>
<pre># pkg install SUNWstmf</pre>
<p>Now install the  iSCSI toolset</p>
<pre># pkg install SUNWiscsit</pre>
<p>At this point, reboot your machine before continuing on.</p>
<p>After rebooting, we will enable the stmf service</p>
<pre># svcadm enable stmf</pre>
<p><span style="text-decoration: underline;">Creating your zpool</span><br />
I went with a chassis that supports up to 24 disks to build in room for expansion.  Based on you needs, you can fill all 24 hot-swap trays with raw storage to be exported as one or more iSCSI volumes, or you can use some to take advantage of some of the performance advantages of creating a hybrid pool.  </p>
<p>If you are unfamiliar with the term hybrid pool, I suggest reading up on ZIL and L2ARC.  Here are a few links to get you started:<br />
ZIL: <a href="http://blogs.sun.com/perrin/entry/slog_blog_or_blogging_on">SLOG BLOG</a><br />
L2ARC: <a href="http://blogs.sun.com/brendan/entry/test">ZFS L2ARC</a></p>
<p>So for purposes of this example, I&#8217;ll presume to save four drive bays for SSDs, a pair for ZIL and a pair for L2ARC, leaving 20 disks.  We can then use these 20 drive slots for 4 RAIDZ of 5 disks.  I&#8217;m going to start with configuring one, then I&#8217;ll explain how to grow your ZPOOL when adding your second RAIDZ for storage expansion.</p>
<p>Before we go any further, now is a good time to demonstrate two useful commands.  The first, we can use devfsadm to scan for newly added disks.</p>
<pre>
# devfsadm -Cv
</pre>
<p>Second, we can use the format command to list all recognized disks.</p>
<pre>
# format < /dev/null
</pre>
<p>For the first 5 storage disks, mine were recognized on channel 7.  I'll create my initial zpool named "iSCSIdisks" as a RAIDZ using all 5 disks.</p>
<pre>
# zpool create iSCSIdisks raidz c7t0d0 c7t1d0 c7t2d0 c7t3d0 c7t4d0
</pre>
<p>There we go, we now have our storage to start creating iSCSI volumes.  I'm going to now create a 20GB zvol (target volume) that will be used as the disk for a virtual machine.  </p>
<pre>
# zfs create -V 20G iSCSIdisks/vm1_hdd
</pre>
<p>Next, I need to make a LUN (Logical Unit) out of this volume.</p>
<pre>
# sbdadm create-lu /dev/zvol/rdsk/iSCSIdisks/vm1_hdd
</pre>
<p>Now that we have create a logical unit, we need to find out the GUID of this volume so that we can provide it to COMSTAR for iSCSI access.  Here's how you list all LUNs that have been created.</p>
<pre>
# sbdadm list-lu
</pre>
<p>Now, if you don't already have the iscsit server enabled, now would be a good time to do so.</p>
<pre>
# svcadm enable -r svc:/network/iscsi/target:default
</pre>
<p>I'm going to create a basic iSCSI target configuration here that leaves this storage wide-open to be accessed by anyone, I suggest you secure yours.  To do so, read up on itadm in the <a href="http://docs.sun.com/app/docs/doc/819-2240/itadm-1m?a=view">man page</a>.</p>
<pre>
# itadm create-target
</pre>
<p>You can now see your newly created iSCSI target, and all previously created ones, using the itadm command.</p>
<pre>
# itadm list-target
</pre>
<p>You're all set to access this storage remotely.</p>
<p>The last thing I want to come back to is how we will grow our underlying storage as we need to expand.  Following the previous example of a 5 disk RAIDZ, I'll just add a second 5 disk RAIDZ to the zpool iSCSIdisks.  </p>
<p>Since I have 3 LSI HBAs, each with 8 ports, my next 5 disks will consume the last 3 ports of my first HBA and the first 2 ports of my second one.  I plug in the 5 new disks, run "devfsadm -Cv" then run "format < /dev/null" to ensure they have been recognized.  Now I'm ready to add them.</p>
<pre>
# zpool add iSCSIdisks raidz c7t5d0 c7t6d0 c7t7d0 c8t0d0 c8t1d0
</pre>
<p>And that&#8217;s it, your zpool is now grown and ready to be sliced up into more iSCSI targets. </p>
<p>Enjoy your new enterprise iSCSI array, and don&#8217;t for get to check out ZIL and L2ARC!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/350/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebVirt status update</title>
		<link>http://www.tek-ops.com/archives/270</link>
		<comments>http://www.tek-ops.com/archives/270#comments</comments>
		<pubDate>Tue, 24 Feb 2009 04:08:07 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[open-source linux]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=270</guid>
		<description><![CDATA[As you can probably guess, I&#8217;ve been rather busy.
WebVirt has become a very exciting project, so I&#8217;ve been spending almost all of my computing time coding.  I have posted some screenshots but I have to admit that they&#8217;re already a bit dated with some of the new features I&#8217;ve implemented.
Current WebVirt can connect to [...]]]></description>
			<content:encoded><![CDATA[<p>As you can probably guess, I&#8217;ve been rather busy.</p>
<p><a href="https://fedorahosted.org/webvirt/">WebVirt</a> has become a very exciting project, so I&#8217;ve been spending almost all of my computing time coding.  I have posted some <a href="https://fedorahosted.org/webvirt/wiki/Screenshots">screenshots</a> but I have to admit that they&#8217;re already a bit dated with some of the new features I&#8217;ve implemented.</p>
<p>Current WebVirt can connect to remote libvirt nodes, however only with zero authentication.  What this mean is that you&#8217;re limited to using a connection string like this:</p>
<pre>qemu+tcp://192.168.1.2/?name=qemu:///session</pre>
<p>That being said, I&#8217;m planning on using the Redhat package <a href="https://fedoraproject.org/wiki/Features/PythonNSS">python-nss</a> for key creation and management.  So that should follow &#8220;hopefully&#8221; shortly.</p>
<p>Once connected, you can start and destroy (stop) both virtual networks and domains that are currently defined on a remote physical node.  I should point out that there is still a bug in libvirt that &#8220;may&#8221; undefine a network on the remote machine when you destroy it.  Undefining is removing the config from the remote node.  This does not effect domains, however.</p>
<p>You can also push network and domain configurations created in WebVirt to your remote nodes.</p>
<p>You can toggle whether or not each virtual domain and network is to autostart.  This means that when the libvirt daemon is started/restarted on the remote node, these virtuals domains and networks will automatically start.</p>
<p>Lastly, importing previously defined virtual domains and networks from remote nodes.  The elaborate on this feature, let&#8217;s say you&#8217;re like me.  You&#8217;re so excited about libvirt, that you&#8217;re already using it to manage virtual domains and networks, and you just can&#8217;t wait for a full release of WebVirt.</p>
<p>Fear not!  Currently WebVirt can only import the very basic virtual networks and the import of virtuals domains is all but a place holder (only the name and UUID are read as a proof of concept as up CVS check-in 14), this feature is of utmost importance to the project and will be fully implemented in time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/270/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebVirt now at FedoraHosted</title>
		<link>http://www.tek-ops.com/archives/268</link>
		<comments>http://www.tek-ops.com/archives/268#comments</comments>
		<pubDate>Mon, 26 Jan 2009 16:53:07 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=268</guid>
		<description><![CDATA[WebVirt is the project I started after my recent obsession with Libvirt.  Two weekends worth of work and it&#8217;s already talking to remote libvirt boxes; if only polling capabilities, defined networks and defined domains.  
Since the architecture of the project has been laid out.  I determined it was time to allow a [...]]]></description>
			<content:encoded><![CDATA[<p>WebVirt is the project I started after my recent obsession with Libvirt.  Two weekends worth of work and it&#8217;s already talking to remote libvirt boxes; if only polling capabilities, defined networks and defined domains.  </p>
<p>Since the architecture of the project has been laid out.  I determined it was time to allow a little more attention than my website can provide.</p>
<p>Since I&#8217;ve been developing it on Fedora and intend on using it with Fedora, RHEL, and CentOS, I went with FedoraHosted.</p>
<p>Go check out the project Trac page: <a href="http://www.fedorahosted.org/webvirt">fedorahosted.org/webvirt</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/268/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Libvirt kinda caught my attention</title>
		<link>http://www.tek-ops.com/archives/258</link>
		<comments>http://www.tek-ops.com/archives/258#comments</comments>
		<pubDate>Mon, 19 Jan 2009 04:14:38 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=258</guid>
		<description><![CDATA[I&#8217;ve been working a lot with running virtual machines on Linux recently.  An inevitable stop was to the libvirt project.
I started playing with creating xml configs for creating new domains, networks and storage.  I had been planning on 1. learning pythong and 2. playing with django, so this jointly inspired me to start [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working a lot with running virtual machines on Linux recently.  An inevitable stop was to the <a href="http://libvirt.org">libvirt</a> project.</p>
<p>I started playing with creating xml configs for creating new domains, networks and storage.  I had been planning on 1. learning pythong and 2. playing with django, so this jointly inspired me to start <a href="http://www.tek-ops.com/webvirt">WebVirt</a>, a web-based front-end to libvirt for managing virtual machines.  </p>
<p>I spent this weekend completing my first two goals, coding basic xml generation for libvirt resources, GPLing and creating the repo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/258/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building home OpenBSD router &#8211; Part 6</title>
		<link>http://www.tek-ops.com/archives/228</link>
		<comments>http://www.tek-ops.com/archives/228#comments</comments>
		<pubDate>Sun, 07 Dec 2008 01:07:57 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=228</guid>
		<description><![CDATA[Start at Part 1
The Multi Router Traffic Grapher (MRTG)
Reference: Tobi Oetiker&#8217;s MRTG &#8211; The Multi Router Traffic Grapher

To borrow a phrase from Tobi Oetiker, &#8220;You have a router, you want to know what it does all day long? Then MRTG is for you.&#8221;  The goal here is to track the actions of the OpenBSD [...]]]></description>
			<content:encoded><![CDATA[<p>Start at <a href="/archives/30">Part 1</a></p>
<h1>The Multi Router Traffic Grapher (MRTG)</h1>
<p><small>Reference: <a href="http://oss.oetiker.ch/mrtg/">Tobi Oetiker&#8217;s MRTG &#8211; The Multi Router Traffic Grapher</a></small></p>
<p><!--adsense--></p>
<p>To borrow a phrase from Tobi Oetiker, &#8220;You have a router, you want to know what it does all day long? Then MRTG is for you.&#8221;  The goal here is to track the actions of the OpenBSD router over time.  This practice is important for detecting trends in traffic, helpful for finding bottlenecks, and even identify a baseline to recognize abnormal changes in traffic.</p>
<p>So let&#8217;s get on with it.  For this example, I use OpenBSD&#8217;s MRTG package.  I&#8217;ll also install two packages required for IPv6, OpenBSD MRTG package requires them:</p>
<pre>mschenck ~# sudo pkg_add http://mirror.rit.edu/pub/OpenBSD/4.3/packages/i386/mrtg-2.15.2p1.tgz
mschenck ~# sudo pkg_add http://mirror.rit.edu/pub/OpenBSD/4.3/packages/i386/p5-Socket6-0.19.tgz
mschenck ~# sudo pkg_add http://mirror.rit.edu/pub/OpenBSD/4.3/packages/i386/p5-IO-INET6-2.01p0.tgz</pre>
<p>I should point out that you need an snmp daemon running for MRTG to pole stats from your router.  The enable this first you must add the following to &#8220;/etc/rc.conf.local&#8221;:</p>
<pre>snmpd_flags=""          # for normal use: ""</pre>
<p>This will enable snmpd to automatically start on reboot.  In the meantime, lets start it ourself</p>
<pre>mschenck ~#  sudo  /usr/sbin/snmpd</pre>
<p>By default, OpenBSD&#8217;s snmp daemon (<a href="http://www.openbsd.org/cgi-bin/man.cgi?query=snmpd&amp;apropos=0&amp;sektion=0&amp;manpath=OpenBSD+4.3&amp;arch=i386&amp;format=html" target="_blank">snmpd(8)</a>) only listens on <em>localhost</em> and the default community string is &#8220;<em>public</em>&#8220;.  You can change these settings by modifying &#8221; /etc/snmpd.conf&#8221; (see <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=snmpd.conf&amp;sektion=5&amp;arch=i386&amp;apropos=0&amp;manpath=OpenBSD+4.3" target="_blank">snmpd.conf(5)</a>), however for this example we&#8217;ll stick with these default settings.</p>
<p>Now lets get an http daemon running to display these graphs.  OpenBSD come with Apache, lets enable and start it up.  Add the following line to /etc/rc.conf.local:</p>
<pre>httpd_flags=""          # for normal use: "" (or "-DSSL" after reading ssl(8))</pre>
<p>Again, lets avoid the reboot and just start the daemon manually:</p>
<pre>mschenck ~# sudo /usr/sbin/httpd</pre>
<p>Now, lets backup to original document root for apache and create a new one for displaying our mrtg graphs:</p>
<pre>mschenck ~# sudo mv /var/www/htdocs /var/www/htdocs-orig
mschenck ~# sudo mkdir -p /var/www/htdocs/cfg</pre>
<p>So now that we have MRTG and, the perl modules it requires, and an snmp daemon running and an http daemon up to display our graphs; we&#8217;re ready to start configuring.</p>
<pre>mschenck ~# sudo cfgmaker --global 'WorkDir: /var/www/htdocs'  \
          --global 'Options[_]: bits,growright' \
          --output /var/www/htdocs/cfg/mrtg.cfg    \
           public@localhost</pre>
<p>Now lets schedule the polling of our NICs&#8217; stats for the mrtg graphs.  I&#8217;m going to put the task to root&#8217;s crontab:</p>
<pre>mschenck ~# sudo crontab -u root -e</pre>
<p>And then add the following cron schedule:</p>
<pre>*/5 * * * *  /usr/local/bin/mrtg /var/www/htdocs/cfg/mrtg.cfg --logging /var/log/mrtg.log</pre>
<p>Now, just watch the data start collecting.</p>
<p><a href="http://www.tek-ops.com/wp-content/uploads/2008/12/puffy-mrtg.png"><img class="alignnone size-medium wp-image-237" title="puffy-mrtg" src="http://www.tek-ops.com/wp-content/uploads/2008/12/puffy-mrtg-600x592.png" alt="" width="600" height="592" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/228/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenSolaris HTPC: xorg.conf 1080p</title>
		<link>http://www.tek-ops.com/archives/216</link>
		<comments>http://www.tek-ops.com/archives/216#comments</comments>
		<pubDate>Mon, 20 Oct 2008 03:05:55 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=216</guid>
		<description><![CDATA[
So today I decided to utilize my OpenSolaris/ZFS file server as an HTPC.  I recently picked up a Sony Bravia KDL-42V4100 42&#8243; (1080p) LCD TV.  I have an NVidia GeForce 6200 LE with 256 MB 16x PCI-E video card which is fully support by OpenSolaris including nVidia control panel; seen here:

Here is my [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--><br />
So today I decided to utilize my OpenSolaris/ZFS file server as an HTPC.  I recently picked up a Sony Bravia KDL-42V4100 42&#8243; (1080p) LCD TV.  I have an NVidia GeForce 6200 LE with 256 MB 16x PCI-E video card which is fully support by OpenSolaris including nVidia control panel; seen here:<br />
<a href="http://www.tek-ops.com/wp-content/uploads/2008/10/osol-nvidia.png"><img class="alignnone size-medium wp-image-218" title="osol-nvidia" src="http://www.tek-ops.com/wp-content/uploads/2008/10/osol-nvidia-300x192.png" alt="" width="300" height="192" /></a><br />
Here is my /etc/X11/xorg.conf configuration:</p>
<pre>Section "ServerLayout"
    Identifier     "X.org Configured"
    Screen      0  "Screen0" 0 0
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
    RgbPath      "/usr/X11/lib/X11/rgb"
    ModulePath   "/usr/X11/lib/modules/amd64"
    FontPath     "/usr/X11/lib/X11/fonts/TrueType/"
    FontPath     "/usr/X11/lib/X11/fonts/Type1/"
    FontPath     "/usr/X11/lib/X11/fonts/Type1/sun/"
    FontPath     "/usr/X11/lib/X11/fonts/F3bitmaps/"
    FontPath     "/usr/X11/lib/X11/fonts/misc/"
    FontPath     "/usr/X11/lib/X11/fonts/100dpi/"
    FontPath     "/usr/X11/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
    Load  "IA"
    Load  "dbe"
    Load  "extmod"
    Load  "record"
    Load  "xtrap"
    Load  "GLcore"
    Load  "glx"
    Load  "dri"
    Load  "xtsol"
    Load  "freetype"
EndSection

Section "InputDevice"
    Identifier  "Keyboard0"
    Driver      "kbd"
EndSection

Section "InputDevice"
    Identifier  "Mouse0"
    Driver      "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/mouse"
    Option        "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
    Identifier    "Monitor0"
    VendorName    "Monitor Vendor"
    ModelName    "Monitor Model"

    HorizSync 30-80
    VertRefresh 60
    Option "DPMS"

    ModeLine "1920x1080" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync

EndSection

Section "Device"
    Identifier  "Card0"
    Driver      "nvidia"
    VendorName  "nVidia Corporation"
    BoardName   "NV44 [GeForce 6200 LE]"
    BusID       "PCI:4:0:0"

        Option      "RenderAccel" "true"
        Option      "AllowGLXWithComposite" "true"

EndSection

Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "Monitor0"
    DefaultDepth 24

    SubSection "Display"
        Viewport   0 0
        Depth     1
        Modes    "1920x1080"
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     4
        Modes    "1920x1080"
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     8
        Modes    "1920x1080"
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     15
        Modes    "1920x1080"
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     16
        Modes    "1920x1080"
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     24
        Modes    "1920x1080"
    EndSubSection
EndSection

Section "DRI"
        Mode         0666
EndSection</pre>
<p>Then I had to fix gdm to play well with opensolaris<br />
/etc/X11/gdm/gdm.conf</p>
<pre>SystemMenu=true
RebootCommand=/usr/sbin/init 6
HaltCommand=/usr/sbin/init 5</pre>
<p>I Switched from dtlogin to gdm for graphical login</p>
<pre># /usr/dt/bin/dtconfig -d
# svccfg
svc:&gt; select gdm
svc:/application/graphical-login/gdm&gt; setprop general/enabled = boolean: "true"
svc:/application/graphical-login/gdm&gt; listprop general/enabled
general/enabled  boolean  true
svc:/application/graphical-login/gdm&gt;
# usr/dt/bin/dtconfig -d
# /usr/dt/bin/dtconfig -d &amp; svcadm enable gdm2-login</pre>
<p>Add the following to /etc/X11/gdm/custom.conf under the &#8220;[daemon]&#8221; to enable auto-login for &#8220;media&#8221; user account<br />
# sudo vi /etc/X11/gdm/custom.conf</p>
<pre>AutomaticLoginEnable=true
AutomaticLogin=media</pre>
<p>I had to add the following to the end of /etc/pam.conf to allow user &#8220;media&#8221; to be allowed local graphical auto-login</p>
<pre>gdm-autologin auth required pam_unix_cred.so.1
gdm-autologin auth sufficient pam_allow.so.1
gdm-autologin account sufficient pam_allow.so.1
gdm-autologin session sufficient pam_allow.so.1
gdm-autologin password sufficient pam_allow.so.1</pre>
<p>Add the following to the end of ~media/.dmrc to let gdm know the default window manager for user &#8220;media&#8221;</p>
<pre>[Desktop]
Session=gnome</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/216/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building home OpenBSD router &#8211; Part 5</title>
		<link>http://www.tek-ops.com/archives/172</link>
		<comments>http://www.tek-ops.com/archives/172#comments</comments>
		<pubDate>Fri, 15 Aug 2008 23:56:49 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=172</guid>
		<description><![CDATA[Start at Part 1
Xbox 360 and File Server access
Reference: The Book of PF


In this post I&#8217;ll describe how I accomplished two goals, as well as talk about a little trick for debugging what is blocked.  The two goals are allowing my XBox 360 connect to Xbox Live through my OpenBSD firewall, and Port-forward to [...]]]></description>
			<content:encoded><![CDATA[<p>Start at <a href="../archives/30">Part 1</a></p>
<h1>Xbox 360 and File Server access</h1>
<p><small>Reference: <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FBook-PF-No-Nonsense-OpenBSD-Firewall%2Fdp%2F1593271654%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1218292051%26sr%3D8-1&amp;tag=tekopscom-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">The Book of PF</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=tekopscom-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /><br />
</small></p>
<p><!--adsense--></p>
<p>In this post I&#8217;ll describe how I accomplished two goals, as well as talk about a little trick for debugging what is blocked.  The two goals are allowing my XBox 360 connect to Xbox Live through my OpenBSD firewall, and Port-forward to my file server so I can access my files remotely.</p>
<p>Let&#8217;s start with the Xbox 360.  This is very minimal change from <a href="/archives/107">Part 4</a>.  In Part 4 we created two macros for allowed client services, the services we allow hosts on our local network to utilize, see here:</p>
<pre>client_tcp_services = "{ ssh, smtp, domain, www, pop3, auth, https, pop3s, imap,
imaps, 8000, 8080, 5190, 5222 }"
client_udp_services = "{ domain, bootps, 67 }"</pre>
<p>The Xbox 360 uses TCP port 3074, and UDP ports 88 and 3074 so we just need to add these to those macros, seen here:</p>
<pre>client_tcp_services = "{ ssh, smtp, domain, www, pop3, auth, https, pop3s, imap, imaps, 8000, 8080, 5190, 5222, 3074 }"
client_udp_services = "{ domain, bootps, 67, 88, 3074  }"</pre>
<p>Next, I set up NAPT or Network Address Port Translation.  I redirect port 5022 on the external interface of my OpenBSD router to port 22 of my file server.  This will allow me to SSH, SFTP and RSYNC to/from it when I&#8217;m away from home.  To do this I need to add a single PF RDR rules, seen here:</p>
<pre># file server
rdr on $ext_if proto { tcp, udp } from any to $ext_if port 5022 -&gt; $file_server port 22</pre>
<p>Now I just reload my rules, first checking with pfctl -nf /etc/pf.conf as previously described, then loading with pfctl -f /etc/pf.conf.</p>
<p>One last thing is to describe a method for debugging why connections might be failing.  In <a href="/archives/107">Part 4</a> I described blocking all unintended traffic with &#8220;block all&#8221;.  For debugging I&#8217;m going to change this to &#8220;block log all&#8221;.</p>
<p>Now, when ever connectivity issues occur, debugging is simple running the following tcpdump:</p>
<pre># tcpdump -netvvi pflog0</pre>
<p>As log as no other lines are configured to log, all output from this command will just describe traffic being blocked.</p>
<p>Our final /etc/pf.conf for this part of the project:</p>
<pre># Interface Globals
ext_if = "rl0"
int_if = "xl0"
wifi_if = "rum0"

# Static machines
file_server = "192.168.0.2"
xbox = "192.168.0.3"

# Protocol Globals
router_daemons = "{ ssh, domain, ntp, bootps, 8080, 5022 }"
client_tcp_services = "{ ssh, smtp, domain, www, pop3, auth, https, pop3s, imap, imaps, 8000, 8080, 5190, 5222, 3074 }"
client_udp_services = "{ domain, bootps, 67, 88, 3074  }"

# Provide NATing for my local subnets
nat on $ext_if from $wifi_if:network to any -&gt; ($ext_if) static-port
nat on $ext_if from $int_if:network to any -&gt; ($ext_if)

# file server
rdr on $ext_if proto { tcp, udp } from any to $ext_if port 5022 -&gt; $file_server port 22

block log all
set skip on lo

# Allowed Client traffic
pass out on $ext_if proto tcp to any port $client_tcp_services
pass out on $ext_if proto udp to any port $client_udp_services

# Router services
pass proto icmp
pass quick inet proto { tcp, udp } to any port $router_daemons</pre>
<p>Continue to <a href="http://www.tek-ops.com/archives/228">Step 6</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/172/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building home OpenBSD router &#8211; Part 2</title>
		<link>http://www.tek-ops.com/archives/46</link>
		<comments>http://www.tek-ops.com/archives/46#comments</comments>
		<pubDate>Wed, 30 Jul 2008 02:40:32 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=46</guid>
		<description><![CDATA[Start at Part 1
Configuring the Interfaces

First step is to configure the interfaces.  My external interface is rl0 (&#8220;Realtek 8139&#8243; &#8211; you can see dmesg below),  my internal wired interface is xl0 (&#8220;3Com 3c905B 100Base-TX&#8221;), and my wireless interface is rum0 (&#8220;Ralink 802.11 bg WLAN&#8221;).
As I stated in Part 1 the external interface (rl0) [...]]]></description>
			<content:encoded><![CDATA[<p>Start at <a href="http://www.tek-ops.com/archives/30">Part 1</a></p>
<h1>Configuring the Interfaces</h1>
<p><!--adsense--></p>
<p>First step is to configure the interfaces.  My external interface is rl0 (&#8220;Realtek 8139&#8243; &#8211; you can see dmesg below),  my internal wired interface is xl0 (&#8220;3Com 3c905B 100Base-TX&#8221;), and my wireless interface is rum0 (&#8220;Ralink 802.11 bg WLAN&#8221;).</p>
<p>As I stated in <a href="http://www.tek-ops.com/archives/30">Part 1</a> the external interface (rl0) will be a dhcp client to my cable ISP.  To configure this, I created /etc/hostname.rl0 with the following information:</p>
<pre>
dhcp NONE NONE description "Global Uplink"
</pre>
<p><em>ifconfig rl0</em> looks like this:</p>
<pre>
rl0: flags=8843 mtu 1500
lladdr 00:0d:87:07:07:56
description: Global Uplink
groups: egress
media: Ethernet autoselect (100baseTX full-duplex)
status: active
inet6 fe80::20d:87ff:fe07:756%rl0 prefixlen 64 scopeid 0x2
inet  netmask 0xfffffe00 broadcast 255.255.255.255
</pre>
<p>Next the internal wired interface (xl0);  will be statically configured with the address 192.168.0.1 with a 24 bit subnet mask, later this interface while be advertising DHCP service for the wired local network.  I created /etc/hostname.xl0 like this:</p>
<pre>
inet 192.168.0.1 255.255.255.0 192.168.0.255 description "Local Wired"
</pre>
<p><em>ifconfig xl0</em>:</p>
<pre>
xl0: flags=8843 mtu 1500
lladdr 00:10:5a:0e:da:9a
description: Local Wired
media: Ethernet autoselect (100baseTX full-duplex)
status: active
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::210:5aff:fe0e:da9a%xl0 prefixlen 64 scopeid 0x1
</pre>
<p>And lastly the wireless interface (rum0).  This interface is being set up as a wireless access point (&#8220;hostap&#8221;) configured as follows:</p>
<ul>
<li> Will be set to only support 802.11B for the time being</li>
<li>Utilizing channel 6</li>
<li>Use a hex WEP key</li>
<li>Configured as 192.168.1.1 with a 24 bit netmask</li>
<li>And later will be advertising DHCP for the local wireless network</li>
</ul>
<p>My /etc/hostname.rum0 looks like this:</p>
<pre>
up mediaopt hostap mode 11b chan 6 nwid Puffy nwkey 0x
inet 192.168.1.1
</pre>
<p><em>ifconfig rum0</em>:</p>
<pre>
rum0: flags=8843 mtu 1500
lladdr 00:1c:f0:90:82:22
groups: wlan
media: IEEE802.11 autoselect mode 11b hostap
status: active
ieee80211: nwid Puffy chan 6 bssid 00:1c:f0:90:82:22 nwkey 0x 100dBm
inet6 fe80::21c:f0ff:fe90:8222%rum0 prefixlen 64 scopeid 0x5
inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
</pre>
<hr />The &#8216;dmesg&#8217; output:</p>
<pre>
OpenBSD 4.3 (GENERIC) #698: Wed Mar 12 11:07:05 MDT 2008
deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: VIA Ezra ("CentaurHauls" 686-class) 801 MHz
cpu0: FPU,DE,TSC,MSR,MTRR,PGE,MMX
real mem  = 259555328 (247MB)
avail mem = 242909184 (231MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 03/17/03, BIOS32 rev. 0 @ 0xfb390, SMBIOS rev. 2.2 @ 0xf0800 (43 entries)
bios0: vendor Phoenix Technologies, LTD version "6.00 PG" date 03/17/2003
bios0: VIA Technologies, Inc. VT8601
apm0 at bios0: Power Management spec V1.2 (slowidle)
apm0: AC on, battery charge unknown
acpi at bios0 function 0x0 not configured
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xdd54
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdce0/112 (5 entries)
pcibios0: PCI Exclusive IRQs: 5 10 11 12
pcibios0: PCI Interrupt Router at 000:07:0 ("VIA VT82C596A ISA" rev 0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0xc000 0xcc000/0x4000! 0xd0000/0x4000
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "VIA VT8601 PCI" rev 0x05
agp0 at pchb0: v2, aperture at 0xe0000000, size 0x10000000
ppb0 at pci0 dev 1 function 0 "VIA VT82C601 AGP" rev 0x00
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "Trident CyberBlade i1" rev 0x6a
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
pcib0 at pci0 dev 7 function 0 "VIA VT82C686 ISA" rev 0x40
pciide0 at pci0 dev 7 function 1 "VIA VT82C571 IDE" rev 0x06: ATA100, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 1: &lt;QUANTUM FIREBALLlct15 15&gt;
wd0: 16-sector PIO, LBA, 14324MB, 29336832 sectors
wd0(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 4
pciide0: channel 1 ignored (disabled)
uhci0 at pci0 dev 7 function 2 "VIA VT83C572 USB" rev 0x1a: irq 11
uhci1 at pci0 dev 7 function 3 "VIA VT83C572 USB" rev 0x1a: irq 11
viaenv0 at pci0 dev 7 function 4 "VIA VT82C686 SMBus" rev 0x40: 24-bit timer at 3579545Hz
xl0 at pci0 dev 8 function 0 "3Com 3c905B 100Base-TX" rev 0x24: irq 10, address 00:10:5a:0e:da:9a
exphy0 at xl0 phy 24: 3Com internal media interface
rl0 at pci0 dev 14 function 0 "Realtek 8139" rev 0x10: irq 11, address 00:0d:87:07:07:56
rlphy0 at rl0 phy 0: RTL internal PHY
cmpci0 at pci0 dev 15 function 0 "C-Media Electronics CMI8738/C3DX Audio" rev 0x10: irq 12
audio0 at cmpci0
opl0 at cmpci0: model OPL3
midi0 at opl0: &lt;CMPCI Yamaha OPL3&gt;
mpu at cmpci0 not configured
"C-Media Electronics HSP56 AMR" rev 0x20 at pci0 dev 15 function 1 not configured
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi1 at pcppi0: &lt;PC speaker&gt;
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
usb0 at uhci0: USB revision 1.0
uhub0 at usb0 "VIA UHCI root hub" rev 1.00/1.00 addr 1
usb1 at uhci1: USB revision 1.0
uhub1 at usb1 "VIA UHCI root hub" rev 1.00/1.00 addr 1
biomask ebed netmask efed ttymask efef
rum0 at uhub0 port 2 "Ralink 802.11 bg WLAN" rev 2.00/0.01 addr 2
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:1c:f0:90:82:22
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
</pre>
<p>Continue to <a href="http://www.tek-ops.com/archives/60">Step 3</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/46/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building home OpenBSD router &#8211; Part 1</title>
		<link>http://www.tek-ops.com/archives/30</link>
		<comments>http://www.tek-ops.com/archives/30#comments</comments>
		<pubDate>Mon, 28 Jul 2008 15:01:17 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=30</guid>
		<description><![CDATA[Planning the Project Specs

Goals:
- Two local subnets, Wired and Wireless
- Support Xbox Live
- Provide external access to my file server
- Limit all communication out of my network strictly to the applications and services I choose to allow (web traffic, mail traffic, ssh, xbox, torrents, etc)
- Improved stability over the over-the-counter home routers
- Shape traffic using [...]]]></description>
			<content:encoded><![CDATA[<h1>Planning the Project Specs</h1>
<p><!--adsense--></p>
<p><strong>Goals:</strong></p>
<p>- Two local subnets, Wired and Wireless</p>
<p>- Support Xbox Live</p>
<p>- Provide external access to my file server</p>
<p>- Limit all communication out of my network strictly to the applications and services I choose to allow (web traffic, mail traffic, ssh, xbox, torrents, etc)</p>
<p>- Improved stability over the over-the-counter home routers</p>
<p>- Shape traffic using ALTQ</p>
<p><strong>Resources:</strong></p>
<p>- For the Operating System, I&#8217;m going with OpenBSD 4.3 (STABLE)</p>
<p>- Putting to use my MaxTerm 8300B</p>
<ul>
<li>EVE-M 800 mhz (x86)</li>
<li>256 MB of RAM</li>
<li>15 GB IDE hard drive (spare one sitting around)</li>
<li>D-Link USB  Wireless Card (rum0 driver in OpenBSD) for local wireless traffic</li>
<li>Spare old 3com 10/100 Mbit NIC for local wired traffic</li>
</ul>
<div>- For reference, I&#8217;m using &#8220;The Book of PF&#8221;.</p>
<p>This has been a great read and an excellent resource in the planning stages of this project for me.  For anyone who doesn&#8217;t already have a copy, I can not recommend this book enough.  Heres a link for picking it up from Amazon. (it&#8217;s probably be the cheapest part of this project)</p></div>
<p><strong>The Plan:</strong></p>
<ul>
<li>Local wired traffic: 192.168.0.X/24</li>
<li>Local wireless traffic: 192.168.1.X/24</li>
<li>Provide DHCP services on both local interfaces</li>
<li>External Interface running DHCP</li>
<li>Starting with blocking everything [block all]</li>
<li>Designate IPs per server and personal computer on my network</li>
<li>Designate torrent ports to each of the personal computers</li>
<li>Initially just use WEP for proof of concept, <a href="http://undeadly.org/cgi?action=article&amp;sid=20080416195151">later use WPA</a> or even an authpf with a possible web interface for authenticating</li>
<li>Perform MRTG graphing if for nothing more than to see what I spend my bandwidth doing</li>
</ul>
<p>Continue to <a href="http://www.tek-ops.com/archives/46">Part 2</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/30/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Thumbdrive for redundant boot device (OpenSolaris)</title>
		<link>http://www.tek-ops.com/archives/22</link>
		<comments>http://www.tek-ops.com/archives/22#comments</comments>
		<pubDate>Mon, 28 Jul 2008 02:46:09 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=22</guid>
		<description><![CDATA[
First disable automating; this may be volfs or hal depending on the version of solaris 10/11
 # svcadm disable volfs 
Now plug in the thumbdrive and determine the location for the logical node

bash-3.00# rmformat -l

Looking for devices...

1. Logical Node: /dev/rdsk/c0t0d0p0

Physical Node: /pci@0,0/pci-ide@1f,1/ide@0/sd@0,0

Connected Device: TEAC     CD-224E-N       [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--></p>
<h4>First disable automating; this may be volfs or hal depending on the version of solaris 10/11</h4>
<pre> # svcadm disable volfs </pre>
<h4>Now plug in the thumbdrive and determine the location for the logical node</h4>
<pre>
bash-3.00# rmformat -l

Looking for devices...

1. Logical Node: <strong>/dev/rdsk/c0t0d0p0</strong>

Physical Node: /pci@0,0/pci-ide@1f,1/ide@0/sd@0,0

Connected Device: TEAC     CD-224E-N        1.AA

Device Type: CD Reader

2. Logical Node: <strong>/dev/rdsk/c4t0d0p0</strong>

Physical Node: /pci@0,0/pci15d9,7980@1d,7/hub@5/storage@1/disk@0,0

Connected Device: Corsair  Flash Voyager    1.00

Device Type: Removable

bash-3.00#
</pre>
<p><strong>/dev/rdsk/c4t0d0</strong> will be the root of what we&#8217;re working with in this example</p>
<p>Now run:</p>
<pre>
# fdisk -B /dev/rdsk/c4t0d0s0
</pre>
<h4>Now you can get the geometry using the following:</h4>
<pre>
# fdisk -W - /dev/rdsk/c4t0d0s0
</pre>
<p>Now, look at output from previous step and find max MB (MAXSIZE) of usable storage. You do this by multiplying bytes/sector (usually 512 at the top) with num sectors at the bottom of output (in my case, a 4 GB drive had roughly 7.9Million sections or so) divide by (1024*1024) to yield MB (should be 3900 MB or so for a 4GB flash stick.</p>
<pre>
slices: 0 = 2MB, {$MAXSIZE-3}MB, "wm", "root" :

1 = 0, 1MB, "wu", "boot" :

2 = 0, {$MAXSIZE - 1}MB, "wm", "backup"
</pre>
<h4>Here is a &#8220;slices.txt&#8221; file for a 256 mb thumbdrive</h4>
<pre>
slices: 0 = 2MB, 244MB, "wm", "root" :

1 = 0, 1MB, "wu", "boot" :

2 = 0, 246MB, "wm", "backup"
</pre>
<h4>Now put this label to the drive</h4>
<pre>
# rmformat -s ./path/to/slices.txt /dev/rdsk/c4t0d0p0
</pre>
<p>Now to refresh Solaris devices:</p>
<pre>
# devfsadm; devfsadm -C
</pre>
<h4>Now to create the filesystem, mount it and copy the necessary files</h4>
<pre>
# newfs /dev/rdsk/c4t0d0s0
# mkdir /mnt/backup
# mount /dev/dsk/c4t0d0s0 /mnt/backup
# cd /mnt/backup
# cp -r /boot ./boot
# cp -r /platform ./platform
</pre>
<h4>Now lets make this bootable</h4>
<pre>
# fdisk /dev/rdsk/c4t0d0p0
</pre>
<p>Set partition 1 active using option 2</p>
<pre>
# cd /mnt/backup/boot/grub/
# installgrub stage1 stage2 /dev/rdsk/c4t0d0s0
</pre>
<p>Now safely unmount</p>
<pre> # cd /;umount /mnt/backup
</pre>
<h4>references:</h4>
<ul>
<li><a href="http://blogs.sun.com/PotstickerGuru/entry/giving_usb_the_boot_install"> Giving USB the boot &#8211; install </a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/22/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AppleTalk on Solaris (AFP)</title>
		<link>http://www.tek-ops.com/archives/20</link>
		<comments>http://www.tek-ops.com/archives/20#comments</comments>
		<pubDate>Mon, 28 Jul 2008 02:45:03 +0000</pubDate>
		<dc:creator>Michael Schenck</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">http://www.tek-ops.com/?p=20</guid>
		<description><![CDATA[AppleTalk has been quite a popular choice for networking computers mainly because it&#8217;s, well, made by Apple. It was supposedly made solely for Apple computers but the Internet folks have never been one to settle for should be&#8217;s and would rather run after could be&#8217;s. If cheap mobile phones today can be hacked to become [...]]]></description>
			<content:encoded><![CDATA[<p>AppleTalk has been quite a popular choice for networking computers mainly because it&#8217;s, well, made by Apple. It was supposedly made solely for Apple computers but the Internet folks have never been one to settle for should be&#8217;s and would rather run after could be&#8217;s. If <a href="http://www.o2.co.uk">cheap mobile phones</a> today can be hacked to become as efficient as high-end phones, why not try making AppleTalk work on other operating systems right? That&#8217;s what we&#8217;re aiming to do on this page, make AppleTalk work on Solaris.<br />
<!--adsense--></p>
<h4>[Taken from:  <a href="http://www.unixzone.dk/unix/20060122/appletalk-on-solaris/"> www.unixzone.dk</a>]</h4>
<p>Netatalk 2.0.3 requires some patching to compile on Solaris 10 (or OpenSolaris)</p>
<ul>Requirements:</p>
<li><a href="http://netatalk.sourceforge.net/">netatalk</a></li>
<li><a href="http://www.oracle.com/technology/software/products/berkeley-db/db/index.html">Berkeley DB 4.2.52</a></li>
<li>GCC compiler, Sun Studio didn&#8217;t work for me</li>
<li><a href="http://tek-ops.com/files/patches.tar.gz">Patches</a>:       netatalk-2.0.3/sys/netatalk/at.h and netatalk-2.0.3/sys/solaris/tpi.c</li>
</ul>
<h3>Click <a href="http://tek-ops.com/txts/build_db.html">&lt;HERE&gt;</a> for build instructions       for DB</h3>
<p>On Solaris we don&#8217;t use ranlib, LDFLAGS adds /usr/local/lib to the<br />
library search path where my Berkeley DB libs are , rest of the options<br />
are self-explanatory.</p>
<pre> # gzip -cd netatalk-2.0.3.tar.gz | tar xf -
# gzip -cd patches.tar.gz | tar xf -
# cd netatalk-2.0.3
# RANLIB=echo CC=gcc LDFLAGS=-R/usr/local/BerkeleyDB.4.2/lib
./configure --prefix=/opt/netatalk --with-ssl-dir=/usr/sfw
--with-bdb=/usr/local/BerkeleyDB.4.2 --without-pam --disable-ddp
--disable-tcp-wrappers  --disable-srvloc --with-cnid-dbd-backend
# echo "#define SOLARIS2 10" &gt;&gt;config.h</pre>
<p>Depending on the version of your Solaris installation, you&#8217;ll want to<br />
change this to match, ie. 8, 9, 10, or 11 for OpenSolaris.</p>
<h4>Patch the source to support x64 Solaris</h4>
<pre> # patch -i ../patches/at.h.patch sys/netatalk/at.h
Looks like a unified context diff.
done
#  patch -i ../patches/config.h.patch ./config.h
Looks like a normal diff.
done
# patch -i ../patches/endian.h.patch sys/netatalk/endian.h
Looks like a normal diff.
done
# patch -i ../patches/tpi.c.patch sys/solaris/tpi.c
Looks like a unified context diff.
done</pre>
<h4>Build and install the software</h4>
<pre> # make
# make install</pre>
<p>Under Solaris, you must create atalkd.conf, since Solaris provides no<br />
method for determining the names of the available interfaces. It is<br />
sufficent to name the available interfaces in atalkd.conf, one per line.<br />
E.g.<br />
eri0<br />
on a line by itself on many Suns, hme0 on Ultras etc. See atalkd(8).</p>
<h4>Create init script and add to Sun&#8217;s svc system</h4>
<pre> # cp distrib/initscripts/rc.atalk.sysv /opt/local/lib/svc/method/netatalk</pre>
<p>Place <a href="http://tek-ops.com/files/netatalk.xml">netatalk.xml</a> somewhere on the file system</p>
<pre> # svccfg import /path/to/netatalk.xml
# svcadm enable netatalk
# rm /path/to/netatalk.xml</pre>
<h4>Now for configuration:</h4>
<pre> # cd /opt/netatalk/etc/netatalk/
# ls -l
total 96
-rw-r--r--   1 root     root       5066   Apr  4 15:21 AppleVolumes.default
-rw-r--r--   1 root     root       25124  Apr  2 14:49 AppleVolumes.system
-rw-r--r--   1 root     root       11259  Apr  4 14:59 afpd.conf
-rw-r--r--   1 root     root       1059   Apr  4 11:57 atalkd.conf
-rw-r--r--   1 root     root       1429   Apr  4 15:01 netatalk.conf
-rw-r--r--   1 root     root       1479   Apr  2 14:49 papd.conf
drwxr-xr-x   2 root     root       512    Apr  3 11:49 uams
#</pre>
<h4>Add the following to &#8220;afpd.conf&#8221;:</h4>
<pre> "Solaris AFP" -uamlist uams_guest.so -loginmesg "Welcome, $u!" -transall -noddp -tcp</pre>
<h4>Configure “netatalk.conf” as seen here:</h4>
<pre> # Appletalk configuration
# Change this to increase the maximum number of clients that can connect:
AFPD_MAX_CLIENTS=50

# Change this to set the machine’s atalk name and zone, the latter containing
# the ‘@’ sign as first character — compare with nbp_name(3) if in doubt
#
# NOTE: If Netatalk should register AppleTalk services in the standard zone
#       then you need not to specify a zone name here.

#
#       If your zone has spaces in it, you’re better off specifying
#       it in afpd.conf if you realize that your distribution doesn’t
#       handle spaces correctly in the startup script. Remember to use
#       quotes here if the zone name contains spaces.
#
#ATALK_ZONE=”@some zone”
ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1`
# specify the Mac and unix charsets to be used

ATALK_MAC_CHARSET=’MAC_ROMAN’
ATALK_UNIX_CHARSET=’LOCALE’
# specify this if you don’t want guest, clrtxt, and dhx
# available options: uams_guest.so, uams_clrtxt.so, uams_dhx.so,
#                    uams_randnum.so
#AFPD_UAMLIST=”-U uams_clrtxt.so,uams_dhx.so”
# Change this to set the id of the guest user
AFPD_GUEST=nobody
# Set which daemons to run (papd is dependent upon atalkd):

ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no
# Control whether the daemons are started in the background
ATALK_BGROUND=no
# export the charsets, read form ENV by apps

export ATALK_MAC_CHARSET
export ATALK_UNIX_CHARSET</pre>
<h4>Add the following to “AppleVolumes.default”:</h4>
<pre> :DEFAULT: cnidscheme:dbd
/Storage "Storage" rwlist:nobody</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tek-ops.com/archives/20/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
