28 October 2014

599. Briefly: Suddenly bankid doesn't work/wont be recognised.

The system: firefox 31, nspluginwrapper 1.4.4, debian wheezy, amd64

I've used bankid with Swedish banks in the past. Right now I'm running into trouble though. When clicking on the login button on the bank website I'm taken to this page:
Starting firefox (v31, but the symlink is called firefox25) from the terminal to catch the error messages I get
(firefox25:5555): GLib-GObject-WARNING **: /tmp/buildd/glib2.0-2.33.12+really2.32.4/./gobject/gsignal.c:3397: signal name `load_complete' is invalid for instance `0x2b81340fc1f0' Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed Gtk-Message: Failed to load module "atk-bridge" *** NSPlugin Viewer *** ERROR: NP_Initialize() get args: Message argument mismatch *** NSPlugin Viewer *** ERROR: rpc_end_sync called when not in sync! *** NSPlugin Wrapper *** ERROR: NP_Initialize() wait for reply: Connection closed (firefox25:5555): GLib-GObject-WARNING **: /tmp/buildd/glib2.0-2.33.12+really2.32.4/./gobject/gsignal.c:3397: signal name `load_complete' is invalid for instance `0x2b812a4f52e0'

The solution was to do
/usr/lib/nspluginwrapper/x86_64/linux/npconfig  -a -v -u
Auto-update plugins from /usr/lib/mozilla/plugins Looking for plugins in /usr/lib/mozilla/plugins Auto-update plugins from /home/me/.mozilla/plugins Looking for plugins in /home/me/.mozilla/plugins Update plugin /home/me/.mozilla/plugins/npwrapper.libplugins.so nspluginwrapper ident mismatch, reinstalling plugin Install plugin /usr/local/lib/personal/libplugins.so into /home/me/.mozilla/plugins/npwrapper.libplugins.so

as described by the nspluginwrapper maintainer (David) in a reply on http://www.geeklab.info/2011/11/reconfigure-nspluginwrapper/

24 October 2014

598. Move /var, /tmp, /opt to separate partitions

1. First create the partitions on a disk. In my case I created partitions on a different disk from the root partition.

2. Figure out the uuids:
ls /dev/disk/by-uuid -lah
lrwxrwxrwx 1 root root 10 Oct 22 14:02 28b59809-7dfb-4ce4-a4da-6f118171ea07 -> ../../sdb2 lrwxrwxrwx 1 root root 9 Oct 22 14:45 52f07f83-3a72-457c-b25f-7aa4f3e76461 -> ../../sdc lrwxrwxrwx 1 root root 10 Oct 7 14:42 8a5ca4ae-9963-47ea-99c3-2335c7dc8118 -> ../../sda6 lrwxrwxrwx 1 root root 10 Oct 7 14:42 9243ff6b-9834-4fa3-a93f-10a350f85687 -> ../../sda1 lrwxrwxrwx 1 root root 10 Oct 22 14:02 9f785dde-1d3a-4063-90e7-054f3d031e05 -> ../../sdb3 lrwxrwxrwx 1 root root 10 Oct 22 14:02 eacf2cad-d462-45b2-afeb-2c5ddf5669b8 -> ../../sdb4 lrwxrwxrwx 1 root root 10 Oct 7 14:42 f25a484c-e8e2-4ead-808b-96dd5e915020 -> ../../sda5 lrwxrwxrwx 1 root root 10 Oct 22 14:02 f4280c34-04d6-4def-963a-507e68dd483d -> ../../sdb1
I know that I'm looking for sbd2 (label: tmp), sdb3 (label: opt) and sdb4 (label: var). We'll use these uuids later for our /etc/fstab

3. Move /opt, as it's the easiest (should be reasonably static).

sudo udisks --mount /dev/sdb3
Mounted /org/freedesktop/UDisks/devices/sdb3 at /media/opt
sudo cp -ax /opt/* /media/opt

Edit /etc/fstab:
 
UUID=9f785dde-1d3a-4063-90e7-054f3d031e05 /opt ext4 defaults,user_xattr 0 2

Move the old /opt and mount the new one:
sudo mv /opt /opt.old
sudo mount /opt

And you should be good to go. Check with df -h:
[..] /dev/sdb3 72G 28G 41G 41% /opt

4. Move /var and /tmp

You can use init 1 according to http://unix.stackexchange.com/questions/131311/moving-var-home-to-separate-partition. Note that doing so will kill your graphical session and stop or restart most of the services i.e. close open documents before your continue. You'll then get dumped into a vty.

Open a terminal and type
 
init 1

which dumps you into a root terminal. Then, as root, do
 
mkdir /media/var
mount /dev/sdb4 /media/var
cp -ax /var/* /media/var
mkdir /media/tmp
mount /dev/sdb2 /media/tmp
cp -ax /tmp/* /media/tmp
mv /tmp /tmp.old
mv /var /var.old
mkdir /tmp
chmod 777 /tmp
mkdir /var
umount /media/var
umount /media/tmp

Changing the permissions for /tmp is important -- if they aren't generous enough it can cause all sorts of issues. In my case it was manifested by me being unable to log onto a GUI (e.g. gnome) from GDM3 -- I would get booted back to the login screen.

Edit /etc/fstab and add:
UUID=28b59809-7dfb-4ce4-a4da-6f118171ea07 /tmp ext4 defaults,user_xattr 0 2 UUID=eacf2cad-d462-45b2-afeb-2c5ddf5669b8 /var ext4 defaults,user_xattr 0 2
Note: I don't know what the best values for the attributes are. I just took what I used for /home, which is probably not optimal. You may want to do your own research into this. Then do

mount /tmp
mount /var
init 2

Once you've established that all is well you can delete /var.old and /tmp.old.
df -h shows
Filesystem Size Used Avail Use% Mounted on rootfs 92G 32G 56G 37% / udev 10M 0 10M 0% /dev tmpfs 798M 1.1M 797M 1% /run /dev/disk/by-uuid/9243ff6b-9834-4fa3-a93f-10a350f85687 92G 32G 56G 37% / tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 4.6G 88K 4.6G 1% /run/shm /dev/sda6 734G 555G 142G 80% /home /dev/sdb3 72G 28G 41G 41% /opt /dev/sdb2 72G 53M 69G 1% /tmp /dev/sdb4 48G 8.8G 37G 20% /var

597. Missing partition -- gparted shows unallocated space

The issue:
I'm low on space on my / partition since ECCE has a way of putting really large files in /tmp. Rather than trying to fix the behaviour of ECCE, I'm planning on moving /tmp to a separate disk that's dedicated to highio processes and where ECCE can't cause my / to fill up. I might move /opt as well, to free even more space. The first step in such a move is to create an additional partition on your target disk and for that gparted is good as it can move all the data before creating the new partition.

Imagine my surprise when I fired up gparted and saw:

Using Disk Utilities (palimpsest) it doesn't look too odd:

Using fdisk I see a complete lack of partitions:
sudo fdisk /dev/sdb
Command (m for help): p Disk /dev/sdb: 1000 GB, 1000202273280 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System Command (m for help):

This may be a job for testdisk. I fired it up with sudo, selected Intel type partition, and kept selecting the defaults -- eventually my partition showed up. I then did a deep search to make sure everything was ok.






I then check using palimpsest and gparted:





(I also screwed up, then fixed a disk with a different issue -- but because I'm not really sure what I did to fix it I'll make a separate post about that at a later date. Maybe.)