<?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, 25 May 2013 12:33:55 GMT</pubDate>
    <item>
      <pubDate>Tue, 2 Oct 2012 10:10:31 GMT</pubDate>
      <title>2 Oct 2012</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=134</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=134</guid>
      <description>Being on the verge of getting employed by a new tech company seemed like the right time to resume writing here.&lt;br/&gt;
&lt;br/&gt;
I'm still working out details with my future employer, and it will probably be official today, if all goes to plan. I have already been assigned a task, in order to test my capabilities as a developer, which I have been doing for the past week. This, by the way, was a jQuery-based date picker to narrow the presentation of some values over time.&lt;br/&gt;
&lt;br/&gt;
In order to help me get acquainted with the codebase and getting my bearings, the company's lead developer has been of invaluable help for these past few days. It's always a great experience when you're able to learn from someone you respect and who proves to be very knowledgeable about the problems at hand.&lt;br/&gt;
&lt;br/&gt;
What I'm NOT knowledgeable about, and which has honestly been a bit discomforting, is being a Git fool. Reading &lt;a href="http://gitref.org/" &gt;The Git Reference&lt;/a&gt; is something I'm about to do.&lt;br/&gt;
&lt;br/&gt;
More news about this step of my life as I get them...</description>
    </item>
    <item>
      <pubDate>Mon, 28 Jun 2010 13:35:09 GMT</pubDate>
      <title>28 Jun 2010</title>
      <link>http://www.advogato.org/person/prla/diary.html?start=133</link>
      <guid>http://www.advogato.org/person/prla/diary.html?start=133</guid>
      <description>Oh look, after so long, Advogato is still here. Maybe I&#xD;
start jotting down some notes again, why not?</description>
    </item>
    <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>
  </channel>
</rss>
