Search Results: "luk"

25 August 2007

Michael Prokop: Debian @ Froscon 2007

The Debian-Team at the Debian-booth of Froscon 2007: Debian-Team at Froscon 2007, picture Standing (from left): Bernd Zeimetz, Thomas ‘MrFai’ Lange, Sebastian Harl, Elmar Hoffmann, Martin Zobel-Helas, Luk Claes;
Sitting in the middle: Christoph ‘myon’ Berg

7 August 2007

Neil McGovern: And the winner is...

MJ Ray posted a couple of short summaries as to how the election would have turned out if alternate voting systems had been used. A couple of people asked about others, so here's a nice long list:

Borda,
Borda Elimination,
Minmax,
Nanson,
Ranked Pairs,
Condorcet (SPI),
Condorcet (Debian):
Bucklin:
IRV,
Pluralty:
Most of these seem to come out in favour of the result we achieved with Condorcet. Plurality (aka: First past the post) and IRV put heavy emphisis on the voters first choice. It doesn't really make sense to compare results from a condorcet ballot with either of these methods. Bucklin is rather meaningless in a multi-winner election.

In answer to "is this type of Condorcet ever likely to elect someone who polarises views", it's possible, but unlikely. IRV and Pluralty are the ones to go for if you want the majority of people unhappy, unlike the others, which produce the majority of people happy.

MJ Ray: SPI Election Results

I wasn't elected to SPI's board. I didn't think I would be once I saw all the other candidates (I nominated before all declared), but it looks like I would have been elected with those votes under some other common systems. I think both first-past-the-post and alternative vote (also known as instant run-off voting, reportedly recommended by Robert's Rules for election-by-mail) would have resulted in this same board:
  1. Bdale Garbee
  2. David Graham
  3. Joshua D. Drake
  4. Martin 'Joey' Schulze
  5. Luk Claes
  6. MJ Ray
Instead, the results were:
  1. Bdale Garbee
  2. David Graham
  3. Luk Claes
  4. Joshua D. Drake
  5. Joerg Jaspert
  6. Martin Zobel-Helas
Nevertheless, well done to the new members. On one hand, I'm happier, because there's still two of my top four there and now I've less required work. On the other hand, I would have liked a crack at it myself and both boards are disappointing because there's no Ian Jackson. An interesting thing is how many times I appear in each position in voting lists: (5, 1, 2, 1, 9, 6, 6, 3, 3, 4, 2, 9, 37), or as a bar chart:
  1. st
  2. nd
  3. rd
  4. th
  5. th
  6. th
  7. th
  8. th
  9. th
  10. th
  11. th
  12. th
  13. th
A fairly acceptable middle-of-road candidate for most of it, but then a huge spike at the low end. Note that a majority of voters put me in positions 11-13. There wasn't much warning of that one coming during hustings. WTF? There seem to be some 30 or 40 voters who really dislike me, but didn't tell me that straight, preferring to be silent then vote me down. Are you cowards, or what? More generally, is this type of Condorcet ever likely to elect someone who polarises views, or who many inexplicably dislike? What does this say for any plan to use a Condorcet for debian's social committee? Could majorities always prevent minority reps? Update: Neil McGovern posted a few comparisons of more complex systems (I only did the easy ones) and AJ posted STV results which completes the main systems, I think. It seems Condorcet-SPI wasn't as unusual as I first thought. Finally, as I understand it, turn-out was 25% of voting members (not the 25% of SPI members that some press reported). Why was turn-out so low? (2007-08-08: 1 pingback, 3 comments)

27 July 2007

Michael Prokop: Linux on the Lenovo Thinkpad X61s

Lenovo X61s - picture Since about two days I’m proud owner of a Lenovo X61s notebook. It will become my main and new developer box for grml, featuring all that nifty stuff like 64bit support, hardware virtualization and so on… I managed to use all the important features with a very current version of grml. I’m using kernel 2.6.22-grml on a setup with LVM, cryptsetup-luks,… everything works fine so far (including Suspend-To-RAM - even in grml live-mode when booting from USB pen :-) - thanks for the excellent hibernate package, madduck!). As you won’t find useful and approriate information about Linux on the X61s yet (either pretty incomplete or wrong) I decided to put all relevant information on a webpage in the grml-wiki: Short version: the X61s rocks. I’ll provide information to thinkwiki as soon I checked out all the details…

