<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Advogato blog for prla</title>
    <link>http://www.advogato.org/person/prla/</link>
    <description>Advogato blog for prla</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Sat, 11 Oct 2008 14:28:19 GMT</pubDate>
    <item>
      <pubDate>Sat, 5 Jul 2008 00:07:17 GMT</pubDate>
      <title>5 Jul 2008</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=132</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=132</guid>
      <description>It's been an interesting evening. Back at my parents home&#xD;
tonight (will leave back to Evora tomorrow), I've been&#xD;
trying to get the information system framework to run in the&#xD;
new Mac Mini that currently lives in my bedroom. So this&#xD;
entry goes some way towards documenting this evening's trip.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; Leopard ships with a fully functional Apache 2.2 copy and&#xD;
getting PHP5 to play along with it is a simple matter of&#xD;
uncommenting one line in &lt;code&gt;httpd.conf&lt;/code&gt;. Installing&#xD;
PostgreSQL is a breeze using &lt;a href="http://www.entropy.ch/software/macosx/postgresql/" &gt;Marc Liyanage's&#xD;
PostgreSQL package&lt;/a&gt;, not forgetting to set the cluster&#xD;
creation encoding to Latin1. This is because everything in&#xD;
the information system is Latin1 and it saves a lot of&#xD;
headaches.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; The trouble began when I noticed that Leopard didn't really&#xD;
ship with PostgreSQL bindings in its PHP5 installation. So&#xD;
basically there was no choice other than recompiling PHP&#xD;
from scratch. I tried Marc's PHP5 package which includes&#xD;
PostgreSQL support but alas it all went well until the&#xD;
installation process bombed out in the end with a cryptic error.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; So, off to compiling PHP's source which had me searching for&#xD;
the Leopard DVDs so I could install XCode's tools, namely&#xD;
&lt;code&gt;gcc&lt;/code&gt;. Once that was done, compiling PHP was a&#xD;
breeze. Problem was that once it got installed, Apache&#xD;
complained that the PHP module had the wrong architecture.&#xD;
One minute of Googling told me that Leopard's Apache comes&#xD;
pre-configured for all 4 archs and so I need to do that for&#xD;
whatever I install that interfaces with it. This is a&#xD;
prospect that clearly sucked.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; Miraculously, someone came up with a much better and hassle&#xD;
free choice: stripping the &lt;code&gt;httpd&lt;/code&gt; binary of the&#xD;
surplus architectures and leaving 32-bit only. Here's the&#xD;
magic sauce:&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; &lt;pre&gt;&#xD;
$ cd /usr/sbin&#xD;
$ sudo cp httpd httpd-fat&#xD;
$ sudo lipo httpd -thin i386 -output httpd&#xD;
&lt;/pre&gt;&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; Works like a charm.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; Et voila'. It's up and running!&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; Now I'm spent, I better crawl to bed.</description>
    </item>
    <item>
      <pubDate>Thu, 3 Jul 2008 16:31:26 GMT</pubDate>
      <title>3 Jul 2008</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=131</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=131</guid>
      <description>Adapting to development under CakePHP and the university's&#xD;
information system architecture has been slow but steady and&#xD;
really picked up today. Now I see that whatever I developed&#xD;
in the past under MVC frameworks has really been scarce. It&#xD;
obviously helped to understand the foundations of what&#xD;
models, views and controllers are but I guess I still hadn't&#xD;
grasped what they &lt;b&gt;really&lt;/b&gt; are. That, alas (or not),&#xD;
only comes with extensive exposure to somewhat complex&#xD;
system that use them. &#xD;
&#xD;
&lt;p&gt; &lt;p&gt; In any case, it's been a really interesting trip so far and&#xD;
the best side effect has been learning a lot of simple but&#xD;
neat Emacs tricks with Gon&amp;ccedil;alo, my supervisor on this&#xD;
particular project. Another important thing is that I'll&#xD;
probably be developing another information system, with &#xD;
different subject matter entirely, and the knowledge I've&#xD;
been acquiring will surely prove invaluable later on. Today&#xD;
has been somewhat of a breakthrough, as I've been&#xD;
implementing from scratch a lot of functionality which,&#xD;
despite simple at the core, were nothing but a major&#xD;
headache less than a week ago. &#xD;
&#xD;
&lt;p&gt; &lt;p&gt; And when it comes to database design, I may not come up with&#xD;
the best relational designs in the world but I surely&#xD;
understand them much more clearly. Proof is how different&#xD;
(and may I add &lt;i&gt;worse&lt;/i&gt;) a schema for a side project of&#xD;
mine was before I got to work on this stuff here and now&#xD;
that I learned a couple of things.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; Oh and I've been carrying the Macbook along to work&#xD;
&lt;b&gt;again&lt;/b&gt;. I simply cannot live without this baby and I&#xD;
guess using a shitty keyboard on the desktop also prevents&#xD;
me from really feeling comfortable. Other than that I just&#xD;
miss the comfort I find in Mac OS, regardless of my&#xD;
everlasting love for Linux, which I've used for over a&#xD;
decade now.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; It's also been two months since I started working and the&#xD;
truth is that I've done little else on the side. Football&#xD;
Manager 2008 Portuguese translation has kicked off and&#xD;
there's a web app I'd like to take a stab on but both are on&#xD;
the backburner until I get back on my feet, so to speak. The&#xD;
translation, however, I need to start as soon as possible.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; More to come. Interesting, albeit difficult tiresome and&#xD;
sometimes nerve-wrecking, times.</description>
    </item>
    <item>
      <pubDate>Wed, 25 Jun 2008 10:17:34 GMT</pubDate>
      <title>25 Jun 2008</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=130</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=130</guid>
      <description>Database engineering has always been an hassle for me and&#xD;
