Desgrange.net

Aller au contenu | Aller au menu | Aller à la recherche

lundi, février 8 2010

Post FOSDEM 2010

So last week-end I was at FOSDEM. First, it’s quite huge. Several thousand geeks in one location (if somebody hates open source, it’s the place to drop a bomb, lots of projects might also die afterward (I’m just saying that it’s not so cool on a risk management point of view, I’m not encouraging anybody to do such a bad thing ;-))). A lot of smart people, good ideas, interesting stuff to see, to hear and free WiFi everywhere (such thing would be illegal in France nowadays :-\).

As usual with conferences, goodies review. What do we get: - conference program (on paper) - a bag (made from biodegradable material)

That’s all good to me. Quite eco-friendy and nothing is unnecessary.

Here is the list of sessions I attended:

Welcome (FOSDEM Staff)

Quick history of the FOSDEM and of course the FOSDEM dance.

Promoting Open Source Methods at a Large Company (Brooks Davis)

Brooks Davis told us how they managed to bring some of the open source way of working in a big aerospace company. I find incredible that in a company working for aerospace (and even any company doing software) some developers are still not using any version control system.

Evil on the Internet (Richard Clayton)

Quick presentation of what “bad people” are doing on the internet and how it works, with live examples of phishing/fake banks/fake escrow websites.

Visit the AA419 website for more information.

Mozilla Europe/Mozilla Foundation (Tristan Nitot/Gervase Markham)

Some info on current status and future stuff at Mozilla. Some discussion about the ballot screen.

Personal note: the ballot screen will appear for every Windows XP/Vista/7 users how do not have installed any other web browser. This is a decision of the European Commission imposed to Microsoft. But what about people working at the European Commission? Are they going to see the ballot screen on their computers? Obviously, like in any company managing their computers, this is going to be blocked in order to keep the “homogeneity” and ease of system administration. Guess what? I am working at the EC (as external contractor). Since I’m a developer, I can install whatever I want^H^H^H^Hneed on my work computer so I don’t have the problem (and in fact since I’m doing a bit of web development I’ve all major web browsers installed). Anyway, I will see if my colleagues get some choice for their web browser.

FLOSS: a key to self-determination in Internet life (Mitchell Baker)

OK, I can’t really summarize but it was interesting. Free and open source software have values, freedom related ones (at least). To some extent we can see those values in how the internet has been built and we need to be sure that those values are still going to drive the future of the internet and even take a more predominant place.

Hackability (Tristan Nitot/Paul Rouget)

Do you want the internet to be a place only for for-profit companies to sell you their products? I hope not (if you do, what the hell are you doing here?). An important thing that will prevent that is to be sure that the internet is hackable. That mean we can do what we want with it, event if it was not designed for.

I would like to give an example of a hackable product by design: a Lego box. When you buy a Lego box, it’s shipped with a manual with one or two (sometimes more) patterns to build what Lego thinks you might want to build with. But obviously, it’s for fun, and Lego does not forbid you to do anything else with it, on the contrary, they encourage you to do stuff they didn’t think you could do with it… and it’s quite normal since Lego bricks are done to build whatever you want.

On the internet it’s quite the same. You have bricks. Different kind of bricks, versatile ones (bits and bytes) on top of which people have created more complex bricks (HTML, HTTP, SMTP, IMAP, XMPP, XML, CSS, JavaScript…) allowing you to do any kind of things. But there are some stuff that are not following that concept. Take Flash for instance, here you have the Logo box already mounted and you can’t unmount it, you can play a bit with it but not that much.

Paul did a demo showing that the web is hackable (changing the UI of a website and with the help of Firefox/Greasemonkey change how to interact with the website), that Firefox is hackable (switching from a tab to an other by shaking his wiimote!).

HTML 5 (Paul Rouget)

The “theorical” part of the presentation was done by someone else but I don’t have his name (sorry). Anyway, since most of the stuff I developed so far were web applications, I was quite interested in this presentation (and of course because I have been too lazy to check by myself what’s new in HTML 5).