1 July 2007

Mike Hommey: Google Keywords - May & June 2007

“12 years old harddisk” - I don’t own any that old.
“dead browsers” - I see them.
“dm-crypt luks header size partition block device” - 1032 blocks for 128bit keys and 2056 for 256bit ones.
“ebtables vmware server” - I’d like it too.
“fact on what horse represents” - We definitely have a recurring theme.
“hobbit debian install” - I didn’t know Debian was popular in the Shire.
“i agree with you blog” - I don’t
“perverts” - Where ?
“what kind of files are needed to installed properly a psp7 plugin” - damn, how did you end up here ?
“what version of debian 4 do we use” - hum… 4 ?

24 June 2007

Mike Hommey: Playing more with LVM, LUKS and the device mapper

Following my previous entry about playing around with LVM, LUKS and the device mapper, I documented myself about internals involved in pvmove, which is more of a challenge, considering there is no such documentation. I could find no useful documentation for either the device mapper or LVM. A bit of good old UTSL later, I could elaborate how to do what I wanted, and realized it was even possible to do in shell script. So here you are : a shell script to transform an LVM physical volume to a LVM over LUKS physical volume,. I’ll detail in between how it works. As the previous script, use at your own risk, it comes with no warranty.
Note you theorically can still access the filesystems underneath without problems. It’s an in-place and live conversion. Also note this is more a proof of concept than a proper, risk-less and well-written solution.

set -e
dev=$1
luks=$(mktemp)
cryptdev=$(basename $dev)_crypt
pvsize=$(pvs -o pe_start,pv_size --units s --noheadings --nosuffix "$dev" awk ' print $1 + $2 ')
devsize=$(blockdev --getsz "$dev")
mchunk=8
The script takes the physical volume device to convert as an argument. Note there is no check for the validity of its value.

dd of="$luks" seek=$devsize count=0 bs=512 2> /dev/null
luksdev=$(losetup -f)
losetup "$luksdev" "$luks"
trap "losetup -d \"$luksdev\"; rm -f \"$luks\"" EXIT
Next, we create a sparse luks file the same size as the device (in case luksFormat would use the size somehow, but I believe it doesn’t), and a loopback device on this file. The trap is here to avoid leaving the loopback device and the file when an error occurs later (though during the conversion itself, it will be pointless).

cryptsetup luksFormat -q "$luksdev"
cryptsetup luksOpen "$luksdev" $ cryptdev _real
read start length crypt format key IVoff cdev offset <<EOF
$(dmsetup table $ cryptdev _real)
EOF
We create a LUKS device, so that we can get the encryption key ($key), and the size of the LUKS header ($offset). Note you need to add –showkey to the dmsetup table command on sid.

if [ $(expr $devsize - $pvsize) -lt $offset ]; then
  echo Not enough free space after LVM physical volume
  cryptsetup luksClose $ cryptdev _real
  exit
fi
Check we have enough space after the LVM physical volume to offset everything by the size of the LUKS header. If not, you can still try again after you reduce the size of the LVM physical volume by an extent.

if [ $(expr $devsize % $offset % $mchunk) -gt 0 ]; then
  echo Last
  cryptsetup luksClose $ cryptdev _real
  exit
fi
This is another check to avoid surprises at the end, when dealing with the last chunk. As the script is written for the moment, it doesn’t support cases where this last chunk is not a multiple of $mchunk. So we need to abort in these.

read major minor <<EOF
$(stat -t "$dev" awk ' print $10,$11 ')
EOF
maps=$(dmsetup deps awk -F: "/\($major, $minor\)/ print \$1 ")
dmsetup create $cryptdev <<EOF
0 $length linear $dev 0
EOF
dmsetup reload $ cryptdev _real <<EOF
$start $length crypt $format $key $IVoff $dev $offset
EOF
dmsetup resume $ cryptdev _real
for map in $ maps ; do
  dmsetup table "$map" sed s,$major:$minor,/dev/mapper/$cryptdev, dmsetup reload "$map"
  dmsetup resume "$map"