now I have to deal with quite a bit of it. Now I kinda like&#xD;
it and have been learning a lot. Helps to work directly&#xD;
below someone who's proficient and oozes experience. In the&#xD;
process I've also been picking up a lot of emacs tricks&#xD;
which are a huge help for productivity. This, in fact, is a&#xD;
direct result of leaving my Macbook at home now and using&#xD;
the desktop that's been assigned to me at work.&#xD;
&#xD;
&lt;p&gt; &lt;code&gt;model name	: Intel(R) Core(TM)2 Duo CPU     E4500  @&#xD;
2.20GHz&lt;/code&gt;&#xD;
&#xD;
&lt;p&gt; So, what I'm developing at work is an information system to&#xD;
manage the performance evaluation of public administration&#xD;
workers and their superiors. In Portugal, this is called &lt;a href="http://www.siadap.gov.pt/" &gt;SIADAP&lt;/a&gt;. I need to&#xD;
deliver the first part of the system, up and running, by the&#xD;
end of next week and not being entirely too productive using&#xD;
CakePHP yet is a bit of a problem.&#xD;
&#xD;
&lt;p&gt; In the meantime, my back is killing me again. I always&#xD;
predicted I'd have back problems but not when I'm bloody 24&#xD;
going on 25. I'm hoping I won't need to pay a visit to the&#xD;
osteopath this time around, but it all depends on how I feel&#xD;
later today.</description>
    </item>
    <item>
      <pubDate>Mon, 23 Jun 2008 09:50:54 GMT</pubDate>
      <title>23 Jun 2008</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=129</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=129</guid>
      <description>Forgot the damn Pattern Recognition book back in my parents'&#xD;
home. Meaning I'll have to start reading something else for&#xD;
the next couple of weeks. Strongest candidates are "&lt;a href="http://www.amazon.co.uk/Quantico-Greg-Bear/dp/0007129793/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1214214486&amp;sr=8-1" &gt;Quantico&lt;/a&gt;"&#xD;
by Greg Bear and "&lt;a href="http://www.amazon.co.uk/Life-Pi-Yann-Martel/dp/184195392X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1214214513&amp;sr=8-1" &gt;Life&#xD;
of Pi&lt;/a&gt;" by Yann Martel. I think Quantico will win by a&#xD;
nose, for now.&#xD;
&#xD;
&lt;p&gt; Hitting a wall at work, I can't seem to get the information&#xD;
system codebase checkout to properly run in my development&#xD;
machine's Apache. Something's up either with the Apache&#xD;
config or the CakePHP config itself. Either way, it's&#xD;
worrying me because I need to get up to speed as soon as&#xD;
possible and here I am wasting time not able to get things&#xD;
even running, let alone write some code.&#xD;
&#xD;
&lt;p&gt; More on this later...</description>
    </item>
    <item>
      <pubDate>Sun, 22 Jun 2008 18:38:25 GMT</pubDate>
      <title>22 Jun 2008</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=128</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=128</guid>
      <description>Hard to believe it's been this long.&#xD;
&#xD;
&lt;p&gt; Doing the lazy lazy thing for the whole weekend, not giving&#xD;
a damn about any work. Finally finished "&lt;a href="http://www.amazon.co.uk/Neuromancer-William-Gibson/dp/0006480411/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1214159164&amp;sr=8-1" &gt;Neuromancer&lt;/a&gt;"&#xD;
which was both interesting and confusing in places. I guess&#xD;
reading about technology from 1985 with over 20 years of&#xD;
real world hindisight on that same technology explains my&#xD;
confusion. SF authors are right a lot of the time, but not&#xD;
always. Nevertheless, I feel better having finally read it&#xD;
and it amazes me how much "&lt;a href="http://www.imdb.com/title/tt0133093/" &gt;The Matrix&lt;/a&gt;"&#xD;
actually resembles&#xD;
this. Now I'm reading "&lt;a href="http://www.amazon.co.uk/Pattern-Recognition-William-Gibson/dp/0140266143/ref=sr_1_15?ie=UTF8&amp;s=books&amp;qid=1214159164&amp;sr=8-15" &gt;Pattern&#xD;
Recognition&lt;/a&gt;" by the very same &lt;a href="http://en.wikipedia.org/wiki/William_Gibson" &gt;William&#xD;
Gibson&lt;/a&gt; and&#xD;
enjoying it quite a lot more, about 100 pages into it.&#xD;
&#xD;
&lt;p&gt; Work has picked up and writing information systems for&#xD;
important things in &lt;a href="http://www.cakephp.org" &gt;CakePHP&lt;/a&gt; is a mystery that&#xD;
slowly&#xD;
unfolds. I better get proficient writing web apps with this&#xD;
framework and that right soon.&#xD;
&#xD;
&lt;p&gt; Yesterday, made a detour in Lisbon to get D. to the bus&#xD;
station so she could get home for the weekend and decided to&#xD;
go to Colombo's FNAC while I was at it in order to buy&#xD;
&lt;a href="http://www.porcupinetree.com/" &gt;Porcupine Tree&lt;/a&gt;&#xD;
tickets for the October gig in Almada. While&#xD;
doing so, couldn't resist the fresh money in my wallet, so&#xD;
to speak, and got myself a couple of treats: Portishead's&#xD;
"&lt;a href="http://www.amazon.co.uk/Third-Portishead/dp/B0014C2BL4/ref=sr_1_1?ie=UTF8&amp;s=music&amp;qid=1214159688&amp;sr=8-1" &gt;Third&lt;/a&gt;"&#xD;
and Black Mountain "&lt;a href="http://www.amazon.co.uk/Future-Limited-Black-Mountain/dp/B000ZIXGFS/ref=sr_1_1?ie=UTF8&amp;s=music&amp;qid=1214159722&amp;sr=8-1" &gt;In&#xD;
The Future&lt;/a&gt;". Both are sublime&#xD;
and will surely feature in my Top 10 come the end of the&#xD;
year. Unless the second half of the year is absolutely crazy&#xD;
in terms of sheer quality.&#xD;
&#xD;
&lt;p&gt; But, alas or not, the weekend is coming to an end and I need&#xD;
to pack, shower, dine and get my ass moving back to Evora.&#xD;
Work resumes tomorrow at 9am and I never thought I'd be&#xD;
happy to have a 9-5 job, but I do. I needed the stability&#xD;
for a while.</description>
    </item>
    <item>
      <pubDate>Fri, 10 Nov 2006 08:49:09 GMT</pubDate>
      <title>10 Nov 2006</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=127</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=127</guid>
      <description>&lt;b&gt;Adventures in LDAP land&lt;/b&gt;&lt;br&gt;&lt;p&gt;