HTML 5 syntax, very pragmatic. HTML has been slaughtered on so many web pages that web browsers are now very good at understanding the understandable. So of course, instead of imposing a drastic syntax (like XML based stuff requires usually) that nobody is going to apply, HTML 5 is quite “user friendly” (in the way that you can type whatever you want, it’s going to work (uppercase, lowercase, it doesn’t care, you don’t close your tags? not a problem…)). I think web browsers (except IE of course ;-)) are the perfect example of “be strict in what you send, but generous in what you receive”.

Anyway, lots of new tags like header, footer, aside, of course video, canvas

Paul did an amazing demo with a “simple webpage” turning out to be an interactive presentation with CSS transitions, video playing, 2D transformations, 3D ones… impressive.

Amarok 2.2 Rocking (Sven Krohlas)

I was an Amarok user for a long time but since I switched to the Mac it’s not the case anymore (even though Amarok runs on Mac). Anyway, the moodbar is back!

I haven’t played a lot with Amarok 2.x, but I don’t feel very comfortable with the UI. In 2.2 it’s a bit better. Maybe a part of the problem is that I don’t like KDE’s default theme.

It was a conference on free (as in free speech) softwares, but there are not only softwares that are free, there is also music. Go to Jamendo and listen/download a bit of music, you might discover good music under Creative Commons licenses (I recommend: Diablo Swing Orchestra and David TMX)

NoSQL for Fun & Profit (Tim Anglade)

A quick overview of what is NoSQL, no technical details, more a presentation for managers. Anyway, like lots of people I have suffered of SQL. For several reasons, first, it’s hard to find a project where a relational database is not badly used, a RDBMS can be very good at what it does (like PostgreSQL), it still needs to be used correctly, and secondly, because it was almost the only way “managers” did know about storing data. Who have never seen that kind of situation:

The manager: “On our new software we are going to use this programming language and that relational database.”

The developer: “I can understand that we need a programming language since we are going to write a software, but we don’t need a relational database for it.”

The manager: “Of course we need a relational database, every software use a relational database.”

The developer: “Well… no.”

The manager: “I’m the one deciding, you are only the mindless developer coding the stuff I ask so shut up.” (OK, maybe not that part)

Well anyway, NoSQL is a good idea to make sure that people know that we have choices on how we store data and that there are some ways better for some kind of tasks and others ways better for other kind of tasks.

Mozmill (Henrik Skupin)

A quick presentation of Mozmill, a tool used to do automated functional tests on Mozilla products (Firefox, Thunderbird…). Each version of Firefox in fact 225 versions of Firefox (75 languages on 3 platforms) and all of them should/need to be tested. It looks like at Mozilla they are not really in the test driven mindset (yet), and they are lacking of tests. Wait… sorry, when I say tests, I always think “automated tests”, it’s inhuman to make a person run a test suite manually, unfortunately to many people are paid for that. From what I understood they have some manual test suites for Firefox and fortunately they are trying to automate them.

You can see the mozmill generated reports for Firefox here: http://brasstacks.mozilla.com/couchdb/mozmill/_design/reports/_list/summary/summary

Towards GNUstep GUI 1.0 (Fred Kiefer)

GNUstep has been in development for ages and there is still no 1.0 version. So the question was “do we need to do one and if yes, what needs to be in”. Obviously, the answer for the first part is “yes” (so it will attract more developers, *BSD and Linux distributions will update their packages…). The second part of the question was not really solved. One proposition was to name the version 10.2 and has complete support of Cocoa 10.2.

L20n (Axel Hecht)

I’m not a specialist of internationalization (i18n) and localization (l10n), I know some issues regarding that but quite frankly, I didn’t really understood the presentation. It’s a bit more clear after a look on the l20n wiki. Sounds interesting to me since I think that the current way of doing (key/value) sucks a lot as soon as you have some non ultra-trivial stuff to do.

Étoilé: Where it is, where it’s going, why it isn’t there yet (Quentin Mathé/David Chisnall)

