StoWiki/ Blog'n'Roll Archive

Latest entries

Debian Signs @ DebConf 9

I have not blogged about until now, but I'm in Cáceres since last Thursday, where jordi and I came by car from Valencia to attend the DebConf 9.

I'm not doing any Debian work here, but I'm having a good time socializing meeting and talking with a lot of people and attending some of the talks and BOFs.

Yesterday we went to the Valle del Jerte for the Day Trip, where we did a short walk and got to Los Pilones, where we saw a lot of natural pools between the mountains where we swimmed (I loved a small cascade that was like a natural hydro massage system) and stayed there for a couple of hours until we had to go back to the bus to visit another natural pool on the village of Jerte, that time a big one built inside the river that was also very nice.

Anyway, what I wanted to say is that yesterday's Day Trip was another good example of how the Debian Project helps its users and developers; when we were walking back from the mountains to pick the bus we found Debian people on a cross road telling us what was the right way and after a little while we found a Debian Sign on the floor:

Day Trip Go

We followed the advice and we confirmed that it was a shortcut in our way down, obviously installed there by someone from the Debian Project.

Posted Tue 28 Jul 2009 11:44:29 CEST
Free Software Summer

On recent years I've only been in one or two free software related conferences per year, usually because I've been invited to go for a day or two and give a talk.

The truth is that my day to day activities don't leave me enough time to contribute or participate a little bit more in free software projects, but this year I decided (and negotiated) that I had to go to Debconf, as it is the best opportunity to go to a Debian conference that I'm going to have in the near future.

So this summer it is going to be a free software summer, the 3rd of July I'll be giving a talk at the Jornades de Programari Lliure in Barcelona and from the 23th to the 30th or 31th I'll be at Debconf 9 in Cáceres.

In Barcelona I will talk about building IT infrastructures using free software, explaining which programs I use, why I've choosen them and how I configure things depending on my needs and in Cáceres I will be just listening and exchanging gpg keys.

Posted Wed 17 Jun 2009 07:59:19 CEST
Encrypting a Debian GNU/Linux installation (take 3)

After my followup to the Tuesday post I've received some additional comments and I'm writing this entry to close the subject... ;)

One of the comments was from Gunnar to tell me that the followup setup was the same provided by the automatic partitioner of the Debian Installer since 2007.

I was unaware of that because until some weeks ago I never tried to install a system with encryption support and when I did it on my laptop I used the manual setup because I wanted to keep the MacOS X partitions.

Anyway my followup blog entry made sense anyway, as I just wanted to comment my thoughts about the advantages and disadvantages of each partitioning schema.

I also received a couple of messages proposing the use of three layers to keep the flexibility of the original setup and the simplicity of the second; the setup is as follows:

With the LVM at the lower level you get the advantages of my setup (mix encrypted and unencrypted partitions, the crypted volume can use multiple physical volumes, etc.) and the advantages of the second setup (only one key for all the encrypted file systems).

I believe that this setup is a little too much for a laptop, but can be a good option if you need encrypted file systems on a server.

Posted Thu 26 Feb 2009 08:30:16 CET
Encrypting a Debian GNU/Linux installation (followup)

Yesterday I received a mail message from a Debian user called Ekrem Erdem about my previous post, proposing a different partitioning schema that I found interesting.

The basic idea is to swap the order of the technologies, that is, use LVM on top of an encrypted partition instead of encrypting logical volumes.

I never thought about this schema because I always use LVM on servers and that is one of the fist things I setup (just after software RAID-1, if the machine has two hard drives); when I was evaluating how to setup my system for encryption I started with the LVM setup and never looked back.

The advantage of this setup is that there is only one pass phrase (the one used to unlock the encrypted partition, sda4 in my case), eliminating the need of derived keys (i. e. my swap setup) or key files (I use them to mount snapshots of the encrypted partition non interactively).

On the negative side I believe that this setup looses some flexibility:

Anyway if the plan is to encrypt all the file systems on a laptop the proposed setup is simpler and, IMHO, as safe as my configuration (remember that my keys are related).