done
Here, we create the dev_crypt device mapper that is our fake LUKS device, which starts as a simple linear mapper and will end as a complete crypt mapper. This fake LUKS device is inserted as an intermediate mapper between the LVM device mapper and the real device. So, the LVM device mapper will have this fake LUKS device as backend, and, at the beginning, the fake LUKS device maps linearly to the real device. Note we look for all device mappers using the real device as backend before creating the fake LUKS device to avoid finding the fake LUKS device in the list. Also note dmsetup reload only loads a new table in the INACTIVE slot, and dmsetup resume makes this inactive table LIVE.

cursor=$length
chunk=$offset
while [ $cursor -gt 0 ]; do
  cursor=$(expr $cursor - $chunk)
  if [ $cursor -lt 0 ]; then
    chunk=$(expr $chunk + $cursor)
    cursor=0
  fi
  (
  [ $cursor -ne 0 ] && echo 0 $cursor linear $dev 0
  echo $cursor $chunk mirror core 1 $mchunk 2 $dev $cursor /dev/mapper/$ cryptdev _real $cursor
  [ $cursor -lt $(expr $length - $chunk) ] && echo $(expr $cursor + $chunk) $(expr $length - $cursor - $chunk) crypt $format $key $(expr $IVoff + $cursor + $chunk) $dev $(expr $offset + $cursor + $chunk)
  ) dmsetup reload "$cryptdev"
  dmsetup resume "$cryptdev"
  chunks=$(expr $chunk / $mchunk)
  while ! dmsetup status "$cryptdev" grep "$chunks/$chunks"; do
    true
  done
done
This is where the main work is done : moving the data around. We actually just let the device mapper deal with the data duplication, $offset blocks by $offset blocks ($offset being the LUKS header size), using a mirror target for the chunk being moved. So our disk looks like the following:

We use the extra dev_crypt_real device (the previously remapped LUKS device) as the encryption backend for the mirror.
I haven’t figured a better way to wait for the end of the mirroring than to do a loop checking with dmsetup status, dmsetup wait doesn’t seem to be very helpful here.
Anyways, this is the part of the script where you don’t want a crash to occur. Because if it does, all you can do is start on a rescue system, and try to find where the encrypted part of the disk start to setup a device mapper by hand.
And you’d better have the luks temporary file in a directory that is neither in RAM (think tmpfs) nor in the LVM you are converting (/tmp in a default etch install is, for instance ; note the script works nevertheless fine in this case). Also note the trap will remove the luks temporary file if the script exits…

dmsetup reload "$cryptdev" <<EOF
$start $length crypt $format $key $IVoff $dev $offset
EOF
dmsetup resume "$cryptdev"
dmsetup remove "$ cryptdev _real"
dd if="$luks" of=$dev count=$offset bs=512 2> /dev/null
Final steps of the conversion : our dev_crypt device becomes a full LUKS volume, so we can remove dev_crypt_real and add the LUKS headers at the top of the device we converted. At this moment, the LUKS volume is setup just as if it had been setup by cryptsetup. For LVM to recognize the change properly, you need to run pvscan. Once you ran it, you can do whatever you want with LVM. Now, you may want to add the following to your /etc/crypttab file:

$cryptdev $dev none luks
i.e. hda5_crypt /dev/hda5 none luks if the device was /dev/hda5. And if the LVM volume you converted contains your root filesystem, you should run (for Debian systems):

update-initramfs -u
I tested this successfully under qemu and will give it a shot on my laptop some time soon. Now, because I had a hard time not finding much about the mirror target of the device mapper, here is what I could gather about it. The target syntax is as follows:

<logical_start_sector> <num_sectors> mirror [ core disk ] <num_params> <param> ... <num_mirrors> [ <destination > <start_sector> ] ...
logical_start_sector, num_sectors, destination and start_sector have the same meaning as in other targets.
core and disk are two different log types (to track differences between mirrors), respectively in memory and on disk.
num_params and params depend on the log type: num_mirrors is the number of mirrors and for each mirror, we have a pair destination and start_sector. [ Update: after a quick look at the device mapper source code in Linus’s git tree, updated the mirror target description ]

