Showing post in category: Ubuntu
Damn… never brag about uptime
Today I received a 2GB SD card which I’m going to use to store ssh and gpg keys on. Of cause I’m going to encrypt it like I wrote about some days ago. When I inserted the SD card into my laptop everything just froze… it guess I’m hit by bug #61758.
Ubuntu Edgy uses kernel 2.6.17 which seems to be affected by this bug. It should be fixed in 2.6.18 though.
I’ll try to patch my kernel module… god I hoped those days where over. Exciting to see if I can even remember how to do it. I hope this gets fixed soon, life is to short to compile kernel modules. My laptop should just work.
I rarely shut down my laptop, but I use suspend all the time. Right now I have like 14 days of “uptime” which would have been a lot more if it wasn’t because I just installed Edgy
I have VMware Server installed on it which I use for my work. I have all the machines on a host only network which works just great. But every time I suspend my laptop the virtually device vmnet1 seems to “go down” and I have to make a:
sudo ip link set vmnet1 up
to be able to connect from my laptop to the VMware machines again.
Now I created a file at the following location:
/etc/acpi/resume.d/89-enable-vmware-host-only-net.sh
With the following content:
#!/bin/sh
ip link set vmnet1 up
Now I don’t have do it manually any more, horay
For those who found my post about encryption of USB devices interesting yesterday… you might wanna keep an eye on this one which I stumbled upon it today. A feature request for the next Ubuntu release, Feisty Fawn:
Transparent encryption og homedir
Update: The link was moved. I have now updated the URL. Thanks Steffen.
Today I went to the Linuxforum BOF day where I attended a session about encrypting your personal files. This made me remember a post read some time ago (check out the screen cast). I guessed that this functionality would be in Ubuntu Edgy by now so I just went ahead and tried to make my USB pen drive encrypted.
This is how I did it:
First install the needed software
sudo apt-get install cryptsetup
Make sure your USB disk isn’t mounted. Then partition the USB pendrive
the way you want it, if it isn’t already partitioned (I made one big
partition on mine /dev/sda1).
Note: Don’t mount the disk afterwards!
If you havn’t rebooted your computer since you installed the cryptsetup package,
you might have to load the device mapper crypt module manually:
sudo modprobe dm-crypt
Now make the partition encrypted:
$ sudo cryptsetup --verbose --verify-passphrase luksFormat /dev/sda1
WARNING!
========
This will overwrite data on /dev/sda1 irrevocably.
Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase:
Verify passphrase:
Command successful.
If you get the error:
Failed to setup dm-crypt key mapping.
Check kernel for support for the aes-cbc-essiv:sha256 cipher spec and verify that /dev/sda1 contains at least 133 sectors.
Make sure that the disk isn’t mounted. And make sure you are using the right device. You can use dmesg to check which device the disk have been assigned. You might also wanna check that the the module dm-crypt is loaded (lsmod | grep dm).
Now attach the encrypted partition.:
$ sudo cryptsetup luksOpen /dev/sda1 sda1
Enter LUKS passphrase:
key slot 0 unlocked
Command successful.
Now create a filesystem on the new encryptet device:
sudo mkfs.ext3 /dev/mapper/sda1
Remove the tempoary device mapped to the encrypted partition:
sudo cryptsetup luksClose sda1
Now remove the your usbdisk from the USB plug, and reinsert it and Ubuntu should find it and ask for the passphrase.

Update: I tried to insert my USB pen into a Ubuntu Dapper (which this guide also would work on I guess). I just thought it was cool that is atcually told me which package it needed to for it to work:

And you don’t even need any physical disks for it….
I don’t use Linux software raid tool mdadm that often so I quickly forget how it works. This is something I used on several occasions, when trying to refresh my mind. The cool thing is that you don’t need physical disks or a lot of space for it to work.
The following might vary a bit depending on you system (mine is Ubuntu Edgy Eft on IBM x40).
First create a few “disks”… by creating some empty files and making them into block devices:
dd if=/dev/zero of=disk1 bs=1M count=1 seek=30
dd if=/dev/zero of=disk2 bs=1M count=1 seek=30
dd if=/dev/zero of=disk3 bs=1M count=1 seek=30
losetup /dev/loop0 disk1
losetup /dev/loop1 disk2
losetup /dev/loop2 disk3
This creates 3 files (disk1, disk2 and disk3) with the size of 1MB in the current directory and makes them into block devices (just like normal disks is).
Now create your raid, example:
mdadm --create /dev/md0 --level=5 --raid-devices=2 --spare-devices=1 /dev/loop0 /dev/loop1 /dev/loop2
If you get the error:
mdadm: error opening /dev/md0: No such file or directory
Add the parameter --auto=md to the raid create command.
Now you can see you raid status with:
cat /proc/mdstat
Now play around with it all you want
Cleanup
When you are done you stop the raid and remove it with the following:
mdadm --stop /dev/md0
mdadm --remove /dev/md0
Perhapes you want to remove the md0 device again with (only if you needed the --auto=md parameter:
rm /dev/md0
Cleanup the “disks”:
losetup -d /dev/loop2
losetup -d /dev/loop1
losetup -d /dev/loop0
rm disk3
rm disk2
rm disk1
Now you computer wont have a trace of you your software raid disks… besides you shell history
The bug I blogged about in a previous post seems to be known. I googled on the the problem and found a few links which seems to describe my exact problem. The good thing is that there is a work around. I’ll try this later.
Hope it gets fixed soon
Update: I found out why VMware wouldn’t start and made a post about it.
Wireless
After installing Edgy Eft a couple of days ago I noticed a weird behavior of Network Manager. My wireless card was identified as a wired network card after resuming from suspend. Today I got some time to search for the bug on Launchpad and it seems it is a known bug:
Anyways I added my comments, and will be following it closely.
Update: It seems there is a fix for the bug… I’m running with it now, and so far it seems fine.
VMware
Update: I found out why VMware wouldn’t start and made a post about it.
I haven’t been able to get VMware up and running yet. I get this error when trying to start VMware:
je@rohan:~$ sudo /etc/init.d/vmware start
Password:
VMware Server is installed, but it has not been (correctly) configured
for the running kernel. To (re-)configure it, invoke the
following command: /usr/bin/vmware-config.pl.
The modules have been compiled for my current kernel and I’m sure it has been compiled with the same gcc version (if that have any effect?).
My kernel:
uname -a
Linux rohan 2.6.17-9-generic #2 SMP Fri Sep 22 10:41:59 UTC 2006 i686 GNU/Linux
Installed headers:
dpkg -l |grep linux-headers-2.6.17-9-generic
ii linux-headers-2.6.17-9-generic 2.6.17-9.23
Kernel info:
cat /proc/version
Linux version 2.6.17-9-generic (root@rothera) (gcc version 4.1.2 20060920 (prerelease) (Ubuntu 4.1.1-13ubuntu3)) #2 SMP Fri Sep 22 10:41:59 UTC 2006 (Ubuntu 2.6.17-9.23-generic)
Compiler is gcc 4.1, which is the only one I have installed at the moment:
ls -l /usr/bin/gcc
lrwxrwxrwx 1 root root 7 2006-09-23 03:37 /usr/bin/gcc -> gcc-4.1
Running /usr/bin/vmware-config.pl as root (with sudo) doesn’t report any errors. The install seems to be exactly like on Dapper.
I really cant figure out why it doesn’t work.
But besides these 2 things, Edgy is looking great. I feel suspend and resume is a bit faster than with Dapper. Startup and login is faster. All other things looks the same to me… and that isn’t a bad thing
Last night (this very early morning) I installed Edgdy Eft Knot 3 on my laptop at LinuxParty 2006 in Roskilde. Tried a network upgrade first… which fucked up totally. Then I trashed my entire system partition and used the live installer…. which worked out great.
For a moment I ran the kernel: 2.6.17-8-generic
with which I experienced a problem with suspend (or resume). After I resumed my laptop my screen wasn’t redrawn correctly. After upgrading to 2.6.17-9-generic I haven’t experienced it since… but I haven’t tested it enough to say it is actually gone
The new power manager is soo cool

When I’m on battery, LCD dimmed down and Bluetooth and Wireless turned of I only use 6-7W. Really fun to tru out different stuff and watch the graph.
So far the upgrade to Edgy works like a charm… though I still need to get VM-Ware and Citrix Meta Frame installed, but I don’t suspect it to give any trouble.
I installed Dapper Drake on my laptop and it went pretty well. At the time of writing it isn’t released as stable yet. I didn’t make a clean install but jut upgraded my current Breezy installation.
The first thing I noticed was the my SD card reader started working. YAY – kudos to the developer(s) how made that happen. Even if you dont use Ubuntu you should be able make it work on you machine too, because it was an addition in kernel 2.6.15 which now supports the SD card reader in IBM’s X40 (which is a Ricoh R5C822). I dunno which other SD card readers now work but take a look at this site
The reason I upgraded to Dapper was because I hoped that the problems with using an external monitor (or projector) would be solved. As you might have guessed they where not. Instead I found a SourceForge project: intel 855GM crt video out driver. This is a small program which can enable ad disable the extarnal monitor port. I works very well, and I can now use my laptop for presentations now that I can have both my laptop screen and the extarnal monitor enbaled at the same time.
A little bonus I got from upgrading Ubuntu was:
- Speedups in GNOME which I can feel (not much, but they are there)
- Firefox 1.5, yay – tab reordering
- Gedit can now save files to remote locations trasparent via gnome-vfs (ie. ssh)
- Better performance with gnome-terminal
- Quicker startup time (I dont use that much because I usually just suspends my laptop to RAM)
Important: Right now suspend doesn’t work right. It seems alot faster to suspend and resume but redraws of the screen totally fucks up after resume. Ie. scrolling on a homepage or moveing windows is behaving very weird. I’m planning to try installing from the flight 5 CD’s to test if it has something to do with my upgrade from Breezy.
A few days ago I updated my Ubuntu Breezy (developer preview of the new Ubuntu Linux), and the next day X (The grapical environment) wasn’t able to start. It suddenly didn’t automatically find my mouse at startup.
It seems I have beenhit by this bug.