I'm not going to change my setup now (it works great), but I'll probably try this one in the future if I need an encrypted setup on a different machine.

Posted Wed 25 Feb 2009 00:42:30 CET
Encrypting a Debian GNU/Linux installation on a MacBook

A couple of weeks ago I updated my Debian Sid setup on the MacBook to use disk encryption; this post is to document what I did for later reference.

The system was configured for dual booting Debian or Mac OS X using refit and grub2 as documented on the Debian Wiki; I don't use the Mac OS X system much, but I left it there to be able to test things and be able to answer questions of Mac OS X users when I have to.

The Debian installation was done using two primary partitions, one for swap (I used a partition to be able to suspend to disk without troubles) and an ext3 file system used as the root file system.

The plan was to use the Debian Installer to do the disk setup and recover the Sid installation from a backup once the encrypted setup was working OK.

Backup for later recovery

My first step was to install all the needed packages on the original system; basically I verified that I had the lvm2 and cryptsetup packages installed.

The second step was to backup the root file system; to do it I changed to run level 1 and copied the files to an external USB disk using rsync.

My third step was to boot into Mac OS X to reduce the space assigned to it; I had a lot of free space that I didn't plan to use with Mac OS X and I thought that this was the best occasion to reassign it to the Debian file system.

Encrypted Lenny installation

Now the machine was ready for the installer. As I formatted the system a couple of weeks ago I used a daily build of the Lenny Debian Installer, now that Lenny is out I would have used the official version.

I booted the installer and on the partition disk step I selected the manual method; I left sda1 and sda2 as they were (the Mac OS X installation uses them) and set up sda3 and sda4 as follows:

Note that I decided to put /boot on a plain ext3 partition to be able to use grub2 as the boot loader (if we put the kernel on an LVM logical volume we need to use lilo as the boot loader).

Once sda4 was adjusted as LVM I entered on the LVM setup and created a LVM Volume Group (VG) with the name debian, using sda4 as the physical volume.

Once the VG was defined I created a couple of Logical Volumes (LV):