20 June 2007

Mike Hommey: Playing around with LVM, LUKS and the device mapper

I finally decided myself to switch my laptop to using a LVM over LUKS setup instead of LVM alone. The problem it involves is that there is currently no way that I know to do this in-place. I do have an external disk on which I could pvmove everything and back, but that would not be very challenging ;). So I started wondering how doable that would be. LUKS has a 1032 sectors (a sector being 512 bytes) overhead in which it store the LUKS header. Following the header, encrypted data just takes as much space as its decrypted counterpart, linearly. So all it would take to do in-place LUKS conversion would be to move data by 1032 sectors, and encrypt it. Which means the main problem is to have 1032 sectors free after the current volume. Fortunately, LVM doesn’t take up all the space on the partition a physical volume is setup, except if you’re unlucky or created partitions specifically so that it uses all the space. Because LVM physical volumes use the space by big chunks, 4MB by default), if the size of the partition is not 4MB aligned (modulo the LVM header), you have some free space between the physical volume end and the partition end. We thus need this free space to be greater than 1032 sectors. On my laptop, there is more than 1.8MB free there, so there would be no problem.
Note the debian-installer seems to do more than a simple cryptsetup luksFormat, as LUKS volumes it creates have an overhead of 2056 sectors instead of the 1032 sectors I got creating a volume by hand. Next problem is how to move the data and encrypt it in-place. Bonus points if that can be done without unmounting the filesystems. My first guess was to play around with the device mapper and a specially crafted FUSE filesystem to create a fake LUKS volume that could be half encrypted and half not, and would evolve, with time, into a fully encrypted LUKS volume. Since I didn’t know much about the device mapper, I looked at it a bit, and discovered a FUSE intermediate would be unnecessary: not only can you remap on-the-fly (which I already guessed was somehow possible, considering how LVM can do it, though I didn’t know much about the interaction between LVM and the d-m), but you can also mix dm-crypt and linear chunks in the same d-m table. It also appears LVM over LUKS has an overhead that is actually not necessary. How sad both use the device mapper but yet can’t do an efficient setup with it. When you setup LVM over LUKS, you open a LUKS volume, which will create a dm-crypt device mapper, and use this device mapper as the physical volume for LVM. Logical volumes created with LVM are actually device mappers using the physical volume as destination device. When you access a block on an LVM logical volume, your access is first mapped through the LV device mapper and then mapped again through the dm-crypt mapper. So it goes through 2 device mappers, but it could do with only one: the linear mapping used in most of the cases with LVM could be replaced by crypt mappings, that are just as linear, but also handle the encryption/decryption part. Playing around under qemu with a freshly installed etch system, I was able to implement this and came up with the following script. It should work with most setups, but use at your own risk, it comes with no warranty.

MAJOR=$(awk '/device-mapper/ print $1;exit ' /proc/devices)
dmsetup ls --target linear while read map extra; do
  TABLE=$(dmsetup table $map while IFS=" :" read start length linear major minor offset; do
    map2=
    if [ "$major" -eq "$MAJOR" ]; then
      IFS=":" read map2 extra <<EOF
$(dmsetup info -c --noheadings -j $major -m $minor)
EOF
    fi
    if [ -z "$map2" ] [ $(dmsetup table "$map2" wc -l) -gt 1 ] [ $(dmsetup table --target crypt "$map2" wc -l) -eq 0 ]; then
      echo $start $length $linear $major:$minor $offset
    else
      IFS=" " read cstart clength crypt format key IVoff dev coffset <<EOF
$(dmsetup table "$map2")
EOF
      echo $start $length crypt $format $key $(expr $IVoff + $offset) $dev $(expr $coffset + $offset)
    fi
  done)
  if (dmsetup table $map; echo "$TABLE") sort uniq -c grep -v "^ *2 " > /dev/null 2>&1;
  then
    echo Diverting $map
    dmsetup reload $map <<EOF
