Default X session, please

8 06 2008

Judging from Google it seems like this is quite a common annoyance but nobody really knows how to get around it: If you use KDM as your login manager and temporarily login with a different X session than your default one, KDM will remember this and the next login will use your “previous” session.

That’s a nice feature per se, but annoying if you combine it with auto-login and a heavyweight session type like my dedicated VirtualBox session (more on that another day).

There’s a simple workaround though: Your previous session, is stored in the file ~/.dmrc. Just remove replace (if you remove it, login will fail) the Session option with Session=default in there and make it read-only:

sed -i -e '/\[Desktop\]/I,/\($\|^\[\)/{/^Session=/Is/=.*$/=default/}’ ~/.dmrc
chmod -w ~/.dmrc

From now on you’ll always be logged in with the system default.



LVM+ext3 rocks

6 06 2008

I guess this is old news to most people, but I’m still excited: The combination of LVM and ext3 makes it possible to resize a partition while it is still mounted.

The short story:
root@TreeHouse:~# lvextend -L+1G /dev/hd/kubuntu
Extending logical volume kubuntu to 6.00 GB
Logical volume kubuntu successfully resized
root@TreeHouse:~# resize2fs /dev/hd/kubuntu
resize2fs 1.40.8 (13-Mar-2008)
Filesystem at /dev/hd/kubuntu is mounted on /; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/hd/kubuntu to 1572864 (4k) blocks.
The filesystem on /dev/hd/kubuntu is now 1572864 blocks long.

That took maybe two seconds. Read the rest of this entry »