<?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>devtrends.com &#187; Linux</title>
	<atom:link href="http://www.devtrends.com/index.php/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devtrends.com</link>
	<description>developing trends in information technology</description>
	<lastBuildDate>Tue, 06 Sep 2011 19:27:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Streaming Music on Hold in Elastix 2.0</title>
		<link>http://www.devtrends.com/index.php/streaming-music-on-hold-in-elastix-2-0/</link>
		<comments>http://www.devtrends.com/index.php/streaming-music-on-hold-in-elastix-2-0/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 04:05:53 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=726</guid>
		<description><![CDATA[Elastix 2.0.3 is a Linux distribution that contains Asterisk 1.6.2.13 (as of the writing of this article) and other Asterisk centric addons, such as the Elastix web interface, Hylafax and...]]></description>
			<content:encoded><![CDATA[<p>Elastix 2.0.3 is a Linux distribution that contains Asterisk 1.6.2.13 (as of the writing of this article) and other Asterisk centric addons, such as the Elastix web interface, Hylafax and Flash Operator Panel. Arguably, Elastix is the best Asterisk package available today and is an enterprise ready implementation of the Asterisk phone system software. Enough about my experience-driven opinion on Elastix and Asterisk, let&#8217;s talk about Streaming some Music on Hold!</p>
<p><strong>Ensuring Streaming Capability</strong></p>
<p>The first step is to ensure that we have the appropriate application for playing our music on hold stream. Because we will be using an MP3 stream, we will want to use mpg123. Unfortunately, the mpg123 application is not included in the Elastix distribution, so, let&#8217;s install it. We will also need to install other components/applications associated with mpg123:</p>
<p>Let&#8217;s start by downloading the RPM package for mpg123:</p>
<blockquote><p>[root@server /]# cd /usr/src<br />
[root@server /usr/src]# wget &#8220;ftp://ftp.sunet.se/pub/os/Linux/RPMForge/dag/redhat/el3/en/i386/RPMS.dag/mpg123-1.6.2-1.el3.rf.i386.rpm&#8221;</p></blockquote>
<p>Next, well install the required applications to make mpg123 work (if you don&#8217;t want to explicitly run these, skip to installing the rpm and install the required application as you are requested):</p>
<blockquote><p>[root@server /usr/src]# yum install audiofile<br />
[root@server /usr/src]# yum install glibc<br />
[root@server /usr/src]# yum install libtool-ltdl<br />
[root@server /usr/src]# yum install esound</p></blockquote>
<p>Finally, lets install mpg123:</p>
<blockquote><p>[root@server /usr/src]# rpm -ivh mpg123-1.6.2-1.el3.rf.i386.rpm</p></blockquote>
<p><strong>Acquiring a Stream</strong></p>
<p>The second step in configuring streaming music on hold is finding the stream you want to use. For this example, I will use a Digitally Imported stream named Chillout Dreams.</p>
<p>Because of the way that Firefox handles downloads, I&#8217;m going to demonstrate accessing the stream file using Firefox:</p>
<ol>
<li>Open Firefox and browse to www.di.fm</li>
<li>Using the mouse, hover over the DI menu &#8220;Listen Now!&#8221;, then hover over &#8220;Chillout Dreams&#8221;, then hover over &#8220;MP3 Streams&#8221;, and finally click on &#8220;96k Cable/DSL&#8221;.<br />
<a href="http://www.devtrends.com/wp-content/uploads/2011/02/difm_chilloutdreams.jpg"><img class="alignnone size-medium wp-image-728" title="difm_chilloutdreams" src="http://www.devtrends.com/wp-content/uploads/2011/02/difm_chilloutdreams-300x228.jpg" alt="" width="300" height="228" /></a></li>
<li>Once the download has completed, right click on listen.pls and then click on &#8220;Open Containing Folder&#8221;.<br />
<a href="http://www.devtrends.com/wp-content/uploads/2011/02/difm_download.jpg"><img class="alignnone size-medium wp-image-729" title="difm_download" src="http://www.devtrends.com/wp-content/uploads/2011/02/difm_download-300x179.jpg" alt="" width="300" height="179" /></a></li>
<li>Using your favorite text editor, mine is <a href="http://www.ultraedit.com" target="_blank">UltraEdit</a>, open listen.pls and select the http:// stream for file1 and copy to your clipboard.<br />
<a href="http://www.devtrends.com/wp-content/uploads/2011/02/difm_stream.jpg"><img class="alignnone size-medium wp-image-730" title="difm_stream" src="http://www.devtrends.com/wp-content/uploads/2011/02/difm_stream-300x242.jpg" alt="" width="300" height="242" /></a></li>
</ol>
<p><strong>Configuring Elastix</strong></p>
<p>Now that you have a stream URL ready for use, open your Elastix web interface and click on the PBX tab.</p>
<ol>
<li>Under PBX configuration, on the left side of the screen, click on the &#8220;Music on Hold&#8221; link from the Internal Options &amp; Configuration section.</li>
<li>Now click on the &#8220;Add Streaming Category&#8221; on the right side of the screen.</li>
<li>In the Category Name field, enter whatever you wish, &#8220;DI-Chillout-Dreams&#8221;?</li>
<li>In the Application field, enter the following, then paste the stream URL at the end of the application string (replacing [streamURL] of course):</li>
</ol>
<blockquote><p>/usr/bin/mpg123 -q -s &#8211;mono -r 8000 -f 8192 -b 0 [streamURL]</p></blockquote>
<p>Now that you have the Music on Hold defined, we need to configure your inbound and outbound routes to use the music on hold:</p>
<ol>
<li>Click on the &#8220;Outbound Routes&#8221; and then click on your route(s), then in the drop down list for &#8220;Music on Hold?&#8221;, choose your new music on hold category.</li>
<li>Click on the &#8220;Inbound Routes&#8221; and then click on your route(s), then in the drop down list for &#8220;Music on Hold?&#8221;, choose your new music on hold category.</li>
</ol>
<p><strong>On the Back End</strong></p>
<p>When  you created the music on hold category/application, the Asterisk file modified is /etc/asterisk/musiconhold_additional.conf, which is included in the base music on hold file /etc/asterisk/musiconhold.conf.</p>
<p>If you open the conf file in a text editor, you&#8217;ll notice the category/application that you added earlier.</p>
<p>-Aaron</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/streaming-music-on-hold-in-elastix-2-0/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Configuring SAMBA Shares in Ubuntu</title>
		<link>http://www.devtrends.com/index.php/configuring-samba-shares-in-ubuntu/</link>
		<comments>http://www.devtrends.com/index.php/configuring-samba-shares-in-ubuntu/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 23:30:21 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Microsoft O/S]]></category>
		<category><![CDATA[SMB]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Linux Windows Shares]]></category>
		<category><![CDATA[SAMBA]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=705</guid>
		<description><![CDATA[I needed to upgrade my file server to support larger disks (1TB SATA) and at the same time I wanted to upgrade from Windows 2000 Server. Prior to my purchasing...]]></description>
			<content:encoded><![CDATA[<p>I needed to upgrade my file server to support larger disks (1TB SATA) and at the same time I wanted to upgrade from Windows 2000 Server. Prior to my purchasing a TechNet subscription, I only had one viable option, to use Linux. I would say that the order of events (Linux then TechNet) was beneficial as I had to actually learn to use Linux. This started a whole interest in Linux/Unix (and Mac) that is still growing today.</p>
<p>As you may know, to make a Linux server replace a Windows file server you&#8217;ll need a common file sharing protocol between both server and client. Well, SAMBA is the answer. In reality I think that SAMBA is the only answer.</p>
<p><strong>Installing SAMBA</strong></p>
<p>To be honest, I just rebuilt my Linux machine this month and have already forgotten whether SAMBA came preinstalled on Ubuntu Server 9.10 or not. Even if it is already install, it doesn&#8217;t hurt to try installing it again:</p>
<blockquote><p>aaron@server:/# sudo apt-get install samba</p></blockquote>
<p>Among other files, the three files you will use the most in configuring SAMBA are the config file, /etc/samba/smb.conf, and the init script for the daemon, /etc/init.d/samba, and the SAMBA password tool, /usr/bin/smbpasswd.</p>
<p><strong>Configuring Users and Groups for SAMBA</strong></p>
<p>The first step is creating the users and groups that will be accessing the SAMBA share. In this example, we will use local Linux accounts and groups, then activate the user account in SAMBA. The group will be used to assign permissions to the directory in the Linux file system.</p>
<p>Because my set up is small, I have only a few accounts and one group that I use for SAMBA shares. The group has all SAMBA users in it and is named &#8220;dtusers&#8221;. Let&#8217;s work with my configuration as the example.</p>
<p>First, if you dare, switch to the root account (or best practice is to use sudo for every command):</p>
<blockquote><p>root@server:/# sudo su</p></blockquote>
<p>To create a new system group, use the following:</p>
<blockquote><p>root@server:/# groupadd -r dtusers</p></blockquote>
<p>Now that we have the group created, we should create some users as well. As we create the users, we will assign the group we just created as a supplemental group.</p>
<blockquote><p>root@server:/# useradd -G dtusers -p P@ssW0rd aaron</p></blockquote>
<p>Use the above command as many times as needed for your users. &#8220;aaron&#8221; is the username, by the way. Additional thought, &#8220;P@ssW0rd&#8221; is not a secure password, and even though SAMBA is configured to synchronize passwords (see &#8220;unix password sync&#8221; setting in the smb.conf file), we want to ensure a password is set prior to SAMBA configuration.</p>
<p>Finally, we need to enable these accounts using the SAMBA smbpasswd password tool.</p>
<blockquote><p>root@server:/# smbpasswd -a aaron</p></blockquote>
<p>When you are prompted for a password, use the same password as you did when you created the user. Use the above command as many times as needed for your users.</p>
<p><strong>Configuring Directories for SAMBA Sharing</strong></p>
<p>The next step is figuring out which directories you want to share through SAMBA. In my case, I created all of my shares under /datastore/. For the example, lets copy my configuration.</p>
<p>Create the /datastore/ root directory. Then create a directory named aaron, a directory named music, a directory named pictures and a directory named downloads.</p>
<blockquote><p>root@server:/# mkdir /datastore<br />
root@server:/# cd /datastore<br />
root@server:/datastore# mkdir aaron<br />
root@server:/datastore# mkdir music<br />
root@server:/datastore# mkdir pictures<br />
root@server:/datastore# mkdir downloads</p></blockquote>
<p>Now that we have our directories created, we need to ensure owners and  permissions are set correctly for each of the directories.</p>
<p>First, we need to change the user and group owners. I recommend root as the main user for any &#8220;shared&#8221; directories:</p>
<blockquote><p>root@server:/datastore# chown aaron:dtusers aaron<br />
root@server:/datastore# chown root:dtusers music<br />
root@server:/datastore# chown root:dtusers pictures<br />
root@server:/datastore# chown root:dtusers downloads</p></blockquote>
<p>Last, we need to change the permissions. I recommend 775 (see Unix Permissions at the bottom of this  article for more info on 775) for any of the &#8220;shared&#8221; directories and  750 or 700 for the user specific directories.</p>
<blockquote><p>root@server:/datastore# chmod 700 aaron<br />
root@server:/datastore# chmod 775 music<br />
root@server:/datastore# chmod 775 pictures<br />
root@server:/datastore# chmod 775 downloads</p></blockquote>
<p>Now, have a look at your directories to make sure they have the appropriate permissions:</p>
<p><a href="http://www.devtrends.com/wp-content/uploads/2011/02/SAMBA_permissions_example.jpg"><img class="alignnone size-full wp-image-711" title="SAMBA_permissions_example" src="http://www.devtrends.com/wp-content/uploads/2011/02/SAMBA_permissions_example.jpg" alt="" width="479" height="138" /></a></p>
<p><strong>Configuring SAMBA</strong></p>
<p>The final step in configuring SAMBA is, well, configuring SAMBA. The SAMBA configuration file, smb.conf, that comes with the SAMBA install is rather large. We&#8217;ll go through it and change only some of the settings and add some of our own.</p>
<p>Using your favorite text editor (mine is actually vi, but if you are new to Linux, you&#8217;ll like nano better) and open the SAMBA configuration file:</p>
<blockquote><p>root@server:/# vi /etc/samba/smb.conf</p></blockquote>
<p>Scroll through the configuration file and review the various options. Once you have looked around, start changing variables. First if you have a DNS domain defined, I would change the following:</p>
<blockquote><p>workgroup = dt.local</p></blockquote>
<p>Next, scroll to the bottom of the configuration file and add your SAMBA share definitions. In this example, I have also configured a &#8220;create mask&#8221; which forces certain permission types for all new files, &#8220;directory mask&#8221; which forces certain permission types for all new directories, and &#8220;force group&#8221; to ensure the group is always my dtusers group:</p>
<blockquote><p>[aaron]<br />
path = /datastore/aaron<br />
valid users = aaron<br />
writable = yes<br />
browseable = yes<br />
read only = no<br />
create mask = 0700<br />
directory mask = 0700<br />
guest ok = no<br />
force group = dtusers</p>
<p>[music]<br />
path = /datastore/music<br />
valid users = @dtusers<br />
writable = yes<br />
browseable = yes<br />
read only = no<br />
create mask = 0775<br />
directory mask = 0775<br />
guest ok = no<br />
force group = dtusers</p>
<p>[pictures]<br />
path = /datastore/pictures<br />
valid users = @dtusers<br />
writable = yes<br />
browseable = yes<br />
read only = no<br />
create mask = 0775<br />
directory mask = 0775<br />
guest ok = no<br />
force group = dtusers</p>
<p>[downloads]<br />
path = /datastore/downloads<br />
valid users = @dtusers<br />
writable = yes<br />
browseable = yes<br />
read only = no<br />
create mask = 0775<br />
directory mask = 0775<br />
guest ok = no<br />
force group = dtusers</p></blockquote>
<p>You&#8217;ll notice that the [aaron] share contains &#8220;valid users&#8221; of only aaron, while the other &#8220;shared&#8221; shares contain &#8220;valid users&#8221; of @dtusers. The @ sign defines a group. If you have more than one group or users, separate them with a space.</p>
<p>Save the configuration file and then restart the SAMBA service:</p>
<blockquote><p>root@server:/# /etc/init.d/samba restart</p></blockquote>
<p><strong>Using SAMBA</strong></p>
<p>Now that you have SAMBA configured with some shares, give it a whirl from your Windows machine. If the user that you sign into on your Windows machine is the same, with the same password, as the Linux/SAMBA user you will not be prompted to authenticate.</p>
<p>Click Start &gt; Run and then type in the UNC path to your Linux server. If you have a DNS host (A) record for your server it could be \\server\share_name, otherwise just use the IP address, \\192.168.0.1\share_name.</p>
<p>That&#8217;s it. Enjoy Linux!</p>
<p><strong>Unix Permissions</strong></p>
<p>764 defines the permissions for User (the 7)/Group (the 6)/Everyone (the 4). As another example, if you wanted only the User to have full permissions, assign 700, which is User (the 7)/Group (the 0)/Everyone (the 0).</p>
<p>The number represents the collective of permission types: 4 is Read, 2 is Write, 1 is Execute. So a 7 would be 4 + 2 + 1, which means that when assigned to the User, it will have all three permission types, or full control. A zero means no permission types, and therefore no permissions.</p>
<p><strong>Links</strong></p>
<p><a href="http://www.samba.org/" target="_blank">http://www.samba.org/</a><br />
<a href="http://support.quickbooks.intuit.com/support/Articles/HOW12300" target="_blank">http://support.quickbooks.intuit.com/support/Articles/HOW12300</a></p>
<p>-Aaron</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/configuring-samba-shares-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure iSCSI in CentOS 4/5 REHL 4/5</title>
		<link>http://www.devtrends.com/index.php/configure-iscsi-in-centos-45-rehl-45/</link>
		<comments>http://www.devtrends.com/index.php/configure-iscsi-in-centos-45-rehl-45/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 17:27:51 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[iSCSI]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=702</guid>
		<description><![CDATA[Since I don&#8217;t have an article on configuring Linux with iSCSI Initiator software, I thought I&#8217;d share this quick howto: http://linuxbites.wordpress.com/2010/03/26/configure-iscsi-in-centos-45-rehl-45/ -Aaron]]></description>
			<content:encoded><![CDATA[<p>Since I don&#8217;t have an article on configuring Linux with iSCSI Initiator software, I thought I&#8217;d share this quick howto:</p>
<p><a href="http://linuxbites.wordpress.com/2010/03/26/configure-iscsi-in-centos-45-rehl-45/" target="_blank">http://linuxbites.wordpress.com/2010/03/26/configure-iscsi-in-centos-45-rehl-45/</a></p>
<p>-Aaron</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/configure-iscsi-in-centos-45-rehl-45/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure NTP Server on Ubuntu 9.10</title>
		<link>http://www.devtrends.com/index.php/configure-ntp-server-on-ubuntu-9-10/</link>
		<comments>http://www.devtrends.com/index.php/configure-ntp-server-on-ubuntu-9-10/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 01:57:06 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[NTP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NTP Server]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=646</guid>
		<description><![CDATA[I don&#8217;t know about you, but I really don&#8217;t like when clocks all display a different time, even when it is usually at most a 5 minute difference. When it...]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know about you, but I really don&#8217;t like when clocks all display a different time, even when it is usually at most a 5 minute difference. When it comes to computer technology, time differences between devices is annoying and is also considered a security threat for some protocols, such as Kerberos.</p>
<p>This article is not to argument security threats, but instead to show you how to configure an NTP server on Ubuntu Server 9.10. Once you have the NTP Server functioning, you may configure devices that understand NTP to get time from your new NTP Server. Let&#8217;s get started.</p>
<p><strong>Install NTP Server</strong></p>
<p>Remember that installing packages in Linux will require elevated privileges, so make sure you sudo first.</p>
<p>1. root@server:/# apt-get install ntp</p>
<p><strong>Configure the NTP Server</strong></p>
<p>Next we will configure the NTP server to use a NTP pool and to allow access for your network to do NTP queries to this server.</p>
<p>1. root@server:/# vi /etc/ntp.conf</p>
<p>Locate the following section in the conf file:</p>
<blockquote><p># You do need to talk to an NTP server or two (or three).<br />
server ntp.ubuntu.com</p></blockquote>
<p>Change that to be this instead (servers from <a href="http://www.pool.ntp.org/en/" target="_blank">pool.ntp.org</a>):</p>
<blockquote><p># You do need to talk to an NTP server or two (or three).<br />
server 0.pool.ntp.org<br />
server 1.pool.ntp.org<br />
server 2.pool.ntp.org<br />
server 3.pool.ntp.org</p></blockquote>
<p>Next locate the &#8220;restrict&#8221; statements and add the following new line (replace with your subnet):</p>
<blockquote><p>restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap</p></blockquote>
<p><strong>Set Time on Server</strong></p>
<p>This is an important step, as you will not be able to synchronize your NTP Server with the NTP pool time if the time is off by too many minutes.</p>
<p>Make sure the NTP Server is stopped, as the following command will require the same port:</p>
<p>1. root@server:/# /etc/init.d/ntp stop</p>
<p>Set the system time:</p>
<p>2. root@server:/# ntpdate pool.ntp.org</p>
<p>Start the NTP Server.</p>
<p>3. root@server:/# /etc/init.d/ntp start</p>
<p><strong>Check the NTP Server Status</strong></p>
<p>In order for your clients to be able to successfully query time from your new NTP Server, your NTP Server must be synchronized with the specified Internet NTP servers. After you have started the NTP Server, this may take 10 minutes for synchronization.</p>
<p>To check the status, use:</p>
<p>1. root@server:/# ntpq -pn</p>
<p>If you server is not synchronized yet, and assuming your configured the servers as explained above, you should see something similar to the following:</p>
<p><a href="http://www.devtrends.com/wp-content/uploads/2011/02/ntp_no_sync.jpg"><img class="alignnone size-full wp-image-650" title="ntp_no_sync" src="http://www.devtrends.com/wp-content/uploads/2011/02/ntp_no_sync.jpg" alt="" width="554" height="90" /></a></p>
<p>Once it is synchronized, it will display something similar to the following:</p>
<p><a href="http://www.devtrends.com/wp-content/uploads/2011/02/ntp_sync.jpg"><img class="alignnone size-full wp-image-651" title="ntp_sync" src="http://www.devtrends.com/wp-content/uploads/2011/02/ntp_sync.jpg" alt="" width="554" height="90" /></a></p>
<p>Notice the * and + symbols next to the IP addresses, the one with the * is the server that your computer is synchronized with.</p>
<p>Note: If you try to synchronize a Windows device with the NTP Server before it is synchronized with the Internet, you will probably receive an error similar to: &#8220;An error occurred while Windows was synchronizing with 192.168.0.10. The time sample was rejected because: The peer&#8217;s stratum is less than the host&#8217;s stratum.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/configure-ntp-server-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure TFTP Server on Ubuntu 9.10</title>
		<link>http://www.devtrends.com/index.php/configure-tftp-on-ubuntu-9-10/</link>
		<comments>http://www.devtrends.com/index.php/configure-tftp-on-ubuntu-9-10/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 23:45:34 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[TFTP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[atftpd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu 9.10]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=642</guid>
		<description><![CDATA[I have been searching for a solution that worked for configuring a TFTP Server service on my Ubuntu 9.10 Linux server and have yet to find one that provides a...]]></description>
			<content:encoded><![CDATA[<p>I have been searching for a solution that worked for configuring a TFTP Server service on my Ubuntu 9.10 Linux server and have yet to find one that provides a working answer. So, I write my own.</p>
<p>For this example we will use atftp daemon, which is apparently the best solution for Linux at the time of this article.</p>
<p><strong>Install atftpd</strong></p>
<p>Obviously the installation requires root access, so make sure that you sudo.</p>
<p>1. root@server:/# apt-get install atftpd</p>
<p><strong>Configure atftpd</strong></p>
<p>1. root@server:/# vi /etc/default/atftpd</p>
<p>We are going to change USE_INETD to false and then if you feel like it, remove some of the options. Be sure to add the option &#8220;&#8211;daemon&#8221;, as shown below:</p>
<blockquote><p>USE_INETD=false<br />
OPTIONS=&#8221;&#8211;tftpd-timeout 300 &#8211;retry-timeout 5 &#8211;maxthread 100 &#8211;verbose=5 &#8211;daemon /var/lib/tftpboot/&#8221;</p></blockquote>
<p>If you do not add the &#8211;daemon option, then atftpd daemon will not start when you restart with /etc/init.d/atftpd restart. Instead it will display the atftpd options, as though you ran the binary file from /usr/sbin/atftpd.</p>
<p>If you are interested in learning about the options, be sure to read the <a href="http://linux.die.net/man/8/atftpd" target="_blank">atftpd man page</a>.</p>
<p>2. root@server:/# /etc/init.d/atftpd restart</p>
<p>This command will restart the deamon with the new settings.</p>
<p><strong>Testing the TFTP Server</strong></p>
<p>The final step, unless you think you are totally awesome or trust my articles, is to test the TFTP server to make sure that it works. You can accomplish this from a Windows machine by running a command similar to (the -i means binary trasnfer):</p>
<p>1. C:\tftp -i server_address put picture.gif</p>
<p>From a Linux machine, you can install tftp (apt-get install tftp).</p>
<p><strong>Other Notes</strong></p>
<p>I didn&#8217;t like the default location of /var/lib/tftpboot/ for the files to be stored. I have a directory called /datastore/ that I put all of my files into for backup purposes.</p>
<p>After attempting to configure atftpd to use a different location, such as changing the path specified in /etc/default/atftpd, I was unable to change to a new location. With that stated, I made a symbolic link in /datastore/ to point to /var/lib/tftpboot/, which is good enough for me.</p>
<p>1. root@server:/datastore# ln -s /var/lib/tftpboot/ ./tftproot</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/configure-tftp-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a Simple DNS Server with Bind9</title>
		<link>http://www.devtrends.com/index.php/setting-up-a-simple-dns-server-with-bind9/</link>
		<comments>http://www.devtrends.com/index.php/setting-up-a-simple-dns-server-with-bind9/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 01:11:33 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[bind9]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=456</guid>
		<description><![CDATA[I am starting to step outside of the Microsoft realm and into the Linux world. Imagine me balancing on my right leg which is in the Microsoft bucket, slowly and cautiously...]]></description>
			<content:encoded><![CDATA[<p>I am starting to step outside of the Microsoft realm and into the Linux world. Imagine me balancing on my right leg which is in the Microsoft bucket, slowly and cautiously testing the water in the Linux bucket with my bare left foot. Is the water too cold or is it too hot? Hmm, interestingly, the water seems to be quite pleasant.</p>
<p>Recently I migrated core functionality from my home Windows 2000 Server to a new host running ESXi 4.0 with three Ubuntu Server 9.10 VMs. If you want to see a simple diagram on my set up, view my article on <a href="http://www.devtrends.com/index.php/linux-backup-shell-script/" target="_self">Linux Backup Shell Script</a>. One of the core functionality that I migrated was my internal DNS services. Hence the title of this article, DNS Server with Bind9.</p>
<p><strong>bind9</strong></p>
<p>I am impressed, once again, with Linux and the services residing within this amazing operating system. The most amazing part about Linux services is that many of them have been around as long as I have &#8212; where have I been?</p>
<p>Before I begin rambling too much, let&#8217;s get started on creating DNS forward and reverse zones for your local network &#8230;</p>
<p>First ensure you have bind9 installed by running the following command:</p>
<pre style="padding-left: 30px;">whereis bind</pre>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/11/whereis.jpg"></a><a href="http://www.developingtrends.net/wp-content/uploads/2009/11/whereis.jpg"><img class="alignnone size-full wp-image-486" title="whereis" src="http://www.developingtrends.net/wp-content/uploads/2009/11/whereis.jpg" alt="whereis" width="523" height="36" /></a></p>
<p>If the results is blank, such as just &#8220;bind: &#8220;, then you will need to install bind9. On Ubuntu, I would imagine the command would look like this:</p>
<pre style="padding-left: 30px;">sudo apt-get install bind9</pre>
<p><strong>Forward Zones</strong></p>
<p>We need to configure your DNS forward zones, which will provide name to address resolution in your internal network. As we progress the configuration, keep in mind that your specific configuration will be slightly different than mine; adapt as needed.</p>
<p>For simple networks, such as mine at home, there are only a few changes that you will need to make for Forward lookup zones. The first file is /etc/bind/db.local.</p>
<p><span style="text-decoration: underline;">/etc/bind/db.local</span></p>
<p>The changes are fairly easy because we going to use most of what is provided in the original file. Change the Start of Authority (SOA) to be the domain environment for your network. My domain is dt.local and my primary DNS server is dtsfile.dt.local. Change the SOA to reflect your choices and also change the nameserver (NS) line to be your primary DNS server.</p>
<p>Also, you will want to add A records for your various servers/computers on the network. For this example, I added my Asterisk server:</p>
<pre style="padding-left: 30px;">dtsvoip.dt.local.	IN	A	192.168.0.11</pre>
<p>The next file to change, which we will also make changes for reverse DNS at the same time, is the /etc/bind/named.conf.default-zones file.</p>
<p><span style="text-decoration: underline;">/etc/bind/named.conf.default-zones</span></p>
<p>The line for the primary zone, which references the /etc/bind/db.local file must state your local domain in the quotes following the zone directive:</p>
<pre style="padding-left: 30px;">zone “dt.local” {
  type master;
  file “/etc/bind/db.local”;
};</pre>
<p>As we have more changes in this file, leave it open and continue to the next section.</p>
<p><strong>Reverse Lookup Zones</strong></p>
<p>As you probably know, a reverse lookup provides a name to an IP address. In Windows you would find the name of 192.168.0.10 by typing “nslookup 192.168.0.10” from a command prompt. If you have configured reverse DNS properly, you will see output similar to this:</p>
<pre style="padding-left: 30px;">C:\&gt;nslookup 192.168.0.10
Server:  dtsfile.dt.local
Address:  192.168.0.10</pre>
<pre style="padding-left: 30px;">Name:    dtsfile.dt.local
Address:  192.168.0.10</pre>
<p>You may be wondering why the entry appears twice. This is because the Server and the name that I am looking up is the same server. If I were to locate my Asterisk server, it would look like this:</p>
<pre style="padding-left: 30px;">C:\&gt;nslookup 192.168.0.11
Server:  dtsfile.dt.local
Address:  192.168.0.10</pre>
<pre style="padding-left: 30px;">Name:    dtsvoip.dt.local
Address:  192.168.0.11
</pre>
<p>On with the configuration…</p>
<p><span style="text-decoration: underline;">/etc/bind/named.conf.default-zones</span></p>
<p>If you were paying attention in the previous section you would still have that file open. Regardless, let’s add another zone to the file that represents our reverse lookup for the IP subnet in your network. In my network I use 192.168.0.0/24 which is the same as saying 192.168.0.0 with a subnet of 255.255.255.0 (192.168.0.0 to 192.168.0.255).</p>
<p>Immediately after the zone directive for your domain, add the following text for your reverse lookup:</p>
<pre style="padding-left: 30px;">zone “0.168.192.in-addr.arpa” {
  type master;
  file “/etc/bind/db.0.168.192”;
};
</pre>
<p>If you&#8217;re sharp, you’ll immediately know that the file db.0.168.192 doesn’t exist. We’ll create it next. And yes, it’s backwards; in reverse DNS lookups the IP address is reversed as part of the requirements set in the RFC and obviously for functionality pointing back to the host name of the IP. Read more: <a href="http://en.wikipedia.org/wiki/Reverse_DNS_lookup" target="_blank">http://en.wikipedia.org/wiki/Reverse_DNS_lookup</a></p>
<p>Save changes to named.conf.default-zones.</p>
<p><span style="text-decoration: underline;">/etc/bind/db.0.168.192</span></p>
<p>Next we’ll create a new zone db file for our newly created reverse lookup. Start by copying db.0 into a new file named db.0.168.192 (or whatever your local subnet IP address is).</p>
<pre style="padding-left: 30px;">cp /etc/bind/db.0 /etc/bind/db.0.168.192
</pre>
<p>Just like in your db.local file, let’s change the SOA to reflect your domain and nameserver. This includes the NS line that should already exist in the file. Now let’s add pointer (PTR) records for your servers/computers on the network. I’ll use mine for examples:</p>
<pre style="padding-left: 30px;">10	IN	PTR	dtsfile.dt.local
11	IN	PTR	dtsvoip.dt.local
</pre>
<p>Save changes to db.0.168.192.</p>
<p><strong>Forwarders</strong></p>
<p>The last section, assuming you want to use this DNS server as your primary DNS on all computers, is to set up a forwarder for all names that are not a part of your network. You will need to edit /etc/bind/named.conf.options.</p>
<p><span style="text-decoration: underline;">/etc/bind/named.conf.options</span></p>
<p>The change is really simple, uncomment the forwarders directive and modify the IP address within to be your local router or your ISP DNS servers. Mine is similar to the following:</p>
<pre style="padding-left: 30px;">forwarders {
  192.168.0.1;
};
</pre>
<p><strong>Local Name Resolution</strong></p>
<p>The final step is to change your /etc/resolv.conf file to point your DNS server and to set the domain and search realm. This is what mine looks like:</p>
<pre style="padding-left: 30px;">domain dt.local
search dt.local
nameserver 192.168.0.1
</pre>
<p><strong>Restart the bind9 daemon</strong></p>
<p>After making all of these changes, the final is to restart the bind9 daemon. Oh, one other step is to change your computers to use this DNS server as the primary.</p>
<p><strong>Configuration Files Examples</strong></p>
<p><span style="text-decoration: underline;">/etc/bind directory listing</span></p>
<pre style="padding-left: 30px;">/etc/bind# ls -la
drwxr-sr-x   2 root bind  4096 2010-08-01 17:52 .
drwxr-xr-x 141 root root 12288 2010-08-01 17:54 ..
-rw-r--r--   1 root root   237 2009-08-19 15:00 db.0
-rw-r--r--   1 root root   271 2009-08-19 15:00 db.127
-rw-r--r--   1 root bind   295 2010-08-01 17:22 db.0.168.192
-rw-r--r--   1 root root   237 2009-08-19 15:00 db.255
-rw-r--r--   1 root root   353 2009-08-19 15:00 db.empty
-rw-r--r--   1 root root   316 2010-08-01 17:14 db.local
-rw-r--r--   1 root root  2940 2009-08-19 15:00 db.root
-rw-r--r--   1 root bind   463 2009-08-19 15:00 named.conf
-rw-r--r--   1 root bind   573 2010-08-01 16:50 named.conf.default-zones
-rw-r--r--   1 root bind   165 2009-08-19 15:00 named.conf.local
-rw-r--r--   1 root bind   570 2010-07-16 11:58 named.conf.options
-rw-r-----   1 bind bind    77 2010-01-30 11:50 rndc.key
-rw-r--r--   1 root root  1317 2009-08-19 15:00 zones.rfc1918</pre>
<p><span style="text-decoration: underline;">./db.0.168.192</span></p>
<pre style="padding-left: 30px;">;
; BIND reverse data file for broadcast zone
;
$TTL    604800
@       IN      SOA     dt.local. dtsfile.dt.local. (
        1         ; Serial
   604800         ; Refresh
    86400         ; Retry
  2419200         ; Expire
   604800 )       ; Negative Cache TTL
;
@       IN      NS      dt.local.
10     IN      PTR     dtsfile.dt.local.
11     IN      PTR     dtsvoip.dt.local.
</pre>
<p><span style="text-decoration: underline;">./db.local</span></p>
<pre style="padding-left: 30px;">;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     dt.local. dtsfile.dt.local. (
        2         ; Serial
   604800         ; Refresh
    86400         ; Retry
  2419200         ; Expire
   604800 )       ; Negative Cache TTL
;
@       IN      NS      dtsfile.dt.local.
@       IN      A       127.0.0.1
@       IN      AAAA    ::1
dtsvoip.dt.local.       IN      A       192.168.0.11
</pre>
<p><span style="text-decoration: underline;">./named.conf.default-zones</span></p>
<pre style="padding-left: 30px;">// prime the server with knowledge of the root servers
zone "." {
  type hint;
  file "/etc/bind/db.root";
};</pre>
<pre style="padding-left: 30px;">// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912</pre>
<pre style="padding-left: 30px;">zone "dt.local" {
  type master;
  file "/etc/bind/db.local";
};</pre>
<pre style="padding-left: 30px;">zone "0.168.192.in-addr.arpa" {
  type master;
  file "/etc/bind/db.0.168.192";
};</pre>
<pre style="padding-left: 30px;">zone "127.in-addr.arpa" {
  type master;
  file "/etc/bind/db.127";
};</pre>
<pre style="padding-left: 30px;">zone "0.in-addr.arpa" {
  type master;
  file "/etc/bind/db.0";
};</pre>
<pre style="padding-left: 30px;">zone "255.in-addr.arpa" {
  type master;
  file "/etc/bind/db.255";
};
</pre>
<p><span style="text-decoration: underline;">./named.conf.options</span></p>
<pre style="padding-left: 30px;">options {
directory "/var/cache/bind";</pre>
<pre style="padding-left: 30px;">// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk.  See http://www.kb.cert.org/vuls/id/800113</pre>
<pre style="padding-left: 30px;">// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.</pre>
<pre style="padding-left: 30px;">forwarders {
  192.168.0.1;
};</pre>
<pre style="padding-left: 30px;">auth-nxdomain no;    # conform to RFC1035
  listen-on-v6 { any; };
};
</pre>
<p><span style="text-decoration: underline;">/etc/resolv.conf</span></p>
<pre style="padding-left: 30px;">domain dt.local
search dt.local
nameserver 192.168.0.1</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/setting-up-a-simple-dns-server-with-bind9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Backup Shell Script</title>
		<link>http://www.devtrends.com/index.php/linux-backup-shell-script/</link>
		<comments>http://www.devtrends.com/index.php/linux-backup-shell-script/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 06:39:39 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=467</guid>
		<description><![CDATA[Once again, I am pushing my knowledge limits with the Linux world. The exciting part is that, the deeper I go, the better Linux gets. Today, it is Shell scripting,...]]></description>
			<content:encoded><![CDATA[<p>Once again, I am pushing my knowledge limits with the Linux world. The exciting part is that, the deeper I go, the better Linux gets. Today, it is Shell scripting, which quite frankly puts DOS batch files out of business. Wait a moment, which came first?</p>
<p>Onward and upward, today I will share a script I use for backing files on my Ubuntu Server. To start off and to help explain what the script does, let me first explain my configuration. I have an ESXi 4.0 server with 3 VMs, all Ubuntu Server instances for Core services (DNS, DHCP, Directory services), Email (Yahoo&#8217;s Zimbra), and File (SAMBA shares, LAMP). All of the servers have 30GB primary partitions, provisioned through VMware and located on an internal 500GB SATA. The File server has a additional partition on the 500GB drive for all SAMBA shares and a partition located on an internal 1TB SATA drive that is used for backup.</p>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/11/ESX-network.jpg"><img class="alignnone size-medium wp-image-472" title="ESX network" src="http://www.devtrends.com/wp-content/uploads/2009/11/ESX-network-300x272.jpg" alt="ESX network" width="300" height="272" /></a></p>
<p>The script provides backup functionality for my music, pictures, user&#8217;s folders, et cetera to the backup drive. The secondary partition on the 500GB drive is mounted to /datashare/ and the tertiary partition on the 1TB drive is mounted to /databackup/.</p>
<p><strong>The Script</strong></p>
<pre style="padding-left: 30px;">#!/bin/sh
#####
#  backup files script, version 1.
#
#  this script keeps one tar file per month for 12 months and rsyncs the entire contents
#  to $destination/daily_replica.
#  the idea is to run this script at least once per day to ensure proper sync and monthly tar.
#
#  created by Aaron @ www.devtrends.com
#####

# location of backup files (recursive sub-folders).
backup_files="/datastore/share"

# location to place tar files and /daily_replica/ directory.
destination="/databackup/share"

#### no editing beyong this line is required!
#### function for TARing
funcTar()
{
 options="--create --file="
 echo " -- tar'ing up $1 to $2/$3"
 echo "   \ creating new archive file: $3"
 tar $options$2/$3 $1
 echo "   \ tar backup completed."
}
#### end funcion

#### CREATE MONTHLY TAR FILE
# Create new archive filename.
month=$(date +%m)
year=$(date +%Y)
archive_file="backup-$month.tar"
full_path_archive_file="$destination/$archive_file"

# do I need to create a new monthly archive file?
# check if the file exists
if [ -f $full_path_archive_file ]; then

 # get file date
 filedate=$(stat -c %y $full_path_archive_file)
 # extract only the year of the file
 filedate=${filedate:0:4}

 # check if the file year is not the current year
 if [ ! $filedate == $year ]; then

 # remove old file
 rm $full_path_archive_file
 # create new tar
 funcTar $backup_files $destination $archive_file

 else

 echo " -- no tar'ing required today."

 fi

else

 # create new tar
 funcTar $backup_files $destination $archive_file

fi
#### DONE WITH TAR

#### rsync time...
echo " -- rsync $backup_files to $destination/daily_replica"
rsync -a $backup_files $destination/daily_replica
echo "   \ rsync completed."
####</pre>
<p>If you hate copy and paste, you may download the script <a href="http://www.devtrends.com/downloads/backup_share.zip" target="_blank">here</a>.</p>
<p><strong>Explanation</strong></p>
<p>For those that care, let me explain the script. The first two variables, $backup_files and $destination, should be the only variables you will need to change if you wish to use the script as I do.</p>
<pre style="padding-left: 30px;"># location of backup files (recursive sub-folders).
backup_files="/datastore/share"

# location to place tar files and /daily_replica/ directory.
destination="/databackup/share"</pre>
<p>The next block of code is the function used to create the tar file. The reason I made it into a function is because I use the same block of code twice in the main section of the script. No reason to duplicate code. However, the way I implemented the function may cause a problem if your $backup_files or $destination variables contain spaces. If anyone would like to revised, please share. The $1, $2, et cetera, are the argument variables as passed by the calling statement.</p>
<pre style="padding-left: 30px;">funcTar()
{
 options="--create --file="
 echo " -- tar'ing up $1 to $2/$3"
 echo "   \ creating new archive file: $3"
 tar $options$2/$3 $1
 echo "   \ tar backup completed."
}</pre>
<p>Next I define some variables that I will use throughout the script. The first two are date strings that contain the month (e.g. 11) and the year (e.g. 2009). The third and fourth variables hold the location of the tar file. The tar file name is comprised of the word &#8220;backup-&#8221; and then the variable of the month.</p>
<pre style="padding-left: 30px;">month=$(date +%m)
year=$(date +%Y)
archive_file="backup-$month.tar"
full_path_archive_file="$destination/$archive_file"</pre>
<p>The main section of code is next and consists of a nested if statement. The first if statement checks if a current backup tar file exists, if not, then it will create one, otherwise it will check the status of the current backup tar file. If the current tar file modified date is not in the current year, then it removes that tar file and recreates it, otherwise there is no need to tar anything. The most interesting piece is the substring command, ${filedate:0:4} which only returns characters 0,1,2,3 from the variable $filedate. You will also notice the use of stat, which, depending on your distribution of Linux, you may need to manually acquire.</p>
<pre style="padding-left: 30px;"># do I need to create a new monthly archive file?
# check if the file exists
if [ -f $full_path_archive_file ]; then
 # get file date
 filedate=$(stat -c %y $full_path_archive_file)
 # extract only the year of the file
 filedate=${filedate:0:4}

 # check if the file year is not the current year
 if [ ! $filedate == $year ]; then
  # remove old file
  rm $full_path_archive_file
  # create new tar
  funcTar $backup_files $destination $archive_file
 else
  echo " -- no tar'ing required today."
 fi

else
 # create new tar
 funcTar $backup_files $destination $archive_file
fi</pre>
<p>The last statement is the rsync command which synchronizes the entire content of the $backup_files location to the $destination/daily_replica/ location.</p>
<pre style="padding-left: 30px;">echo " -- rsync $backup_files to $destination/daily_replica"
rsync -a $backup_files $destination/daily_replica
echo "   \ rsync completed."</pre>
<p>Use this script at your own risk. If it turns out it didn&#8217;t back up your stuff, that is entirely your problem, not mine.</p>
<p>-Aaron Gilbert</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/linux-backup-shell-script/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Linux Console Modes (80&#215;25 &#8211; really?)</title>
		<link>http://www.devtrends.com/index.php/linux-console-modes-80x25-really/</link>
		<comments>http://www.devtrends.com/index.php/linux-console-modes-80x25-really/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 04:35:04 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[zFeatured]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[VGA Modes]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=243</guid>
		<description><![CDATA[I grew up using DOS, starting with DOS 2 something. I had a father that never stuck with the default settings, which included modifying the command prompt design/colors and the...]]></description>
			<content:encoded><![CDATA[<p>I grew up using DOS, starting with DOS 2 something. I had a father that never stuck with the default settings, which included modifying the command prompt design/colors and the screen text dimensions of the DOS window. The default was 80 characters or columns wide with 25 lines or rows high, or 80&#215;25. It seems this is STILL the default setting &#8211; I guess old school video modes stick around for quite some time. Regardless, 80&#215;25 does not work for me in Linux &#8211; I have to &#8220;less&#8221; everything to be able to work with the help files, et cetera.</p>
<p><strong>VGA Mode</strong></p>
<p>For those DOS&#8217;ers, do you remember &#8220;mode 80&#8243; or &#8220;mode 40&#8243;? If you know of a quick command for Linux consoles let me know &#8230; otherwise, you can use the tip below to modify your screen resolution.</p>
<p><em><span style="text-decoration: underline;">/boot/grub/menu.lst</span></em></p>
<p>The key to changing the screen mode / screen resolution is to modify the menu.lst file and add the vga=[mode #] some where in the kernel call line &#8211; or at the end of it. After searching the Internet for some time, I compiled a list here of many of the vga modes available:</p>
<pre style="padding-left: 30px;">VGA MODE          MODE#
80x25              3840
80x50              3841
80x43              3842
80x28              3843
80x30              3845
80x34              3846
80x60              3847
320x200x8bit        816
320x200x16bit       782
320x200x32bit       783
320x240x8bit        820
320x240x16bit       821
320x240x32bit       822
640x480x8bit        769
640x480x16bit       785
640x480x32bit       786
800x600x8bit        771
800x600x16bit       788
800x600x32bit       789
1024x768x8bit       773
1024x768x16bit      791
1024x768x32bit      792
1280x800x8bit       864
1280x800x32bit      865
1440x900x8bit       868
1440x900x32bit      869</pre>
<p>On my Ubuntu Server, the kernel line was:</p>
<pre style="padding-left: 30px; white-space: pre-wrap; word-wrap: break-word;">kernel         /vmlinuz-2.6.28-11-server root=/dev/mapper/ubuntuserver-root ro quiet splash</pre>
<p>and I added vga=792 to the end of it:</p>
<pre style="padding-left: 30px; white-space: pre-wrap; word-wrap: break-word;">kernel         /vmlinuz-2.6.28-11-server root=/dev/mapper/ubuntuserver-root ro quiet splash vga=792</pre>
<p>I&#8217;m out&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/linux-console-modes-80x25-really/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenSolaris iSCSI Initiator</title>
		<link>http://www.devtrends.com/index.php/opensolaris-iscsi-initiator/</link>
		<comments>http://www.devtrends.com/index.php/opensolaris-iscsi-initiator/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 20:36:54 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[iSCSI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenSolaris]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[zFeatured]]></category>
		<category><![CDATA[Initiator]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=239</guid>
		<description><![CDATA[As part of my testing phase during the custom SAN project, I was running into performance issues with the Microsoft iSCSI Software Initiator and the OpenSolaris COMSTAR iSCSI target. Although...]]></description>
			<content:encoded><![CDATA[<p>As part of my testing phase during the custom SAN project, I was running into performance issues with the Microsoft iSCSI Software Initiator and the OpenSolaris COMSTAR iSCSI target. Although some individuals were running into significant performance issues, such as 600KB/sec writes, my problem was 30MB/sec writes with 90MB/sec reads. Regardless, that is not the point of this post &#8211; instead I am posting the commands I used for employing SUN&#8217;s iSCSI Initiator during testing between SUN&#8217;s iSCSI target and SUN&#8217;s iSCSI initiator.</p>
<p><strong>SUN iSCSI Initiator</strong></p>
<p>Obviously you need to have your network configured properly prior to working with the iSCSI initiator or targets. In this example, I was working with the iSCSI initiator and target in a lab environment, with the host (target) being 192.168.0.18 and the client (initiator) being 192.168.0.19. Secondly, you will need the iSCSI initiator software to be installed from Package Manager &#8211; easiest way is to search for iscsi and ensure all four of those packages are installed.</p>
<p>For this example we will use Send Targets for discovering iSCSI targets/paths:</p>
<pre style="padding-left: 30px;">iscsiadm add discovery-address 192.168.0.18:3260
iscsiadm modify discovery --sendtargets enable</pre>
<p>Now that you have added the discovery address of the iSCSI target and enabled the discovery &#8220;Send Targets&#8221;, check to see if your target was discovered:</p>
<pre style="padding-left: 30px;">iscsiadm list target</pre>
<p>If you saw the targets you were expecting, the next step is to create the device links between iSCSI and your system &#8211; so you can see the iSCSI LUN as a disk on your system.</p>
<pre style="padding-left: 30px;">devfsadm -i iscsi</pre>
<p>Check the available disks on your system using the format command. After running the format command, hit CTRL-C to bounce back to the terminal prompt.</p>
<p><strong>Using / Mounting the iSCSI LUN</strong></p>
<p>Now that you have the iSCSI initiator working properly and the iSCSI targets discovered, lets actually use the new iSCSI disk with ZFS.</p>
<p>First we need to create the ZFS pool using the new disk. If you forgot the name of the new disk, you can learn it using the format command. If it is anything like the one on my OpenSolaris box, the name is rather large, (c0t600144F0F9A00C0000004AA9510A0001d0):</p>
<pre style="padding-left: 30px;">zpool create diskpool c0t600144F0F9A00C0000004AA9510A0001d0</pre>
<p>To verify the pool was created, use:</p>
<pre style="padding-left: 30px;">zpool list</pre>
<p>Now we can create a ZFS file system on top of that pool:</p>
<pre style="padding-left: 30px;">zfs create diskpool/test</pre>
<p>Check your new ZFS filesystem was created:</p>
<pre style="padding-left: 30px;">zfs list</pre>
<p>And now you can create files within the mount point:</p>
<pre style="padding-left: 30px;">root@opensolaris:/diskpool/test/#</pre>
<p>Everything you write to that mount point will be written to the iSCSI target, as one would hope.</p>
<p>Good luck with your performance!</p>
<p><strong>Credits</strong></p>
<p><a href="http://wikis.sun.com/display/OpenSolarisInfo/How+to+Configure+an+iSCSI+Initiator" target="_blank">http://wikis.sun.com/display/OpenSolarisInfo/How+to+Configure+an+iSCSI+Initiator</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/opensolaris-iscsi-initiator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenSolaris iSCSI Target</title>
		<link>http://www.devtrends.com/index.php/opensolaris-iscsi-target/</link>
		<comments>http://www.devtrends.com/index.php/opensolaris-iscsi-target/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 22:05:30 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[iSCSI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenSolaris]]></category>
		<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">http://www.devtrends.com/?p=227</guid>
		<description><![CDATA[After spending a good amount of time on the iSCSI Enterprise Target (IET) solution and running into compatibility issues with VMware ESX 3.5 and 4.0, I decided to move on...]]></description>
			<content:encoded><![CDATA[<p>After spending a good amount of time on the iSCSI Enterprise Target (IET) solution and running into compatibility issues with VMware ESX 3.5 and 4.0, I decided to move on to other solutions. After reading up on the ZFS file system and how the features inclusive in ZFS would benefit any storage solution, I decided to move into the OpenSolaris world. Additionally, SUN has included their two variations of iSCSI targets in OpenSolaris and SUN provides support options. Needless to say, in my specific situation, OpenSolaris is a better solution to the “free” iSCSI target.</p>
<p>I owe some of my new-found knowledge to my friend Chuck Hechler and the remaining to Mike La Spina (<a href="http://blog.laspina.ca/">http://blog.laspina.ca/</a>). I don’t pretend to be anywhere as knowledgeable about OpenSolaris, ZFS, iSCSI, SANs, or storage in general as Mike or Chuck, however, I can create SharePoint workflow actions in VisualStudio, can they? =)</p>
<p><strong>The Equipment</strong></p>
<p>If you read my other posts on the IET and RedHat implementation, you would know that I created a custom server housed in a SuperMicro case. During the testing phase of that project, I learned that the IET product does not work well with the LSI MegaRAID 84016 controller, specifically when using RAID5. Unsure why, however, in OpenSolaris, I had an issue with our Adaptec 31605 controller and ended up using the LSI MegaRAID 84016E controller. Works like a charm. I mention this as you will need to verify that the equipment you are going to use with OpenSolaris should be supported by OpenSolaris (<a href="http://www.sun.com/bigadmin/hcl/">http://www.sun.com/bigadmin/hcl/</a>).</p>
<p>If you want more information on the hardware specifications for the system I used, please review my <a href="http://www.devtrends.com/index.php/custom-storage-server-supermicro-3u-case/" target="_self">Custom Server Case</a> article.</p>
<p><strong>OpenSolaris Configuration</strong></p>
<p>Using OpenSolaris to serve as an iSCSI target is surprisingly easy to configure. I say surprisingly because the same implementation in RedHat was thoroughly difficult, both due to a learning curve and due to many complications with functionality. On to OpenSolaris!</p>
<p>As I designed this system, I was focused on using ZFS as the sole solution for disk management and the file system. In other words, for my boot disks, I created a ZFS mirror and for the iSCSI LUN disks I created a ZFS raidz2.</p>
<p><strong><em>Installation</em></strong></p>
<p>For the most part, the default installation settings were used. Too be honest, the options during installation of OpenSolaris are limited. If you do not want the graphical interface, see my short article, <a href="http://www.devtrends.com/index.php/disable-gui-gdm-in-opensolaris/" target="_self">Disable GUI</a>, for disabling it after installation.</p>
<p><strong><em>ZFS</em></strong></p>
<p><em><span style="text-decoration: underline;">Boot pool – mirror</span></em></p>
<p>Mirroring the boot partition is about as difficult as it gets with this article. I did not figure out how to mirror the boot disk on my own. Using the steps in the following blog post, I managed to mirror my ZFS boot partition, rpool.</p>
<p><a href="http://darkstar-solaris.blogspot.com/2008/09/zfs-root-mirror.html">http://darkstar-solaris.blogspot.com/2008/09/zfs-root-mirror.html</a><br />
If you do not know the devices names of your drives, you can use “# format” to list the drives/devices on your system.</p>
<p>After the mirroring has been completed, display the status of the pool using the command and output below:</p>
<pre style="padding-left: 30px;"># zpool status
  pool: rpool
 state: ONLINE
 scrub: none requested
config:</pre>
<pre style="padding-left: 30px;"> NAME        STATE     READ WRITE CKSUM
 rpool       ONLINE       0     0     0
   mirror    ONLINE       0     0     0
     c8d0s0  ONLINE       0     0     0
     c9d0s0  ONLINE       0     0     0</pre>
<pre style="padding-left: 30px;">errors: No known data errors</pre>
<p><span style="text-decoration: underline;"><em>iSCSI pool – raidz2</em></span></p>
<p>After reading quite a few posts on best practices for ZFS pools, I propose that you use a raidz set per controller. In my instance, I had a 16 port controller and all 16 drives for the iSCSI pool were connected to this controller. Using the following commands I created a raidz2 pool with 2 spares:</p>
<pre style="padding-left: 30px;"># zpool create diskpool raidz2 c7t0d0 c7t1d0 c7t2d0 c7t3d0 c7t4d0 c7t5d0 c7t6d0 c7t7d0 c7t8d0 c7t9d0 c7t10d0 c7t11d0 c7t12d0 c7t13d0
# zpool add diskpool spare c7t14d0 c7t15d0</pre>
<p>That is it; we just created a large disk pool of 16 disks, 14 in a dual-parity set for volumes and 2 for spares. Easy? Yes.</p>
<p><span style="text-decoration: underline;"><em>Volumes</em></span></p>
<p>Best practice for creating ZFS volumes depends on your perspective. In my case, the iSCSI target will be used with VMware and I will create a new ZFS volume and iSCSI view for each VMware machine (not host). Follow the command below to create the base mountpoint in the ZFS pool:</p>
<pre style="padding-left: 30px;"># zfs create diskpool/iscsi</pre>
<p>Next we will create a volume for sharing as an iSCSI target. As I stated above, I create one volume per VM. Also, notice the “-b 64K”, which helps with partition alignment in VMware. The command “-V 40G” creates a volume with a maximum size of 40 gigabyes – keep in mind that ZFS will thin provision the file system.</p>
<pre style="padding-left: 30px;"># zfs create -s -b 64K -V 40G diskpool/iscsi/lun0_vm</pre>
<p>Display the pool and the ZFS volumes as shown below:</p>
<pre style="padding-left: 30px;"># zpool status
  pool: diskpool
 state: ONLINE
 scrub: resilver completed after 0h32m with 0 errors on Wed Sep  2 10:52:54 2009
config:</pre>
<pre style="padding-left: 30px;"> NAME           STATE     READ WRITE CKSUM
 diskpool       ONLINE       0     0     0
   raidz2       ONLINE       0     0     0
     c7t0d0     ONLINE       0     0     0
     c7t1d0     ONLINE       0     0     0
     c7t2d0     ONLINE       0     0     0
     c7t3d0     ONLINE       0     0     0
     c7t4d0     ONLINE       0     0     0
     c7t5d0     ONLINE       0     0     0�
     c7t6d0     ONLINE       0     0     0
     c7t7d0     ONLINE       0     0     0
     c7t8d0     ONLINE       0     0     0
     c7t9d0     ONLINE       0     0     0�
     c7t10d0    ONLINE       0     0     0
     c7t11d0    ONLINE       0     0     0�
     c7t12d0    ONLINE       0     0     0
     c7t13d0    ONLINE       0     0     0�
 spares
   c7t14d0      AVAIL
   c7t15d0      AVAIL</pre>
<pre style="padding-left: 30px;">errors: No known data errors</pre>
<pre style="padding-left: 30px;">  pool: rpool
 state: ONLINE
 scrub: none requested
config:</pre>
<pre style="padding-left: 30px;"> NAME        STATE     READ WRITE CKSUM
 rpool       ONLINE       0     0     0
   mirror    ONLINE       0     0     0
     c8d0s0  ONLINE       0     0     0
     c9d0s0  ONLINE       0     0     0</pre>
<pre style="padding-left: 30px;">errors: No known data errors</pre>
<pre style="padding-left: 30px;"># zfs list
NAME                             USED  AVAIL  REFER  MOUNTPOINT
diskpool                         9.9G  6.76T  51.1K  /diskpool
diskpool/iscsi                   9.9G  6.76T  48.5K  /diskpool/iscsi
diskpool/iscsi/lun0_vm     9.9G  6.76T   9.9G  -
rpool                           10.8G  62.1G  77.5K  /rpool
rpool/ROOT                      3.18G  62.1G    19K  legacy
rpool/ROOT/opensolaris          3.18G  62.1G  3.04G  /
rpool/dump                      3.75G  62.1G  3.75G  -
rpool/export                     114M  62.1G    21K  /export
rpool/export/home                114M  62.1G    21K  /export/home
rpool/export/home/vcssan         114M  62.1G   114M  /export/home/vcssan
rpool/swap                      3.75G  65.7G   101M  -</pre>
<p><strong><em>Network</em></strong></p>
<p>There are a few approaches to spreading the load across multiple links, my favorite is LACP, which is what I used – see my article on LACPBONDING. The other option that may arise in the planning phase is IPMP. However, I was unable to overcome the issue of having more than one inbound interface. If you are knowledgeable with source addressing, you will have better luck than I did.</p>
<p>I aggregated 4 gigabit links together using LACP and a Dell PowerConnect 5448 switch.</p>
<p><strong><em>iSCSI</em></strong></p>
<p>During the design phase, I tested both of SUN’s iSCSI targets, the standard iscsitadm and COMSTAR iSCSI. At this point, you can choose one based on word of mouth, or you can try both and use the one that works the best for you. I ended up using COMSTAR.</p>
<p><span style="text-decoration: underline;"><em>iscsitadm</em></span></p>
<p>The first configuration change we will make defines which interfaces the iSCSI target software will use. We accomplish this by creating a target group:</p>
<pre style="padding-left: 30px;"># iscsitadm create tpgt 1
# iscsitadm modify tpgt –i 192.168.0.101 1</pre>
<p>Because I am using link aggregation there is only one IP address to add to the group. If you decide to use multi-pathing as provided by VMware, you will need to add all of those IP addresses to the group.</p>
<p>Are you ready for the next statement, it is very complex…well, maybe not.</p>
<pre style="padding-left: 30px;"># zfs set shareiscsi=on diskpool/iscsi/lun0_vm</pre>
<p>That’s it; the ZFS volume is now served through the iSCSI target.</p>
<p><span style="text-decoration: underline;"><em>COMSTAR</em></span></p>
<p>On a default installation of OpenSolaris, you will need to install the COMSTAR iSCSI software package. Open the Package Manager and search for iSCSI, choose to install all of them, specifically the SUNWiscsit package.</p>
<p><a href="http://www.developingtrends.net/wp-content/uploads/2009/09/packagemanager.jpg"><img class="alignnone size-medium wp-image-229" title="packagemanager" src="http://www.devtrends.com/wp-content/uploads/2009/09/packagemanager-300x233.jpg" alt="packagemanager" width="300" height="233" /></a></p>
<p>After you have installed the software package, you will need to enable the COMSTAR iSCSI service:</p>
<pre style="padding-left: 30px;"># svcadm enable -r svc:/network/iscsi/target:default</pre>
<p>I am having a vague recollection that you may need to restart OpenSolaris before continuing…</p>
<p>The next configuration we will make defines which interfaces the iSCSI target software will use. We accomplish this by creating a target group and target:</p>
<pre style="padding-left: 30px;"># itadm create-tpg iscsi0 192.168.0.101
# itadm create-target –t iscsi0</pre>
<p>Now, we will share the ZFS volume through the COMSTAR iSCSI target – this is a two step process:</p>
<pre style="padding-left: 30px;"># sbdadm create-lu /dev/zvol/rdsk/diskpool/iscsi/lun0_vm</pre>
<p>Now let’s check for the new logical unit and remember the GUID… as we will use it in the next command:</p>
<pre style="padding-left: 30px;"># sbdadm list-lu</pre>
<pre style="padding-left: 30px;">Found 1 LU(s)</pre>
<pre style="padding-left: 30px;">       GUID                    DATA SIZE           SOURCE
--------------------------------  -------------------  ----------------
600144f08e6c0f0000004a8331d70002      42949607424      /dev/zvol/rdsk/diskpool/iscsi/lun0_vm</pre>
<p>Now we will add the view to share the ZFS volume through iSCSI:</p>
<pre style="padding-left: 30px;"># stmfadm add-view 600144f08e6c0f0000004a8331d70002</pre>
<p>That’s it!</p>
<p>I’m out….</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devtrends.com/index.php/opensolaris-iscsi-target/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

