## Archive for the ‘Linux’ Category

### openSUSE 12.3 installer formatting encrypted devices

Wednesday, April 17th, 2013

Hi, this morning I wanted to replace my openSUSE 12.2 by openSUSE 12.3 doing a fresh installation from a USB-stick (using a recent image of a KDE-live system). I am using an encrypted partition to store the volumes of a LVM-volume group (root, home and swap). root should get reformatted (from btrfs back to ext4), but of course I chose to keep my home-partition, it should get reused without being formatted. I entered this setup in the graphical installation program (YaST installer). I had done that before, quite often, what should go wrong? I went on not noticing the entry “Set up encrypted DM device on /dev/sda2”. What does that mean? Will it create some entries in configuration files for handling the encrypted device? No, it means that it will try to reformat the entire encrypted partition using “cryptsetup luksFormat” thus wiping out all volumes stored there although it was only told to format a single volume. Of course my last backup was quite old… but I was lucky: When reinstalling I always mount my home-partition–for accessing my files but also for noting when the installation program tries to touch the volume. I could not imagine that this would happen and thought this would be a quite useless precautionary measure–but actually this saved my day and not only this day: The installer (or cryptsetup or some layer in-between) noticed that there was a mounted partition using this device and refused to format /dev/sda2. First I did not understand the error messages but then–when realising the situation–I was shocked. Nervously unmounting the partition would have caused a total loss.

Afterwards there were even more surprises: This is a known bug! It had been reported before the release of 12.3. According to the report it can even wipe out your data although you did not press the button to start the installation! And it also causes the formatting of luks-encrypted devices which are completely unrelated to the installation—they just have to be open (later I retried the installer, I had plugged in an external hard drive containing an open encrypted LVM containing ext4/btrfs-volumes, I did not select it in the installation, but the installer wanted to format the partition (and it still wanted to format the partition containing my root-volume, although there was no btrfs-volume left iirc)). The bug had been marked as critical and as a potential “ship stopper”–but then somebody decided that encountering this bug would be too unlikely! Well, they might not have known all situations where this bug can occur and the particular steps to reproduce described in the report may appear unlikely and the bug may have been there before without anybody complaining. But, seriously, they wanted to risk total data loss just because a particular situation seems to be unlikely–although it actually happened? And of course you never know for sure whether such a critical bug may affect more situations than you thought.

The bug has been fixed in the libstorage-codebase before the release. However, it was not contained in the release and the disk images provided at opensuse.org still contain the bug and might erroneously format some partitions. About two weeks after the release there have been updates to libstorage and yast2-storage. After having updated the packages in the live system the installation worked as expected and I am currently using it. But my confidence in openSUSE-releases has been shaken.

### Finally upgraded to openSuSE 11.4

Saturday, March 19th, 2011

Hi!

Today (yesterday) I have upgraded my openSuSE to version 11.4, I had been using openSuSE 11.3 before. Some days before I had screwed up some stuff with kernel updates and my boot partition (it was too small), removed stuff manually from /boot, used chroot environment, reinstalled kernel-stuff, not perfect at all, today again some problems afte the distribution upgrade, but after reinstalling the kernel and grup from chroot-environment (using an openSuSE 11.3+KDE Live CD), it worked. But since a few days (since the last 11.3 update with /boot ec.) it asks me for my luks-passphrase multiple time, but just the first time is important, after that it continues even with wrong passphrases.

PS:
I like the new artwork.

### My Bash-Aliases

Saturday, February 26th, 2011

Hi folks!

Of course I like GUIs and I like KDE and graphical configuration-applications etc. But I am using the CLI (with bash and Yakuake) for many tasks like file-management, compilation, etc. Sometimes it may be even less effective than Dolphin or something like that, but it is quite useful and I got used to it. I am using a lot of aliases (or one-line-bash-script) I want to share with you. I admit that I do not use all of them, but I try to.

#### Archives