I left some space unallocated to be able to create LVM snapshots (I use them to do backups, I'll post about it on the next days).

Once the LV were ready I finished with the LVM setup and went back to the partitioner to configure the Logical Volumes:

Once both encrypted volumes were ready I entered on the Configure the encrypted volumes menu and the installer formatted the volumes for encryption and asked for the debian-root pass phrase.

Back on the main partitioning menu I set up the debian-root_crypt encrypted volume:

I didn't need to touch the debian-swap_crypt, it was configured automatically as swap because I choose a random encryption key.

At this point I was finished with the partitioning; to finish I installed a minimal system and rebooted to try the system.

As I had changed the disk layout I had to re-sync the partition tables from refit; once that was done I was able to boot from the newly installed system.

Setting up suspend to disk

I was using s2disk to suspend the system; to test if it still worked with the new setup I installed the uswsusp package and adjusted the resume device on the /etc/uswsusp.conf to /dev/mapper/debian-swap_crypt.

After my first try I noticed that the resume step failed with the encrypted swap partition because it was using a random key, which means that the swap contents are unrecoverable after a reboot.

Looking at the cryptsetup documentation I found that the solution was to use a derived key for the swap partition instead of a random one.

The command sequence was as follows:

# disable swap
swapoff -a
# close encrypted volume
cryptsetup luksClose debian-swap_crypt
# change the swap partition setup on the /etc/crypttab file
sed -e -i 's%^debian-swap.*%debian-swap_crypt /dev/mapper/debian-swap debian-root_crypt cipher=aes-cbc-essiv:sha256,size=256,swap,hash=sha256,keyscript=/lib/cryptsetup/scripts/decrypt_derived,swap%' /etc/crypttab
# open the encrypted volumes with the new setup
/etc/init.d/cryptdisks start
# enable swap
swapon -a
# update the initrd image
update-initramfs -u

After executing all those commands the suspend to disk system worked as expected.

Recovering the original system

If I were going to reinstall the system completely I would have finished here, but in my case I wanted to recover my original system setup (except the minimal changes required to use the encrypted passions, of course).

To recover my old installation I backed up some files (/etc/fstab, /etc/crypttab, /etc/uswsusp.conf and the current /boot contents to be able to boot in case of failure with my old kernel) from the current installation, after that I recovered all the files from the initial backup (except the ones just saved) using rsync again and regenerated the initrd images of my old kernels:

update-initramfs -u -k all

After that I rebooted and everything worked as on my original installation (except for the disk encryption, of course).

Posted Sun 22 Feb 2009 00:11:52 CET

List of all entries

Debian Signs @ DebConf 9
Posted Tue 28 Jul 2009 11:44:29 CEST

Free Software Summer
Posted Wed 17 Jun 2009 07:59:19 CEST

Encrypting a Debian GNU/Linux installation (take 3)
Posted Thu 26 Feb 2009 08:30:16 CET

Encrypting a Debian GNU/Linux installation (followup)
Posted Wed 25 Feb 2009 00:42:30 CET

Encrypting a Debian GNU/Linux installation on a MacBook
Posted Sun 22 Feb 2009 00:11:52 CET

My first nginx module
Posted Thu 18 Sep 2008 10:58:11 CEST

Hugo meets Marc
Posted Sat 23 Aug 2008 09:21:28 CEST

Marc
Posted Fri 22 Aug 2008 12:17:32 CEST

Summertime, change times
Posted Thu 14 Aug 2008 09:49:16 CEST

Redmine
Posted Sat 01 Mar 2008 09:59:45 CET

Tips & Tricks: plone, nginx and path rewriting
Posted Thu 28 Feb 2008 03:11:38 CET

Still Alive
Posted Mon 25 Feb 2008 21:38:42 CET

Lifestyle, Resignations and the Peter Principle
Posted Tue 07 Aug 2007 22:04:39 CEST

Pending sysadmin posts
Posted Fri 15 Jun 2007 00:55:32 CEST

DebConf 7 - sto 0
Posted Thu 14 Jun 2007 23:44:35 CEST

Four More Years of Bread and Circus
Posted Mon 28 May 2007 10:12:45 CEST

2nd gvSIG Conference
Posted Fri 24 Nov 2006 00:54:03 CET

Spammers
Posted Fri 11 Aug 2006 08:42:40 CEST

Moved to ikiwiki
Posted Wed 09 Aug 2006 22:51:54 CEST

Debian Tutorial @ the V Jornades de Programari Lliure
Posted Fri 30 Jun 2006 13:02:08 CEST

ikiwiki
Posted Mon 15 May 2006 11:25:00 CEST

Ridiculous
Posted Tue 09 May 2006 14:45:26 CEST

SoC and CDDT
Posted Thu 04 May 2006 20:10:36 CEST

Life goes on
Posted Thu 23 Mar 2006 23:28:06 CET

Life after the Public Administration
Posted Tue 28 Feb 2006 12:04:48 CET

Three days left at LliureX
Posted Fri 24 Feb 2006 00:40:22 CET

Shell Scripts Frontend Tool 0.9.2
Posted Sun 19 Feb 2006 21:15:21 CET

Shell Scripts Frontend Tool
Posted Tue 14 Feb 2006 21:50:54 CET

IICISL Slides
Posted Fri 10 Feb 2006 20:59:21 CET

II Open Source World Conference and the CDDT
Posted Sat 04 Feb 2006 00:07:45 CET

Tired and Burn Out
Posted Fri 03 Feb 2006 21:21:44 CET

La MaratOO'o 2.0.1
Posted Mon 28 Nov 2005 10:39:16 CET

Desktop Environments and Window Managers
Posted Tue 25 Oct 2005 15:02:15 CEST

The Power of Kabbalah
Posted Thu 13 Oct 2005 14:09:25 CEST

I Hate Hardware
Posted Wed 28 Sep 2005 19:52:19 CEST

LliureX Installer (Part 2)
Posted Sat 24 Sep 2005 01:25:56 CEST

LliureX Installer (Part 1)
Posted Tue 20 Sep 2005 12:19:53 CEST

zsh and baz
Posted Fri 19 Aug 2005 12:25:55 CEST

debian-installer and l10n
Posted Fri 05 Aug 2005 02:28:12 CEST

IV Jornades de Programari Lliure
Posted Sun 10 Jul 2005 00:22:09 CEST

Etch
Posted Tue 07 Jun 2005 10:04:47 CEST

Debian GNU/Linux 3.1 released
Posted Mon 06 Jun 2005 23:57:30 CEST

Comments re-enabled
Posted Sat 28 May 2005 21:09:31 CEST

Uff
Posted Wed 18 May 2005 14:38:18 CEST

CDD Dev Camp
Posted Tue 10 May 2005 20:40:33 CEST

Malas lenguas tour 2005
Posted Tue 10 May 2005 14:31:53 CEST

LliureX and the II Free Software Congress, Valencian Community
Posted Tue 10 May 2005 00:46:49 CEST

Sarge frozen!
Posted Wed 04 May 2005 00:54:30 CEST

Who's the man?
Posted Tue 03 May 2005 00:07:09 CEST

CDD Development Camp
Posted Wed 20 Apr 2005 23:21:07 CEST

No Banana Union, No Software Patents - Suppory Denmark!
Posted Mon 07 Mar 2005 17:43:22 CET

Guadalinex, Ubuntu and the Debian future
Posted Mon 07 Feb 2005 09:41:17 CET

shfs and hardware detection
Posted Fri 07 Jan 2005 00:44:00 CET

New year, new server
Posted Wed 05 Jan 2005 01:20:03 CET

Hugo
Posted Mon 20 Dec 2004 16:38:23 CET

Two customization models
Posted Mon 13 Dec 2004 08:09:17 CET

CDD Tool Proposal
Posted Tue 07 Dec 2004 12:10:03 CET

A good summary of the Debian release proposals
Posted Wed 01 Dec 2004 21:15:47 CET

Second Ubuntu Conference @ Mataró
Posted Tue 30 Nov 2004 10:49:44 CET

Computer Science Engineers
Posted Sun 07 Nov 2004 23:45:00 CET

More Custom Debian Distribution Players
Posted Sun 03 Oct 2004 14:07:15 CEST

Back from Florence
Posted Tue 28 Sep 2004 01:49:00 CEST

Going to Firenze World Vision 2004 workshop on CDD
Posted Fri 24 Sep 2004 09:38:01 CEST

Ubuntu release model and Debian
Posted Mon 20 Sep 2004 01:39:21 CEST

Summer's over, let's roll again
Posted Thu 02 Sep 2004 01:18:13 CEST

The LliureX classroom model
Posted Tue 27 Jul 2004 12:55:32 CEST

Canonical Software and Mark Shuttleworth
Posted Sun 25 Jul 2004 19:14:32 CEST

My Master Thesis and the 2nd OCS Online Congress
Posted Fri 23 Jul 2004 20:16:58 CEST

Going Wireless
Posted Wed 14 Jul 2004 14:30:31 CEST

Second day at Manresa
Posted Thu 08 Jul 2004 20:17:00 CEST

First Day At Manresa
Posted Wed 07 Jul 2004 21:54:00 CEST

High School Teacher Competitive Examination (Update 2)
Posted Mon 05 Jul 2004 22:37:29 CEST

High School Teacher Competitive Examination (Update 1)
Posted Fri 02 Jul 2004 20:20:23 CEST

My Sarge GR Vote
Posted Fri 02 Jul 2004 20:06:41 CEST

High School Teacher Competitive Examination
Posted Tue 29 Jun 2004 19:20:35 CEST

Communication channels
Posted Tue 22 Jun 2004 00:13:23 CEST

CIA Open Source Notification System
Posted Fri 18 Jun 2004 00:48:32 CEST

First Post
Posted Wed 16 Jun 2004 22:16:02 CEST