$TABLE
EOF
    dmsetup resume $map
  fi
done
[ Update: There was a dmsetup resume missing in the script ] After running this script, you should be able to run cryptsetup luksClose on your LUKS volume. Once you’ve done it, pvdisplay and other LVM tools will show you nothing, because the physical volume will just have disappeared… but everything will still be in place. Note that if you leave the LUKs volume open, you’d better be careful NOT to do operations with LVM (such as pvmove) because it could break everything. Note that on sid, you would need to add a –showkey option into the $(dmsetup table "$map2") line. This option is necessary for dmsetup to display the encryption keys. I wonder if LVM upstream would consider supporting LUKS volumes directly… Anyways, back to the in-place conversion to LVM over LUKs. The idea would be to: If I got it all right, both LUKS and LVM should be believing they have done this setup themselves, so unmounting, lvchange, etc. should just be fine. It might be necessary to regenerate the initramfs, though. I’ll tell you when I fuck up my hard disk try it. To be continued…

13 June 2007

Sune Vuorela: Too (little) paranoid ?

Am I on the right track? should I turn up my paranoia on the ‘hmmm’s or is it in general acceptable? Oh - and of course - a layer of security by obscurity is always nice. So let us throw dvorak keymap in also.

10 June 2007

Enrico Zini: things-not-to-do

Things not to do with lvm and crypto At least as of june, 2007, you should never do this: "...I need some encrypted storage space...":
lvcreate -L1G -n test vgname
cryptsetup luksFormat /dev/vgname/test
cryptsetup luksOpen /dev/vgname/test test1
mke2fs -j /dev/mapper/test1
mount /dev/mapper/test1 /mnt
# ...copy important data to /tmp...
"...oh, I need more space...":
lvresize -L+1G /dev/vgname/test
# cryptsetup resize test1 did not seem to
# work, so why not try this instead:
cryptsetup reload test1 /dev/vgname/test
resize2fs /dev/mapper/test1
Message from syslogd@localhost at Sun Jun 10 13:17:37 2007 ... localhost kernel: journal commit I/O error
"...oh damn. What happened?":
umount /mnt
mount /dev/mapper/test1 /mnt
EXT3-fs warning (device dm-13): ext3_clear_journal_err: Filesystem error recorded from previous mount: IO failure EXT3-fs warning (device dm-13): ext3_clear_journal_err: Marking fs in need of filesystem check.
"...let's check it then...":
umount /mnt
e2fsck /dev/mapper/test1
"...what the hell is going on?":
e2fsck -fy /dev/mapper/test1
"...$ & ! ^ @ $ ( Y ^ Q ! @ % # !!!".

5 June 2007

Martin-&#201;ric Racine: Linutop: Use the source, Luke!

I recently blogged about putting together the Linutop source code ISO. The resulting image has now been uploaded to our wiki. The ISO's content is divided in two sections: Developers who are interested in producing customized OS images should download this ISO and consult the wiki for details on developing for the Linutop.

23 May 2007

Luk Claes: BSP l10n

Last weekend we organised a Bug Squashing Party where more than 70 packages got fixed. Personally I fixed more than half of these :-) I noticed two unexpected things. Some maintainers were not aware that in a BSP with uploads to DELAYED-0 they should mark bugs pending or comment in the BTS if they don't want people to work on these bugs. Next some NMUers only fixed RC bugs even if there could be translations included or updated. Anyway the BSP was very successfull though I hope even more people will be involved in the next one ;-)

12 May 2007

Luk Claes: First real blog entry

This is my first real blog entry. After setting up etch's version of ikiwiki, it looked like the documentation didn't match that version, so I installed and configured the unstable version on my etch system which went pretty well. I also hope that this will show up on planet.debian.org...

Luk Claes: discussion

should this be added to the wiki?

Luk Claes: binNMU