alias ntar="tar -cf"
alias gz="tar -zcvf"
alias bz="tar -jcvf"
alias zp="zip"
alias ugz="tar -zxf"
alias ubz="tar -jxf"
alias utar="tar -xf"
alias uzp="unzip"
alias ltar="tar -tf"
alias lbz="tar -jtf"
alias lgz="tar -ztf"
alias lzp="unzip -l"
alias llz="tar --lzma -tf"
alias ulz="tar --lzma -xf"
alias lz="tar --lzma -cvf"

Show the entries of archives and create or unpack them, easier to memorize than “tar r

#!/bin/bash
LANG=en_EN.UTF-8 g++ -c -Q $2 --help=optimizers > /tmp/O3-opts LANG=en_EN.UTF-8 g++ -c -Q$1 --help=optimizers > /tmp/O2-opts
diff /tmp/O2-opts /tmp/O3-opts | grep enabled
rm /tmp/O2-opts /tmp/O3-opts

#### Process management

alias pr="ps -A | grep $1" # all processes matching the parameter alias out="\$@ 2>&1" # print stderr to stdout
alias en="LANG=en_EN.UTF-8 \$@" # sometimes I do not want to have German translations, especially for bug-reports etc. Some commands are too “complicate” for an alias: quiet (suppress output): #!/bin/bash$@ &> /dev/null

mute (start an application in the background silently):

#!/bin/bash
echo "$@" "$@" &> /dev/null &

mk (start an application using kdeinit4_wrapper):

#!/usr/bin/env ruby
pwd = Dir.pwd
cmd = "kdeinit4_wrapper " + ARGV[0]
for i in 1..(ARGV.size - 1)
if ARGV[i][0] != "/"[0] && ARGV[i][0] != "~"[0]
a = pwd + "/" + ARGV[i]
ARGV[i] = a if File.exists? a
end
cmd += " \"" + ARGV[i].gsub('"', '\"') + "\""
end
puts cmd
system(cmd)

quitapp (quit an application):

#!/bin/sh
ps -A | grep $1 echo "Try to quit using DBus..." echo kquitapp$1 > /dev/null
sleep 4
echo "Try to terminate..."
echo killall -SIGTERM $1 &> /dev/null sleep 1 echo "KILL!" echo killall -SIGKILL$1 &> /dev/null

restart (restart an application):

#!/bin/bash
~/.script/quitapp.sh $1 ~/.script/mute.sh kdeinit4_wrapper$@

suppress (continue execution after a failure):

#!/bin/bash
echo $@ #### File management alias s=less # show alias e="mk kwrite" # editor, I noticed that I was using vi just because of the short command, that is why I have added s and e alias d="du -sh" # size alias cs='cd$1 && ls'
alias ms='mkdir $1 && cd$1'
alias kc=kioclient
alias ke="kfmclient exec " # open the files using the default application
alias g.="cd .."
alias g..="cd ../.."
alias g...="cd ../../.."

et:

#!/bin/bash
touch $1 mk.rb kwrite$1

dl:

#!/bin/bash
echo $@ to trash kioclient mv$@ trash:/

swap:

cp $1 /tmp/tempswap$(basename $1) cp$2 $1 mv /tmp/tempswap$(basename $1)$2

lg:

#!/bin/bash
ls -a | grep $@ #### System alias adjusttime="sudo /usr/sbin/sntp -P no -r pool.ntp.org && echo \"New date: \date\\"" alias reset-networkmanager="sudo rm /var/lib/NetworkManager/NetworkManager.state" chrootx (that is how chroot should work): #!/bin/bash mount -o bind /proc$1/proc
mount -o bind /dev $1/dev mount --bind /etc/hosts$1/etc/hosts
mount --bind /etc/resolv.conf $1/etc/resolv.conf chroot$1 /bin/bash

Hibernation:

#!/bin/sh
sudo echo "Hibernate!"
kscreenlocker --forcelock &
sleep 3
sudo s2disk /dev/sda2

I had found options for kdmctl for shutting down the system, have to look them up again…

#### Fun

Try it yourself (alsa active, jack not active, espeak installed):

alias randsound="cat /dev/urandom | espeak --stdout | aplay"
alias randsoundde="cat /dev/urandom | espeak --stdout -v german | aplay"
alias reallyrandsound="cat /dev/random | espeak --stdout | aplay"
alias randreallysound="sudo cat /dev/urandom > /dev/dsp"

Have fun!

The User

### Fun with a Wacom-Tablet and openSuSE

Sunday, February 20th, 2011

Fun! Graphics tablets! Oh, wait, why did I mention the distribution? And The User is not one of those great artists using Krita, he is a clumsy nerd. May it be irony? Maybe, but there has actually been some fun.

Okay, I started at 1:00 last night, I wanted to try a “Wacom Intuos2 9×12” (xsetwacom list, I guess it refers to the size) with openSuSE (of course, I do not use any non-GNU/Linux-system). Well, I had some weird problems: First I could just move the cursor, no clicks, then I installed some stuff, and I could use the pen as a mouse, but without pressure detection or anything like that and with an awkward behaviour: After having drawn a line (i.e. after releasing) the cursor did no longer move, until pressing it again or lifting it a few centimetres, drawing lines, hatching etc. are of course not possible that way. So I continued playing around, xsetwacom could not recognize the tablet, openSuSE’s xinput version has this bug, so I was very confused, although it is only a bug in the output and does not affect xsetwacom. I have upgraded X to version 7.6 using this repository, but now fglrx failed, ugly backtraces at startup. I started in failsafe-mode without fglrx and after short time the tablet worked with Krita and different pressures etc. It was 4:30, I was quite tired, and I went to sleep. But of course I wanted to get fglrx back, I know, it is a proprietary driver, but without it 3D is terrible and with fglrx my battery life is one hour longer (without fglrx only 90 minutes or something like that). I downgraded the X back to version 7.5, but after some time (maybe two hours of useless recompiling, reinstalling of drivers, rebooting) I noticed that ATI provides drivers for X.org 7.6 at their website, unfortunately they do not provide official openSuSE-repositories any longer, so I had inofficial, outdated fglrx installed. Now I was confident, it had already worked with 7.6, upgrading, running the official ATI-driver-installation-script (it even generates a rpm, nice)… It did not work, I tried some source-version for the wacom-kernel-module and the xf86-input-driver, but it did not work. But finally I noticed that xorg-x11-driver-input had not been updated, probably because of the dependencies of the inofficial wacom-driver-rpm. And finally everything worked some minutes after 17:00 (I had been afk for few hours, and do not forget sleeping, so it took less than 16 hours ;)). It is awesome! The tablet is awesome! Krita is awesome! My drawing-skills are awesome, ehh, not awesome!

Long story short for those of you wanting to use a wacom-tablet with openSuSE 11.3:

• zypper ar “http://download.opensuse.org/repositories/X11:/XOrg/openSUSE_11.3/X11:XOrg.repo”
• zypper dup
• Make sure, all xorg-x11-packages are now up-to-date
• Install wacom-kmp-desktop (for desktop kernel) and xorg-x11-driver-input-wacom from some repositories, have a look at http://software.opensuse.org
• Alternatively visit http://linuxwacom.com and install the drivers from source(git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/xf86-input-wacom, git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/linuxwacom)
• Reboot, everything should works now

kcm_tablet does not work for me, maybe it will magically work after some rebooting, but for now it does not detect the tablet. However, the standard-configuration is okay and I can still use xsetwacom for configuring the device. I do not want to tell you about my attempts with UDBA-graphics-driver-installation and the long startup-times of fglrx.

My first work I have stored (the bamboo is a Krita-default-brush :D): show image in full size.