Until recently, I honestly had no idea what LDAP was all about. My work has now led to me research it a bit and implement a small sized solution for the research centre. I still have no idea what LDAP is all about, but here&amp;#8217;s some scribblings I&amp;#8217;ve gathered on the matter while we&amp;#8217;re at it.

Getting LDAP to work on Linux with the OpenLDAP tools is largely a matter of figuring out the right schemas, filling the database, and pointing things at it.

But why LDAP? When administering a network of more than trivial size, it soon becomes a pain to create and maintain user accounts. An LDAP server can be used to provide a central point of control for Unix and Samba accounts, as well as email and web server authentication.

There&amp;#8217;s always more to it than meets the eye, but in this particular instance what we want here is to have a set of workstation machines in a private subnet behind a router - which incidentally acts as the LDAP server as well - having central authentication. Basically, all user login information is stored in the server, leaving only local root (and services) accounts in each machine for administration purposes. Moreover, we want each user home directory to be remotely mounted in an external file server (the HP MSA1000 storage array I&amp;#8217;ve been blabbering about) via NFS. This last part will be covered in a forthcoming post.

Onwards to the configuration&amp;#8230; setting up LDAP involves configuring both the server and how many clients we want using LDAP authentication. In this case, we&amp;#8217;re working off a Debian system, configuration filenames can and will vary across different distributions. 