Apparantly not everyone knows binNMUs. Sometimes bugs are filed when binNMUs can solve the problem. Some people even wonder about breaking NMUs without any notice. A binNMU:
* no source changes * sheduled on the build daemons by someone with wanna-build access * for versions of packages which already exist in the archive * can be requested on debian-release@lists.debian.org, no bugs should be filed So a binNMU is used often for library transitions with ABI changes but without API changes (libFOO-dev has not been renamed, but libFOObar has been renamed to libFOObaz) or to fix an upload of a package that was not built in a clean environment. Note that it is a good idea to contact the maintainers of packages that reverse depend on your library before starting a library transition in any case so people know why their packages don't build/install anymore and maybe can even coordinate uploads they were going to make anyway. Informing the Release Team about library transitions of more than a couple of packages would also be appreciated....

Luk Claes: discussion

where is this documented?

Luk Claes: Rebuilds

About the difference between retry, give-back and binNMU. They are all kind of rebuilds on the build daemons, though have each another goal: In my previous blog post I spoke about binNMUs. They are needed when a version of a package was built successfully and installed in the archive before. Normally this means that the version of the package is not installable on the system anymore because one of the dependencies is not installable anymore and rebuilding the package should fix it. A binNMU also means a new version (typically adding +bN where N is a positive integer) and a new changelog entry. A retry or give-back is used when a version of a package failed to build before and rebuilding the package should work. Normally this means that a build dependency was not available or some other temporary problem has been fixed. So the main difference with a binNMU is that the version of the package didn't build successfully before, so it's also not installed in the archive. A retry is used to rebuild that version of the package on the build daemon where the build failed. Normally this is used when the individualstalledpkg_timeout of a package has been increased. A give-back is used to put the version of the package in the wanna-build state 'Needs-Build' again. So it may be rebuilt on another build daemon than the one were the build failed. Note that when I talk about a version of a package in the above it should actually be a version of a package on a particular architecture as binNMUs, retries and give-backs are scheduled for a known triplet (package, version, architecture).

10 May 2007

Martin Zobel-Helas: Packages considered for 4.0r1

As there are currently four persons working on the next stable release (Dann Frazier, Luk Claes, Julien Danjou and me), we decided to track all issues for the next stable release (4.0r1) also in the Debian BTS. So if you would like to look what we currently consider for 4.0r1, have a look here. Before adding a bug (eg. with the command bts user debian-release@lists.debian.org . usertag 420759 + SRM) please contact the stable release team first, or even better, let the stable release team add your bug there on their own. Also, not all uploaded packages to proposed-updates will automatically considered for the next stable release. Update: With “contact the stable release team first” i do mean, please send requests to debian-release@lists.d.o, not contacting release team members in private over IRC or direct eMail. And NO, h01ger, cellphone is also not an option!!!1!!!elf!!!!

13 April 2007

Luk Claes: Not getting into Spain

Waking up at 5am (I know, not a decent hour, though I don't choose when a plane leaves), cycling to the railway station with all my luggage (no buses drive that early...), taking the train (actually 3 trains as there are 2 stops) for 1.5h, arriving at the airport, hearing about some strike, checking in and being told strike will be over when my plane takes off (9am), waiting, plane being delayed till 10am, waiting, plane being delayed till 11am, waiting, plane being delayed to 1pm, eating, waiting, plane being delayed till 3pm, queueing for information (which was going to take ages), plane being cancelled. Apparantly some firemen didn't like that they didn't get food tickets nor paid overhours :-( I should have known that taking a plane to Spain is risky. My previous attempt: ... arriving in the airport, trying to be checked in, being told that tickets have been cancelled, making calls, being told that travel agency forgot to confirm a second time and that new tickets have been booked for 2 days later, going home, night before take off seeing that ticket to Spain has been cancelled (ticket back still valid), going to the airport anyway, being called that everything is ok, arriving at the airport, being told that I have 2 tickets for the same flight... Sorry to the people who expected me to be in Spain, I'm not going to try my luck again tomorrow, though I'll try to be happy on IRC :-)

11 April 2007

Luk Claes: No Mail

Something went wrong with my mailserver (configuration?) today. So if you got a bounce or are wondering why I didn't answer a mail you sent today, feel free to resend the message as I changed the forwarding to another email address for the time being.

Clint Adams: And everyone was pervy, oh yeah, and the message was spread

The New York Post is such a fine periodical.

Next.

Previous.