What have they done since the beginning in 2004? This is a project with few people but lots of ideas. One thing I find interesting is the CoreObject framework. Well in fact not the framework, but the ideas behind. From a user point of view, having to save your documents sucks. Why the default state is “in case of problem you are going to lose all your unsaved work” and not “in case of problem all your work is saved”? So here the idea is everything you change on your document is recorded, so you can do/undo/redo modification, close your document, open it again, ask to undo stuff you have done before… the history of your changes on the document have been saved all along.

Such ideas are not new, we have been talking about that for decades (well, not me, I’m talking about it only for years, I’m not that old ;-)), but mainstream operating systems are still not implementing it.

Women and Mozilla (Delphine Lebédel)

Quick presentation of WoMoz.

Nepomuk (Sebastian Trüg)

Recent operating systems are now indexing datas so it’s fast and easy to search for stuff on your computer. Nepomuk is a “semantic” way of doing so (using RDF and so on).

Several functionalities are similar between Nepomuk and what I think Étoilé’s CoreObject do. But Nepomuk is based on “standards” like RDF and SPARQL.

Mozilla Panel Discussion (Mitchell Baker/Tristan Nitot/Mark Surman)

A discussion on Mozilla’s mission. Lots of questions about privacy. I confirm, Mozilla’s people have the right mindset (at least the mindset I like) and I’m glad that they are caring about the Internet.

Write and Submit your first Linux kernel Patch (Greg Kroah-Hartman)

A live example on what you need to do and how to do a patch for the Linux kernel.

That’s all

There are several presentations I would like to went to but we still have not invented a device giving us ubiquity.

I now have a lot more thinks to thing about, I may write down some of my thoughts here soon.

Anyway, a big thank you to the FOSDEM staff for organizing all that, to all the speakers and finally to all the people attending the event.

mercredi, février 3 2010

FOSDEM 2010

FOSDEM (Free and Open Source Software Developers’ European Meeting) 2010 is happening this week-end (6-7 february) in… Brussels! At ULB, about 10 minutes by foot from home. So guess what? FOSDEM 2010

I never had the opportunity to assist FOSDEM before, so this time I’m not going to miss it.

I haven’t look at the planning seriously yet, there is a huge amount of stuff going on there, it’s going hard to make choices. At least I have seen that Mozilla is presenting some stuff, I hope I will be able to see Tristan at last (though I’m not sure it’s really fulfilling to listen to someone I always agree with (well, I’ve been reading his blog for several years now and I don’t really remember not agreeing on something)).

This reminds me I should find a way to start sharing with the community. I have been using open source softwares for years, on my day to day work, what frustrates me the most is each time I’m struggling with proprietary softwares (which I tend to avoid) while I know that the same problem with an open source software would have been solved much more easier (because of the help of the community and the availability of the source code).

So, are you coming?

lundi, août 3 2009

OpenBSD and PPPoE

I’m using a new ISP (since I moved in a different country) which does not provide a DSL modem as part of the subscription. So I bought the first ADSL2+ modem I found that was not also a router (since I have my own router).

I ended up with a D-Link DSL-320T. I was a bit disappointed to see that the modem DOES some routing… but quite poorly. I tried several configurations and my conclusion is that this modem is severely bugged. It’s based on an old BusyBox 0.60 (you can telnet the modem to see that and do some stuff manually (if you manage to…)). I went on D-Link website to find firmware updates… the firmware loaded in the modem is more recent that the ones I found on the website! Anyway, after some research, it looks like D-Link people have no clue about how to manage version numbers (it’s a complete mess), but it’s not a problem since the modem does not want to load any firmware (there is something in the interface to do that but it did nothing when I tried).

At some point I find out that the modem has a “bridged” mode, to it will does mostly nothing and I will have to do the authentication with the ISP on my OpenBSD 4.5 router.

PPPoE

Configuring PPPoE on OpenBSD is quite easy. The modem is connected to the rl0 interface, first we need to create a configuration file /etc/hostname.pppoe0 for the new PPPoE interface pppoe0:

inet 0.0.0.0 255.255.255.255 NONE pppoedev rl0 authproto pap authname LOGIN authkey PASSWORD up
dest 0.0.0.1
!/sbin/route add default 0.0.0.1

Replace LOGIN and PASSWORD with the credentials given by your ISP. The rl0 interface does not need any configuration except telling that the interface must be started. /etc/hostname.rl0 must contain only:

up

Restart network interfaces with the following command:

# sh /etc/netstart

ifconfig should now include pppoe0 configuration.

NAT and PF

I saw on some forums/mailing lists that since PF is started before the pppoe0 interface, PF might block the connection. I’m not having the problem right now, maybe for older versions of OpenBSD. Anyway, I had a different one. When PF starts, the pppoe0 interface does not have yet retrieve an IP, so PF is using “0.0.0.0”.

For instance in /etc/pf.conf, I had the following lines to create a NAT between pppoe0 and rl1 (rl1 is the interface on my local network):

ext_if="pppoe0"
int_if="rl1"

nat on $ext_if inet from $int_if:network to any -> $ext_if

In order to tell PF to monitor the external interface’s IP, it just needs to be put between brackets, so the NAT command becomes:

nat on $ext_if inet from $int_if:network to any -> ($ext_if)
Links

lundi, mai 25 2009

Moving a RAID array

I blogged about how to create a RAID-5 array with GNU/Linux in a previous entry.

So my home server is running a 4 disks array (about 500 GB each, for a total of 1.5 TB available). I used SATA disks plugged in the server. For some silly reasons I wanted to move the disks out of the server and plug them using a USB interface (no, not a eSATA one, USB (I told you, it's silly, but it could have been worse, like creating a floppy RAID array)).

I bought 4 Icy Box enclosures and a USB hub. Shut down the server, move the disks into the external enclosures, plug everything (lots of wires), switch on the server, cry.

icyboxes.jpg

As quite expected, it didn't work right away. My Debian server stopped on a maintenance shell, complaining that it was not able to check /dev/md0 (the array).

No problem, I tried a simple command:

mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1

Array assembled, exit the shell, Debian finished booting, everything works. But, in doubt, I did a reboot. Again, array not recognized. After a bit of googling and man reading, I tried the same command with a little option added:

mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 --update=homehost

Not really sure about what it did, but after rebooting, the array was recognized and assembled automatically.

So YES, you can change the controller interface used to plug your disks in an RAID array.

What about speed? Well… high speed is obviously not the purpose of this experiment ;-) (but at least it's > 30 MB/s in continuous read).

What about reliability? Well… it's Raid-5 so I might have to rebuild from time to time. So far I only get some USB reset events so transfer stall during ~20 seconds then resume. Of course I get more resets when doing a big transfer.

lundi, janvier 19 2009

Do developers need to work on fast or slow computers?

From time to time I see this question happening. When a developer is writing a software, does he need a fast or a slow computer?

Why working on a slow computer?

  • If a developer works on a slow computer, he tends to be careful about how fast is running the code he is writing. So the produced software is fast and is more testable on the developers computer.

Why working on a fast computer?

  • The developer can open all resources he needs without having to care about closing some softwares because the computer does not handle the load (I remember a colleague having 2 internet explorer opened, 3 firefox with 15 tabs opened in each of them, 3 intellij, a webserver and a database running all together on his computer).
  • A slow computer may not be the same as having the product working under heavy load.
  • The tools the developer is using may not be "optimized" and are running slowly on slow computer or computer without much memory. In general, everything is slow and increase the waiting time of the developer.
  • In case of failure/delay the developer can't use the argument of having a slow computer ;-).

When writing a software, what's important for a lot of developers is the time for compile/run/test cycle. Shorter is it, faster the developer can see the result of its work and have feedback on it. On a slow computer, this cycle is longer, the developer tends to write more code before seeing if it works, in case of test failure, the modifications may be too important to easily find out what's wrong, leading to a big loss of time.

Depending on the technologies you are working on, tools may exist to distribute some computation like compiling on computers available on your network (hoping that other developers are not compiling at the same time too). But compiling may not be the longest task. I work on a project where compile time was mostly nonexistent (everything was compiled on the fly), running 700 unit tests took around 5 seconds, running 200 functional tests took around 5 minutes. We didn't have the fastest computers but they where fast enough. Here the functional tests were taking most of the time, I think writing them so they could be distributed on other available computers would have been a bit more complicated and may have taken too much effort (the environment was not designed to be distributed). And distributing the functional tests would have completely remove the point of seeing how well worked the system under load.

So to me, giving a powerful computer to developers is not a big cost and may make their job easier. If you need to check how your software behave under load or in restricted environment (slow CPU, small memory), make appropriate tests (if this is a requirement, tests must have been written to check it).

I think the real problem about writing a fat and slow software is because having a small fast one is quite often not a requirement (you are still doing the same things with the last version of Microsoft Word on Windows Vista than what you were doing with your old Word on Windows 95, you just need a far more powerful computer now). Most of us works for companies where the goal is selling products/licensees and they need more and more features to be sold. Selling a new version having only "faster and smaller footprint" is not enough for the marketing guys, even more, it's recognizing that the previous version were fat and slow (I know it's dumb, but that's what I have seen sometimes (depending in what kind of industries you are working in)).

lundi, octobre 20 2008

Keyboards and layouts

When using eXtreme Programming (XP) as software methodology, you often get a lot of problems to put it in place (management does not agree, some developers are reluctant). But what you might not expect is having tiny annoying problems with keyboards.

One of the techniques pushed by XP is pair programming. This implies having two developers working together in front of the same computer.

At any moment only one developer is writing code (this is the driver) and the other one is reviewing the code, giving advices, making sure that the code written by the driver is following the design rules of the project, etc. (this is the navigator).

But the roles between the two developers switch frequently, or the navigator needs to write a little piece of code to show to the driver, so the keyboard is moving a lot between both of them.

Sometimes we end up having two keyboards plugged in the computer, one for each of them, like this:

pair_programming.jpg

Teams are frequently composed with people coming from different countries and having different habits and so many different keyboards layouts. I worked with an Irish guy using an American qwerty keyboard with an English layout (or vice versa), in France we usually use French azerty keyboards with French layout but I’m using an Apple international English qwerty keyboard with international English qwerty layout.

So each time you start pair programming you have to look at what kind of keyboard you are going to use (if it’s not yours) and what layout is used (and maybe change the layout each time one the developer start writing).

What I find annoying here is that even with two keyboards, you have to switch the layout because the operating system uses only one layout at a time. I have seen the same behavior on Microsoft Windows, GNU/Linux and even Mac OS X.

I’m wondering why layouts are not bound with keyboards. Maybe not a strict binding like keyboard A use only layout A and keyboard B use only layout B, but a list of layouts and the keyboards are bound with the last layout they where used with.

Maybe pair programmers are not very common, but I think that we are not the only ones with that problem. More and more laptops are sold, and quite often people use a desktop keyboard while using the laptop at home. They have to change the layout only once, but I’m sure we should avoid that (and on some operating system the task is really not easy the first time).

There are also programmable keyboards. On such keyboards you can change the code sent by each key when typing and create your own layouts. Maybe those kind of keyboards will solve the problem but they are expensive and hard to find.

Art Lebedev created the Optimus Maximus programmable keyboard where each key is an oled display. Here they solved an other problem: having one unique universal keyboard. It can be used with azerty layout, qwerty layout or anything you can imagine and each key display the characters which is going to be written.

optimus_maximus.jpg

Among others, a thing I find very interesting in the Optimus Maximus is the software to configure the keyboard :

optimus_configurator.jpg

It provides a nice interface to configure layouts. I would like that kind of interface to configure my keyboards, since they are seldom recognized correctly, some keys are always wrong, or the behavior is not exactly what I want and finding the right layout in a big list is painful.

Here is the scenario I would like to have:

  • I have a computer with an azerty keyboard plugged in and configured.
  • I plug a new keyboard on my computer.
  • A configuration window should open asking to type some keys in order to detect which kind of layout is configured (like Mac OS X does).
  • If it’s recognized as a qwerty keyboard, each time I type something on the keyboard the layout switch to qwerty.
  • If I type on the azerty keyboard, the azerty layout is used.
  • When using the qwerty keyboard I should be able to switch to an other layout, azerty for example. The last layout used for a given keyboard is bound to it until I change it.
  • A nice interface like Optimus Configurator should allow me to fine tune my layouts.

As far as I have seen until now, mainstream operating systems assume that a lot of things are unique. This situation started to change few years ago, now we can plug several keyboards, mice, screens on the same computer, but the software doing the configuration has not evolved a lot. The most common thing is having several screens. If you already tried to configure multiple screens, you may have found that it’s quite easy on Mac OS X, it’s hard on Windows and it’s really painful on Linux. The worst thing I have seen is some software considering that multiple screens equals 2 screens, with 3 screens it’s just not working and clearly not designed for. But most of the time, you can have only one keyboard/mouse configuration (you can’t have several mice with different speed configurations).

vendredi, octobre 17 2008

En vrac

Je reprends un peu le principe de Tristan Nitot pour les billets "En vrac".

  • Linus Torvalds s'essaye au blog. S'il décide de continuer, ce sera certainement un blog à suivre, surtout pour son côté très direct à donner son opinion. Manque plus que Theo de Raadt se fasse un blog lui aussi.
  • Apple vient de sortir ses nouveaux MacBook et MacBook Pro taillé dans l'alu. Intéressant de voir que pendant la présentation ils ont passé beaucoup de temps à montrer comment les ordinateurs étaient fabriqués, ce qui n'est pas dans leurs habitudes ni dans ce qui intéressait leurs cibles jusqu'à présent. Un signe de plus de la migration d'un plus large panel de personnes vers les machines d'Apple ?

vendredi, octobre 10 2008

RAID-5 software sous GNU/Linux

Petit tutorial pour monter rapidement un système en RAID-5 sous linux.

Rappel sur le RAID-5

RAID signifie "Redundant Array of Inexpensive/Independent Disks". Le but de cette technologie est d'améliorer la tolérance aux pannes d'un système de stockage en utilisant plusieurs disques durs vus comme un seul.

Dans le cas du RAID-5, il est possible de perdre un disque sans pour autant perdre des données. La perte d'un deuxième disque entraînerait, par contre, la perte de l'intégralité des données.

Le RAID-5 nécessite un minimum de 3 partitions de tailles identiques (réparties sur 3 disques différents). La taille utile du disque résultant (l'espace disque vu par l'utilisateur) est la somme des tailles des partitions moins une (soit : (nombre de paritions - 1) * taille d'une partition).

Préliminaires

La distribution linux utilisée est Debian, il vous sera donc nécessaire d'adapter ceci en fonction de celle que vous utilisez.

Le disque RAID créé n'est pas utilisé comme disque système.

Pour commencer, munissez-vous de plusieurs disques de taille identique (ici 4 disques de 500 Go) et montez les un par un dans votre ordinateur. Surtout pensez bien à identifier vos disques au fur et à mesure que vous les installez. Vous devez notez leur nom logique vu par linux et leur correspondance avec le disque physique. Ces informations vous seront utiles en cas de panne, linux vous indiquera le nom logique du disque en panne et vous devrez être capable de le repérer pour le changer.

Vous pouvez par exemple noter l'"id" ou le "path" de chaque disque lorsque vous les installez (d'où l'intérêt de les installer un par un) :

$ ls -l /dev/disk/by-id/↵
total 0
lrwxrwxrwx 1 root root  9 2008-01-20 12:45 ata-SAMSUNG_HD501LJ-S0MUJ1MPC01769 -> ../../sdc
lrwxrwxrwx 1 root root  9 2008-01-20 12:45 ata-SAMSUNG_HD501LJ-S0MUJ1MPC01770 -> ../../sde
lrwxrwxrwx 1 root root  9 2008-01-20 12:45 ata-SAMSUNG_HD501LJ-S0MUJ1MPC01771 -> ../../sdb
(…)
$ ls -l /dev/disk/by-path/↵
total 0
lrwxrwxrwx 1 root root  9 2008-01-20 12:45 pci-0000:00:12.0-scsi-0:0:0:0 -> ../../sdd
lrwxrwxrwx 1 root root  9 2008-01-20 12:45 pci-0000:00:12.0-scsi-1:0:0:0 -> ../../sde
lrwxrwxrwx 1 root root  9 2008-01-20 12:45 pci-0000:01:00.0-scsi-0:0:0:0 -> ../../sdb
(…)

Note : Le "path" dépend du branchement du disque. Si vous débranchez un disque pour le brancher sur une autre prise, son "path" changera.

Une fois tous les disques installés, il faut créer une partition de type "Linux raid autodetect" :

$ sudo fdisk /dev/sde↵
n↵ (crée une nouvelle partition)
p↵ (partition primaire)
1↵ (partition primaire numéro 1, accepter ensuite les tailles par défaut pour utiliser la totalité du disque)
t↵ (changer le type de partition)
Hex code (type L to list codes): fd↵ (change le type de partition pour "Linux raid autodetect")
w↵ (écrit la table de partition sur le disque et quitte fdisk)

Cette manipulation est donc à répéter sur chacun des disques (les miens étant /dev/sdb à /dev/sde).

Action

Entrons maintenant dans le vif du sujet, la création du disque en RAID-5.

Pour ce faire vous devez avoir l'utilitaire mdadm, à installer avec la commande suivante si vous ne l'avez pas :

$ sudo apt-get install mdadm↵

Création du d'un disque en RAID-5 logiciel à partir de mes 4 disques sdb, sdc, sdd et sde :

$ sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1↵

Voilà, c'est fini.

Conclusion

Les préliminaires sont toujours plus long.

Plus sérieusement, un disque "virtuel" a été créé (ici c'est /dev/md0). C'est ce disque qu'il faut monter (et formater) pour profiter de votre tout nouveau disque RAID.

Pour vérifier son état :

$ sudo mdadm --detail /dev/md0↵
/dev/md0:
        Version : 00.90.03
  Creation Time : Sat Jan 19 17:03:46 2008
     Raid Level : raid5
     Array Size : 1465151808 (1397.28 GiB 1500.32 GB)
  Used Dev Size : 488383936 (465.76 GiB 500.11 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0
    Persistence : Superblock is persistent  

    Update Time : Sun Jan 20 15:49:00 2008
          State : clean
 Active Devices : 4 
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : 02918692:35547ed8:6ec71e01:ff96950c
         Events : 0.34

    Number   Major   Minor   RaidDevice State
       0       8       49        0      active sync   /dev/sdd1
       1       8       65        1      active sync   /dev/sde1
       2       8        1        2      active sync   /dev/sdc1
       3       8       17        3      active sync   /dev/sdb1

Il est important que la ligne "State" affiche "clean" et que la colonne "State" affiche "active sync" pour chaque disque. Juste après la création du volume RAID, l'état doit ressembler à "clean, degraded, recovering", c'est normal, le système est en train de synchroniser les disques entre eux (cette étape peut être assez longue, quelques heures avant d'arriver à "clean"). Pour voir l'avancement de la synchronisation :

$ cat /proc/mdstat↵

Maintenant il fait surveiller l'état du disque régulièrement, il ne faut pas attendre qu'il ne marche plus pour s'inquiéter, il sera déjà trop tard (2 disques seront déjà tombés).

Par défaut (voir le fichier /etc/mdadm/mdadm.conf) mdadm envoi un mail à l'utilisateur "root" en cas de problème, je vous conseille de configurer cette propriété pour que le mail soit envoyé à une adresse email que vous lisez régulièrement.

Lorsque le système est "clean", vous pouvez stopper un des disques pour simuler une panne, vérifier que vous recevez bien une alerte par email. Redémarrez ensuite le disque (et attendez plusieurs heures le temps que le système redevienne "clean") :

$ sudo mdadm /dev/md0 --fail /dev/sdb1↵ (déclare le disque sdb1 "en panne")
$ sudo mdadm /dev/md0 --add /dev/sdb1↵ (ajoute le disque sdb1 au système RAID, la synchronisation reprend immédiatement)

Je vous conseille fortement de lire la documentation pour bien comprendre comment tout fonctionne.

Si vous avez déjà un volume RAID en place et que vous voulez l'étendre en rajoutant un disque, apparemment c'est possible : http://scotgate.org/?p=107.

Bon courage.