(The following is, again, in a personal notes style, if you come across this and need any further explanation, feel free to &lt;a href="mailto:&amp;#x6d;&amp;#x61;&amp;#x69;&amp;#x6c;&amp;#x74;&amp;#x6f;&amp;#x3a;&amp;#x70;&amp;#x72;&amp;#x6c;&amp;#x61;&amp;#x40;&amp;#x6e;&amp;#x65;&amp;#x74;&amp;#x63;&amp;#x61;&amp;#x62;&amp;#x6f;&amp;#x2e;&amp;#x70;&amp;#x74;" class="mail" title="&amp;#x6d;&amp;#x61;&amp;#x69;&amp;#x6c;&amp;#x74;&amp;#x6f;&amp;#x3a;&amp;#x70;&amp;#x72;&amp;#x6c;&amp;#x61;&amp;#x40;&amp;#x6e;&amp;#x65;&amp;#x74;&amp;#x63;&amp;#x61;&amp;#x62;&amp;#x6f;&amp;#x2e;&amp;#x70;&amp;#x74;" &gt;email me&lt;/a&gt; and I&amp;#8217;ll try my best to help).

&lt;strong&gt;SERVER SIDE&lt;/strong&gt;


&lt;pre class="code"&gt;
# apt-get install slapd ldap-utils
&lt;/pre&gt;
&lt;p&gt;

Configuration of these, depending on your setup and environment, should be something along these lines:


&lt;pre class="code"&gt;
Omit OpenLDAP server configuration? no
DNS domain name: ldap.example.org
Name of your organization: example_organization
Admin password: &amp;lt;administrative LDAP password&amp;gt;
Database backend to use: BDB
Do you want your database to be removed when slapd is purged? no
Allow LDAPv2 protocol? no
&lt;/pre&gt;
&lt;p&gt;

Now is probably a good time to setup some basic organizational/user/group information. This can be done either from scratch, perhaps using some app to manage LDAP, or using a basic set of LDIF (LDAP Data Interchange Files) files. See &lt;a href="http://www.moduli.net/pages/sarge-ldap-auth-howto" class="urlextern" title="http://www.moduli.net/pages/sarge-ldap-auth-howto" onclick="return svchk()" onkeypress="return svchk()" &gt;http://www.moduli.net/pages/sarge-ldap-auth-howto&lt;/a&gt; under &amp;#8220;Set Up Base Information and Test User and Group&amp;#8221; for more on this.

One nitpick, also covered in the aforementioned guide, is allowing users to change their own details, including password, as is usually possible when the accounts are stored locally. This can be achieved by editing /etc/ldap/slapd.conf and adding:


&lt;pre class="code"&gt;
access to attrs=loginShell,shadowLastChange,gecos
by dn=&amp;quot;cn=admin,dc=ldap,dc=example,dc=org&amp;quot; write
by self write
by * read
&lt;/pre&gt;
&lt;p&gt;

&lt;strong&gt;CLIENT SIDE&lt;/strong&gt;

&lt;pre class="code"&gt;
# apt-get install ldap-utils libpam-ldap libnss-ldap nscd

LDAP Server host: 1.2.3.4
The distinguished name of the search base: dc=ldap,dc=example,dc=org
LDAP version to use: 3
Database requires login? no
Make configuration readable/writeable by owner only? yes

The distinguished name of the search base: dc=ldap,dc=example,dc=org
Make local root Database admin: yes
Database requires logging in: no
Root login account: cn=admin,dc=ldap,dc=example,dc=org
Root login password: &amp;lt;enter LDAP admin password here&amp;gt;
Local crypt to use when changing passwords: md5
&lt;/pre&gt;
&lt;p&gt;

In /etc/nsswitch.conf:

&lt;pre class="code"&gt;
passwd: ldap files
group: ldap files
shadow: ldap files
&lt;/pre&gt;
&lt;p&gt;

In /etc/ldap/ldap.conf:

&lt;pre class="code"&gt;
BASE dc=ldap,dc=example,dc=org
URI ldap://1.2.3.4 # your ldap server IP here
&lt;/pre&gt;
&lt;p&gt;

Followed by /etc/init.d/nscd restart.

PAM

&lt;pre class="code"&gt;
# apt-get install libpam-passwdqc
&lt;/pre&gt;
&lt;p&gt;
Debian has a series of files in /etc/pam.d appended by common- at the beginning of their names, which are included by the other files in that directory for specific services. We can tell PAM to use LDAP for all of these services by modifying these common files.

In /etc/pam.d/common-password, comment out and replace:

&lt;pre class="code"&gt;
password required pam_unix.so nullok obscure min=4 max=8 md5
&lt;/pre&gt;
&lt;p&gt;
or:

&lt;pre class="code"&gt;
password required pam_cracklib.so retry=3 minlen=6 difok=3
password required pam_unix.so use_authtok nullok md5
&lt;/pre&gt;
&lt;p&gt;
with:

&lt;pre class="code"&gt;
# try password files first, then ldap. enforce use of very strong passwords.
password required pam_passwdqc.so min=disabled,16,12,8,6 max=256
password sufficient pam_unix.so use_authtok md5
password sufficient pam_ldap.so use_first_pass use_authtok md5
password required pam_deny.so
&lt;/pre&gt;
&lt;p&gt;
Read the pam_passwdqc man page for more about parameters you can give to it. In /etc/pam.d/common-auth comment:

&lt;pre class="code"&gt;
auth required pam_unix.so nullok_secure
&lt;/pre&gt;
&lt;p&gt;
replace with:

&lt;pre class="code"&gt;
# try password file first, then ldap
auth sufficient pam_unix.so
auth sufficient pam_ldap.so use_first_pass
auth required pam_deny.so
&lt;/pre&gt;
&lt;p&gt;/
In /etc/pam.d/common-account comment:

&lt;pre class="code"&gt;
account required pam_unix.so
&lt;/pre&gt;
&lt;p&gt;
replace with:

&lt;pre class="code"&gt;
# try password file first, then ldap
account sufficient pam_unix.so
account sufficient pam_ldap.so
account required pam_deny.so
&lt;/pre&gt;
&lt;p&gt;

And don&amp;#8217;t forget to edit /etc/libnss-ldap.conf (which, by the way, on other systems is called /etc/ldap.conf) ! That would have saved me an entire afternoon&amp;#8230; 

&lt;strong&gt;REFERENCES&lt;/strong&gt;



&lt;ul&gt;
&lt;li class="depth1"&gt;&lt;a href="http://times.usefulinc.com/2005/09/25-ldap" class="urlextern" title="http://times.usefulinc.com/2005/09/25-ldap" onclick="return svchk()" onkeypress="return svchk()" &gt;http://times.usefulinc.com/2005/09/25-ldap&lt;/a&gt;

&lt;li class="depth1"&gt;&lt;a href="http://www.moduli.net/pages/sarge-ldap-auth-howto" class="urlextern" title="http://www.moduli.net/pages/sarge-ldap-auth-howto" onclick="return svchk()" onkeypress="return svchk()" &gt;http://www.moduli.net/pages/sarge-ldap-auth-howto&lt;/a&gt;

&lt;li class="depth1"&gt;&lt;a href="http://tldp.org/HOWTO/LDAP-HOWTO.html" class="urlextern" title="http://tldp.org/HOWTO/LDAP-HOWTO.html" onclick="return svchk()" onkeypress="return svchk()" &gt;http://tldp.org/HOWTO/LDAP-HOWTO.html&lt;/a&gt;

&lt;li class="depth1"&gt;&lt;a href="http://twistedmatrix.com/users/tv/ldap-intro/ldap-intro.html" class="urlextern" title="http://twistedmatrix.com/users/tv/ldap-intro/ldap-intro.html" onclick="return svchk()" onkeypress="return svchk()" &gt;http://twistedmatrix.com/users/tv/ldap-intro/ldap-intro.html&lt;/a&gt;

&lt;/ul&gt;

&lt;p&gt;


&lt;p&gt;&lt;a href="http://granny.homelinux.org/pieceofmind/?p=145" style="color: #ccc; text-decoration: none" &gt;#&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 16 Oct 2006 15:27:15 GMT</pubDate>
      <title>16 Oct 2006</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=126</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=126</guid>
      <description>&lt;b&gt;HP MSA1000 Storage Under Linux&lt;/b&gt;&lt;br&gt;&lt;p&gt;

These are notes on some experiments setting up hardware RAID on the MSA1000 and accessing the storage space under Linux.

This MSA1000 holds five 146,8GB hard drives. We&amp;#8217;ll attempt to configure a LUN with a RAID5 disk set comprised of four drives plus a spare. Detailed information on RAID level 5 can be found at:

&lt;a href="http://en.wikipedia.org/wiki/Redundant_array_of_independent_disks#RAID_5" class="urlextern" title="http://en.wikipedia.org/wiki/Redundant_array_of_independent_disks#RAID_5" onclick="return svchk()" onkeypress="return svchk()" &gt;http://en.wikipedia.org/wiki/Redundant_array_of_independent_disks#RAID_5&lt;/a&gt;

At first, no units are configured on the MSA1000. Accessing the CLI as outlined in a &lt;a href="http://granny.homelinux.org/pieceofmind/?p=138" class="urlextern" title="http://granny.homelinux.org/pieceofmind/?p=138" onclick="return svchk()" onkeypress="return svchk()" &gt;previous post&lt;/a&gt;, we can take a look at our disk set:


&lt;pre class="code"&gt;
CLI&amp;gt; show disks
Disk List: (box,bay) (bus,ID)     Size     Units
 Disk101     (1,01)    (0,00)    146.8GB    none
 Disk102     (1,02)    (0,01)    146.8GB    none
 Disk103     (1,03)    (0,02)    146.8GB    none
 Disk104     (1,04)    (0,03)    146.8GB    none
 Disk105     (1,05)    (0,04)    146.8GB    none
&lt;/pre&gt;
&lt;p&gt;

Using the add unit command, we create the aforementioned unit using all four disks plus a spare:


&lt;pre class="code"&gt;
CLI&amp;gt; ADD UNIT 0 DATA=&amp;quot;Disk101-Disk104&amp;quot; SPARE=&amp;quot;Disk105&amp;quot; RAID_LEVEL=5
&lt;/pre&gt;
&lt;p&gt;

Now we have a unit:


&lt;pre class="code"&gt;
CLI&amp;gt; show units

Unit 0:
In PDLA mode, Unit 0 is Lun 1; In VSA mode, Unit 0 is Lun 0.
Unit Identifier   : 
Device Identifier : 600805F3-001828E0-00000000-68460002
Cache Status      : Enabled
Max Boot Partition: Enabled
Volume Status     : VOLUME OK
Parity Init Status: 10% complete
4 Data Disk(s) used by lun 0:
   Disk101: Box 1, Bay 01, (SCSI bus 0, SCSI id  0)
   Disk102: Box 1, Bay 02, (SCSI bus 0, SCSI id  1)
   Disk103: Box 1, Bay 03, (SCSI bus 0, SCSI id  2)
   Disk104: Box 1, Bay 04, (SCSI bus 0, SCSI id  3)
Spare Disk(s) used by lun 0:
   Disk105: Box 1, Bay 05, (SCSI bus 0, SCSI id  4)
Logical Volume Raid Level: DISTRIBUTED PARITY FAULT TOLERANCE (Raid 5)
                           stripe_size=16kB
Logical Volume Capacity : 420,035MB
&lt;/pre&gt;
&lt;p&gt;

When initially powered on, the MSA1000 will detect host connections and assign them the default profile of DEFAULT. This profile must be changed to Linux using the ADD CONNECTION command:


&lt;pre class="code"&gt;
CLI&amp;gt; ADD CONNECTION RX1600-1 WWPN=210000E0-8B004E53 PROFILE=LINUX
&lt;/pre&gt;
&lt;p&gt;

If all works out well, upon reboot the Linux hosts connected to the MSA1000 will then see the disk array as a single /dev/sda device, just like a regular SCSI disk. This device can then be partitioned or otherwise mangled at will. In our case, we&amp;#8217;ll be deploying a Linux LVM solution on top of it, probably with using different filesystems for different logical volumes.


&lt;p&gt;&lt;a href="http://granny.homelinux.org/pieceofmind/?p=140" style="color: #ccc; text-decoration: none" &gt;#&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 16 Oct 2006 15:00:01 GMT</pubDate>
      <title>16 Oct 2006</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=125</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=125</guid>
      <description>&lt;b&gt;Exploring Linux LVM: Part 1&lt;/b&gt;&lt;br&gt;&lt;p&gt;

Part of the challenge I&amp;#8217;ve outlined in the previous post is figuring out how to share the MSA1000 disk array between the two servers. Once that&amp;#8217;s figured out - and part of it was solved by activating the fibre channel driver in the kernel - the idea is to use the Linux LVM (Logical Volume Manager) to manage the actual available storage space on top of the MSA1000 hardware RAID. Personal notes and scribblings on the matter follow.

&lt;strong&gt;The Linux Logical Volume Manager&lt;/strong&gt;

Logical Volume Management provides benefits in the areas of disk management and scalability. It is not intended to provide fault-tolerance or extraordinary performance. For this reason, it is often run in conjunction with RAID, which can provide both of these.

Logical volume management provides a higher-level view of the disk storage on a computer system than the traditional view of disks and partitions. This gives the system administrator much more flexibility in allocating storage to applications and users.

User groups can be allocated to volume groups and logical volumes and these can be grown as required. It is possible for the system administrator to &amp;#8220;hold back&amp;#8221; disk storage until it is required. It can then be added to the volume(user) group that has the most pressing need.

When new drives are added to the system, it is no longer necessary to move users files around to make the best use of the new storage; simply add the new disk into an existing volume group or groups and extend the logical volumes as necessary.

In this particular situation the idea is to use the MSA1000 hardware RAID for fault-tolerance and reliability and doing Linux LVM on top of it for creating flexible volumes.


&lt;div align="center"&gt;&lt;a href="http://granny.homelinux.org/pieceofmind/images/lvm.gif" class="media" onclick="return svchk()" onkeypress="return svchk()" &gt;&lt;img src="http://granny.homelinux.org/pieceofmind/images/lvm.gif" class="media" border="0" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;
A sample LVM topology

Some usual LVM tasks for managing disk space:

Initializing a disk or disk partition:

&lt;pre class="code"&gt;
# pvcreate /dev/hda 			(for a disk)
# pvcreate /dev/hda1			(for a partition)
&lt;/pre&gt;
&lt;p&gt;
  
Creating a volume group:

&lt;pre class="code"&gt;
# vgcreate my_volume_group /dev/hda1 /dev/hdb1
&lt;/pre&gt;
&lt;p&gt;
This would create a volume group comprising both hda1 and hdb1 partitions.

Activating a volume group:

&lt;pre class="code"&gt;
# vgchange -a y my_volume_group
&lt;/pre&gt;
&lt;p&gt;
This is needed after rebooting the system or running vgchange -a n

Removing a volume group:

&lt;pre class="code"&gt;
# vgchange -a n my_volume_group		(deactivate)
# vgremove my_volume_group			(remove)
&lt;/pre&gt;
&lt;p&gt;

Adding physical volumes to a volume group:

&lt;pre class="code"&gt;
# vgextend my_volume_group /dev/hdc1
                                    ^^^^^^^^^ new physical volume
&lt;/pre&gt;
&lt;p&gt;                                   

Removing physical volumes from a volume group:

&lt;pre class="code"&gt;
# vgreduce my_volume_group /dev/hda1
&lt;/pre&gt;
&lt;p&gt;
The volume to remove shouldn&amp;#8217;t be in use by any logical volume. Check this by using the pvdisplay &amp;lt;device&amp;gt; command.

Creating a logical volume:

&lt;pre class="code"&gt;
# lvcreate -l1500 -ntestlv testvg
&lt;/pre&gt;
&lt;p&gt;
This creates a new 1500MB linear LV and its block device special /dev/testvg/testlv

&lt;pre class="code"&gt;
lvcreate -L 1500 -ntestlv testvg /dev/sdg
&lt;/pre&gt;
&lt;p&gt;
The same but in this case specifying the physical volume in the volume group

&lt;pre class="code"&gt;
# lvcreate -i2 -I4 -l100 -nanothertestlv testvg
&lt;/pre&gt;
&lt;p&gt;
This creates a 100 LE large logical volume with 2 stripes and stripe size 4 KB.

Removing a volume group:

The logical volume must be closed before it can be removed:

&lt;pre class="code"&gt;
# umount /dev/myvg/homevol
# lvremove /dev/myvg/homevol
&lt;/pre&gt;
&lt;p&gt;

Extending and Reducing a logical volume:

Detailed instructions on how to accomplish this for different underlying filesystems can be found here:

&lt;a href="http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html" class="urlextern" title="http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html" onclick="return svchk()" onkeypress="return svchk()" &gt;http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html&lt;/a&gt;
&lt;a href="http://tldp.org/HOWTO/LVM-HOWTO/reducelv.html" class="urlextern" title="http://tldp.org/HOWTO/LVM-HOWTO/reducelv.html" onclick="return svchk()" onkeypress="return svchk()" &gt;http://tldp.org/HOWTO/LVM-HOWTO/reducelv.html&lt;/a&gt;

In a &amp;#8220;normal&amp;#8221; production system it is recommended that only one PV exists on a single real disk. Reasons for this are outlined at:

&lt;a href="http://tldp.org/HOWTO/LVM-HOWTO/multpartitions.html" class="urlextern" title="http://tldp.org/HOWTO/LVM-HOWTO/multpartitions.html" onclick="return svchk()" onkeypress="return svchk()" &gt;http://tldp.org/HOWTO/LVM-HOWTO/multpartitions.html&lt;/a&gt;

Some useful external LVM resources:

&lt;a href="http://tldp.org/HOWTO/LVM-HOWTO/" class="urlextern" title="http://tldp.org/HOWTO/LVM-HOWTO/" onclick="return svchk()" onkeypress="return svchk()" &gt;http://tldp.org/HOWTO/LVM-HOWTO/&lt;/a&gt;
&lt;a href="http://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing-disk-space-with-lvm.html" class="urlextern" title="http://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing-disk-space-with-lvm.html" onclick="return svchk()" onkeypress="return svchk()" &gt;http://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing-disk-space-with-lvm.html&lt;/a&gt;
&lt;a href="http://www.gweep.net/~sfoskett/linux/lvmlinux.html" class="urlextern" title="http://www.gweep.net/~sfoskett/linux/lvmlinux.html" onclick="return svchk()" onkeypress="return svchk()" &gt;http://www.gweep.net/~sfoskett/linux/lvmlinux.html&lt;/a&gt;

&lt;p&gt;&lt;a href="http://granny.homelinux.org/pieceofmind/?p=139" style="color: #ccc; text-decoration: none" &gt;#&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 12 Oct 2006 10:28:01 GMT</pubDate>
      <title>12 Oct 2006</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=124</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=124</guid>
      <description>&lt;b&gt;Linux on the HP DL380 G4 and MSA1000&lt;/b&gt;&lt;br&gt;&lt;p&gt;

Lately, in what should be my part-time occupation for the next few months, I&amp;#8217;ve been setting up a couple of &lt;a href="http://h10010.www1.hp.com/wwpc/us/en/ss/WF05a/15351-241434-241475-241475-f79-397634.html" class="urlextern" title="http://h10010.www1.hp.com/wwpc/us/en/ss/WF05a/15351-241434-241475-241475-f79-397634.html" onclick="return svchk()" onkeypress="return svchk()" &gt;HP Proliant DL380 G4&lt;/a&gt; servers in addition to an &lt;a href="http://h18006.www1.hp.com/products/storageworks/msa1000/index.html" class="urlextern" title="http://h18006.www1.hp.com/products/storageworks/msa1000/index.html" onclick="return svchk()" onkeypress="return svchk()" &gt;HP MSA1000&lt;/a&gt; fibre channel disk array. The idea in this case is to have both servers (henceforth the DL380s) working independently while sharing the storage space provided on the disk array (henceforth the MSA1000) and hopefully having some sort of load balancing going on between the two. Despite some limited experience using and configuring Linux systems in the past few years, this comes as a new and refreshing challenge for me, considering these are enterprise class servers, something I&amp;#8217;ve never had a change to directly deploy from the ground up and maintain.


&lt;div align="center"&gt;&lt;a href="http://granny.homelinux.org/pieceofmind/images/dl380g4_msa1000.gif" class="media" onclick="return svchk()" onkeypress="return svchk()" &gt;&lt;img src="http://granny.homelinux.org/pieceofmind/images/dl380g4_msa1000.gif" title="Two HP DL380 G4 servers and an HP MSA1000" class="media" border="0" alt="Two HP DL380 G4 servers and an HP MSA1000" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;

DL380 G4s and the MSA1000

The next few posts are then intended to provide a first hand account of the path I&amp;#8217;ll be walking during the setup of these systems, which will hopefully be useful both for me later on and whoever comes stumbling across this page looking for information on how to setup these or similar systems. 

&lt;strong&gt;Compiling a new kernel&lt;/strong&gt;

In order to better understand and get acquainted with the servers, I&amp;#8217;ve decided to go for a test run with a Debian-based Linux distribution, called Alinex, which is developed here at the University of Evora. Later on, when most configuration stages are figured out, this will become a regular Debian installation instead of this slightly different flavour. Because the kernel that ships with Alinex is not SMP-enabled, a new kernel is needed to take advantage of the two Intel Xeon 3.8Ghz processors inside each server. There&amp;#8217;s also the need to support the fibre channel adaptar, as well as the Gigabit Ethernet adapters, etc. Fortunately, most distros attempt to have as many kernel options set for compilation as modules, so using the distro&amp;#8217;s .config file is a good idea. Later on, the goal will be to have a thin all statically compiled kernel.

The only exceptions, then, were support for the fibre channel driver and SMP. The former must have generic FC support enabled under Network Device Support and the qla2xxx driver should be configured to compile as a module (it didn&amp;#8217;t seem to work built into the kernel, as it wouldn&amp;#8217;t recognize the firmware upon boot) under SCSI Device Support and SCSI low-level drivers. This driver needs to have the firmware image placed in /usr/lib/hotplug/firmware so it gets found and used by the adapter at boot time. This image - and others for similar &lt;a href="http://www.qlogic.com/" class="urlextern" title="http://www.qlogic.com/" onclick="return svchk()" onkeypress="return svchk()" &gt;qlogic adapters&lt;/a&gt; - can be found at:

&lt;a href="ftp://ftp.qlogic.com/outgoing/linux/firmware" class="urlextern" title="ftp://ftp.qlogic.com/outgoing/linux/firmware" onclick="return svchk()" onkeypress="return svchk()" &gt;ftp://ftp.qlogic.com/outgoing/linux/firmware&lt;/a&gt;

In this case, the correct firmware image for the qla2312 adaptar is ql2300_fw.bin. This information can be found in the help page of the driver in the kernel configuration:


&lt;pre class="pre"&gt;21xx              ql2100_fw.bin 
22xx              ql2200_fw.bin
2300, 2312, 6312  ql2300_fw.bin 
2322, 6322        ql2322_fw.bin
24xx              ql2400_fw.bin 
&lt;/pre&gt;
&lt;p&gt;

&lt;strong&gt;Configuring the MSA1000 disk array&lt;/strong&gt;

Once the DL380s are up and running, attention turns to the MSA1000 disk array which needs to be setup. To do that, the easiest way seems to be using the old-fashioned serial port access method to connect to the MSA1000 command line interface (CLI) facility. In this case, HP provides a serial to ethernet RJ45Z cable, which can seem weird at first because it won&amp;#8217;t fit in a regular ethernet port. This should be connected to the front of the MSA1000 controller while the serial should obviously be connected to the host. Here, I&amp;#8217;ll be using the DL380 itself to configure the disk array.

Communication can be achieved with any terminal emulator, for instance Hyper Terminal under Windows or minicom under Linux. Both have worked for me, although minicom has a minor quirk in the default configuration which kept me from accessing the CLI at all. Also, instead of the usual 9600 baud rate, this one runs at 19200. So, minicom should be configured using the following parameters:


&lt;pre class="pre"&gt;Serial Device: /dev/ttyS0 (or whatever the serial port used happens to be)
Bps/Part/Bits: 19200 8N1
Hardware Flow Control: No (important! default is Yes)
Software Flow Control: No
&lt;/pre&gt;
&lt;p&gt;

Also, the kernel needs to support the serial port in order to do this. Once minicom is set up in this way, hitting Enter after it opens will drop you the CLI shell:


&lt;pre class="pre"&gt;CLI&amp;gt;
&lt;/pre&gt;
&lt;p&gt;

The CLI has extensive help facilities so every possible command has a verbose explanation of its doing by simply using the help command. There&amp;#8217;s also &lt;a href="http://h20000.www2.hp.com/bizsupport/TechSupport/DocumentIndex.jsp?contentType=SupportManual&amp;amp;locale=en_US&amp;amp;docIndexId=179911&amp;amp;taskId=101&amp;amp;prodTypeId=12169&amp;amp;prodSeriesId=377751" class="urlextern" title="http://h20000.www2.hp.com/bizsupport/TechSupport/DocumentIndex.jsp?contentType=SupportManual&amp;amp;locale=en_US&amp;amp;docIndexId=179911&amp;amp;taskId=101&amp;amp;prodTypeId=12169&amp;amp;prodSeriesId=377751" onclick="return svchk()" onkeypress="return svchk()" &gt;extensive documentation&lt;/a&gt; from HP on the MSA1000, in particular the &lt;a href="http://h20000.www2.hp.com/bizsupport/TechSupport/CoreRedirect.jsp?redirectReason=DocIndexPDF&amp;amp;prodSeriesId=377751&amp;amp;targetPage=http%3A%2F%2Fh20000.www2.hp.com%2Fbc%2Fdocs%2Fsupport%2FSupportManual%2Fc00683579%2Fc00683579.pdf" class="urlextern" title="http://h20000.www2.hp.com/bizsupport/TechSupport/CoreRedirect.jsp?redirectReason=DocIndexPDF&amp;amp;prodSeriesId=377751&amp;amp;targetPage=http%3A%2F%2Fh20000.www2.hp.com%2Fbc%2Fdocs%2Fsupport%2FSupportManual%2Fc00683579%2Fc00683579.pdf" onclick="return svchk()" onkeypress="return svchk()" &gt;HP StorageWorks 1000/1500 Modular Smart Array Command Line Interface User Guide&lt;/a&gt;


&lt;p&gt;&lt;a href="http://granny.homelinux.org/pieceofmind/?p=138" style="color: #ccc; text-decoration: none" &gt;#&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Sun, 2 Jul 2006 19:04:49 GMT</pubDate>
      <title>2 Jul 2006</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=123</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=123</guid>
      <description>&lt;b&gt;Catch Up&lt;/b&gt;&lt;br&gt;&lt;p&gt;

&lt;p&gt; It&amp;#8217;s been a while (again) since my last post so I guess some catching up is in order.

&lt;p&gt; First and foremost, these increasingly longer absences keep me thinking about closing down this place. I had a rationale posted on the first day for why I wanted to have such a blog and for a time it worked out. Right now, despite a lot of things going on in my life, I hardly have anything important to share with my meager audience. I&amp;#8217;ve always believed that a non-existent blog is a better thing in the so-called &amp;#8220;cyberspace&amp;#8221; than one where its author has nothing important to say, so don&amp;#8217;t be surprised (not that you would, right?) if this one ceases to exist shortly. Not much entropy getting lost, I guess.

&lt;p&gt; Anyway, the web app I&amp;#8217;ve been somewhat talking about for the past few months is still under development. Needless to say, not nearly enough time has been spent on it, at least not as much as I would have liked to give to it and definitely not as much as it needs. Still, it&amp;#8217;s usable, it&amp;#8217;s real, it already has the potential of making people&amp;#8217;s lives (a bit) easier. That&amp;#8217;s more than many can claim.

&lt;p&gt; However, we still need to take than final step, which is obviously pushing it out the door, for the world at large to pick it up at will. That&amp;#8217;s what we&amp;#8217;ve been reluctantly focusing on lately. We started using &lt;a href="http://www.37signals.net/" class="urlextern" title="http://www.37signals.net/" onclick="return svchk()" onkeypress="return svchk()" &gt;37Signals&lt;/a&gt; excellent project management web app &lt;a href="http://www.basecamphq.com/" class="urlextern" title="http://www.basecamphq.com/" onclick="return svchk()" onkeypress="return svchk()" &gt;Basecamp&lt;/a&gt;. To quote &lt;a href="http://www.coudal.com/" class="urlextern" title="http://www.coudal.com/" onclick="return svchk()" onkeypress="return svchk()" &gt;Jim Coudal&lt;/a&gt; during his keynote talk on the latest &lt;a href="http://sxsw.com/" class="urlextern" title="http://sxsw.com/" onclick="return svchk()" onkeypress="return svchk()" &gt;SXSW&lt;/a&gt;, Basecamp (and the other 37signals) take the bullshit out of communication. We&amp;#8217;ve been experiencing this first-hand, as Basecamp truly takes a uniquely simplified view of project management and developer collaboration. Everything revolves around three simple concepts: messages, TODOs and milestones. Everything else is just treading water, really, so forget about functional specifications, Gantt charts and all that mess. My chances of becoming a 37signals &lt;a href="https://gettingreal.37signals.com/" class="urlextern" title="https://gettingreal.37signals.com/" onclick="return svchk()" onkeypress="return svchk()" &gt;Getting Real&lt;/a&gt; evangelist have just increased tenfold.

&lt;p&gt; We&amp;#8217;ve also been using &lt;a href="http://www.campfirenow.com/" class="urlextern" title="http://www.campfirenow.com/" onclick="return svchk()" onkeypress="return svchk()" &gt;Campfire&lt;/a&gt; for real-time chat and that&amp;#8217;s been working out too. It&amp;#8217;s going to become important from this week on as we will be physically distant for a good three months and the project cannot stop now, of all times. Coupled with &lt;a href="http://www.writeboard.com/" class="urlextern" title="http://www.writeboard.com/" onclick="return svchk()" onkeypress="return svchk()" &gt;Writeboard&lt;/a&gt;, Campfire has everything we need to communicate effectively during project development.

&lt;p&gt; So where do we stand right now? As I said before, we&amp;#8217;re pushing for public release soon. We&amp;#8217;ve set a July 21st deadline ourselves within Basecamp and I wonder how realistic that can be. We&amp;#8217;ll try but considering how novice we both are, I seriously doubt it. We already cut a lot of features we&amp;#8217;d like to have up front, but there&amp;#8217;s a need to realise that &amp;#8220;release early, release often&amp;#8221; must leap from theory into practice. It was true for open source apps but I believe it&amp;#8217;s more true than ever when it comes to web apps nowadays.

&lt;p&gt; Personally, after a long and crappy semester at university, there&amp;#8217;s no need or reason to deny that I&amp;#8217;m very tired, kind of burnt out actually, and in need of something completely different from what I&amp;#8217;ve been doing for the past few months/years. Hopefully next year will be my last academic year (well, it must, as I&amp;#8217;ve been doing this for far too long) and then I can look forward to the rest of my life from a very different angle. I don&amp;#8217;t want to make these last five or six years sound like crap, because they weren&amp;#8217;t, but I guess it&amp;#8217;s finally taking its toll. I&amp;#8217;ve never been an easily likable person, I&amp;#8217;ve always hated going with the flow and making peace both with God and Devil at the same time. But lately it&amp;#8217;s been a downward spiral of small, mundane, average, day-to-day conflicts with people that probably don&amp;#8217;t deserve it and, most of all, conflicts inside my head. I&amp;#8217;m just dog tired of it all and for every place where my guilt is written, here&amp;#8217;s an apology.

&lt;p&gt; Well, I guess this is just the net result of these past few months of controlled insanity, of constant restarts. That&amp;#8217;s it. Tired of constantly restarting every damned day.

&lt;p&gt; There&amp;#8217;s two exams to go and then I can forget about school for a while, hopefully (and that&amp;#8217;s a long shot, for a thousand other reasons I could get into but won&amp;#8217;t) recharging my batteries for the last decisive year.

&lt;p&gt;&lt;a href="http://granny.homelinux.org/pieceofmind/?p=137" style="color: #ccc; text-decoration: none" &gt;#&lt;/a&gt;</description>
    </item>
  </channel>
</rss>
