Tutorial: Cryptswap1 errors, wonky monitor displays & how to fix things after an Ubuntu 14.04 upgrade

Last week I ran into some serious problems with my Ubuntu 12.04 after some routine updates. I wasn’t able to determine exactly what happened but it was related to one of our usual suspects, the cryptswap1 error at bootup, which announces that ‘the disk drive for /dev/mapper/cryptswap1 is not ready yet or not present‘.

I tried various things suggested in forums, including this one. Unfortunately, due to a slightly different config, this culminated in me somehow partially disabling my swap space. I happened to have a Debian Live CD lying around, so I proceeded to do a harddrive backup (mainly to rescue that morning’s downloaded emails), but that was tricky because my /home folder was encrypted. Though I am told it is possible, I didn’t have the time on top of all this to go & read up on how this could be done via a Live CD!

As Ubuntu 14.04 LTS had just been released, it was a great opportunity to start over. I made a bootable USB stick with 14.04 via my MacBook with Unetbootin and was ready to go. Due to my swap space and encryption issues, I couldn’t move my /home folder to another partition even though I had installed gparted partition utility through the Debian LiveCD.  Luckily, it has been possible for a while now to upgrade Ubuntu without overwriting /home. If you select ‘upgrade from 12.04 to 14.04’ during install, it will preserve all your photos, downloads, music and any other personal files.

Although you can always see your files in /home whenever are logged in as that directory’s owner, if you ever need to reveal the passphrase for the encryption you can later run ‘ecryptfs-unwrap-passphrase‘ as sudo. You can find more info about encrypted directories in Ubuntu here.

fixing the monitor display

After the painless upgrade from Ubuntu 12.04 (precise pangolin) to 14.04 (trusty tahr), the first thing I had to do before anything else was to sort out my monitor display, because I quite literally couldn’t see what I was doing! The top half of my display was black and the rest was very distorted. The good news was that I could just about make out the Nevsky Prospekt in St Petersburg, which had been my desktop picture in 12.04 and this confirmed that at least my /home folder and settings were still intact!

My Ubuntu box has a NVIDIA GeForce 7300 GS card, which was poached from my long-gone Windows XP machine (that’s how old it is!). During the attempt to sort out my initial cryptswap boot problems, I had also messed around with Xorg drivers and was now getting some ‘nouveau’ driver errors – all this pointed me toward the old culprit NVIDIA.

To even get to the command line in the first place, I had to hold down <SHIFT> at startup to boot into safe mode. This didn’t always work, probably because sometimes my keyboard wasn’t detected at reboot and other times I suddenly had no mouse. This didn’t worry me too much, keeping in mind that I was soon going to apply the most recent updates of 14.04.

Especially these nomodeset instructions were easy to follow, all you need to do is select the first kernel in the grub menu, press <F6> and then when you get the kernel edit screen, insert nomodeset in front of the words ‘quiet splash’ and then <CTRL> + X to reboot.

Now all that was left to do is update & install the NVIDIA drivers:

$ sudo apt-get update
$ sudo apt-get purge nvidia*
$ sudo apt-get install nvidia-current

And surprise, surprise – everything displayed perfectly – I had the Nevsky Prospekt desktop back in all its loveliness and was finally able to see where I was clicking! Just to make sure, I checked that Ubuntu is using the right drivers by going into System SettingsSoftware & UpdatesAdditional Driver

fixing the cryptswap error

As my swap space config was still potentially messed up, the next thing to do was getting rid of that pesky bootup error message about cryptswap1 while Ubuntu was still happily running. The cryptswap error had been appearing throughout 12.04. Some of you may have fixed it then but I had put it off as it wasn’t bothering me that much. (that should teach me…)

As mentioned above, after one of the last 12.04 essential update, my machine suddenly woudn’t boot up properly anymore. First I went back into gparted partition manager (installed be default in 14.04) and reformatted my sda5 volume as linux-swap, just to make sure it would be recognised as such. Note the volume’s randomly high number (the only other HDD volume I have is sda1) – I had ‘created’ sda5 in my attempt to fix cryptswap1 before the Ubuntu upgrade, except I was reluctant to format anything at that point and of course it didn’t work! In any case, you should make a note of its name. Back to the useful instructions here: http://punygeek.blogspot.nl/2012/10/ubuntu-1204-how-to-solve-disk-drive-for.html – speaking of which, I didn’t have the config file /etc/initramfs-tools/conf.d/resume, but running

$ sudo update-initramfs -u

seems to have updated the UUID and everything still works as we speak.

Advertisements

2 thoughts on “Tutorial: Cryptswap1 errors, wonky monitor displays & how to fix things after an Ubuntu 14.04 upgrade

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s