Showing posts with label recover. Show all posts
Showing posts with label recover. Show all posts

Severe design flaw in Natty's Upgrade Process

Ubuntu's latest version 11.04 (Natty Narwhal) arrived a few days ago, some people hate it already before launched, high expectations by others.
Personally, I waited for that version several months already, hoping that it will resolve the slow problems I had on my personal laptop, as described on my previous post. Even changing the Kernel version, never solved the problem completely.
Here my update experience on three systems (all were 10.10).

Desktop PC

Machine gots stuck and hang during the upgrade process.
After rebooting, when trying the use the new Grub entry, it claims that my hardware doesn't support Unity.
After a second boot, entering the Previous Linux entry, my old 10.10 system started up perfectly and advised about a partial upgrade.
The upgrade continued smooth and left my system at the end with a running Natty.
Only my Chromium isn't usable any longer, but that's another story.

Dell home laptop

The 2nd, a smooth upgrade, without any problem.
First I downloaded the ISO image, and mounted the burned CD as software source, so most of the packages hadn't to be downloaded from the net.
After upgrade, the slow problem was gone, finally I have a fast system again, even compiz effects are usable again.
Great, all my expectations have been reached.

Lenovo office laptop

My last system hang too during the update process, it blocked with the screen-saver and I wasn't able to enter the desktop, so I couldn't see where exactly it got stuck.
Rebooting the system, first showed that Grub hadn't been updated yet, and even worse, my old system didn't booted up.
My root partition didn't mount correctly.
Inspecting with the SystemRescueCD (I have an entry to it's ISO in my Grub boot menu as explained in this post) revealed that the filesystem hadn't been damaged, all files where there.
After some investigation, I found this discussion about a serious design flaw in the Upgrade Process which could lead to that situation.
I could recover with the mentioned commands as seen below.

Recovering from not ready yet or not present root partition

mount -w -o remount /dev/sda1 /
dpkg --configure -a
Only one package made trouble, winbind, so I removed it with aptitude purge winbind, then run the dpkg command again and finally rebooted into a running Natty system.

SystemRescueCD from ISO image

The new grub loader shipped with Ubuntu Lucid is able to boot systems directly from ISO images located in any hard disc partition.

Lets use this fact and have always the latest SystemRescueCD at hand, without having to burn a new CD, just by having its ISO on our Ubuntu partition.

There are some instructions on their web-site, but
  1. they don't work

  2. why not use grub's update mechanism to include the SystemRescueCD entry automatically, instead of having to add it by hand.


Therefore, grub offers to have some scripts in /etc/grub.d which are called during the update process and I'll give you here the steps for adding the ISO image as entry "magically".

Install instructions


  1. Download latest SystemRescueCD image from their web.

  2. Move it somewhere inside the /boot folder, for example I use a subfolder:
    sudo mkdir /boot/sysrcd
    sudo mv systemrescuecd*.iso /boot/sysrcd/

  3. Create a new file /etc/grub.d/50_sysrcd and put the following content:
    #!/bin/sh

    # Search for System Rescue CD iso file in /boot and add it as boot-entry.

    for iso in $(find /boot -name systemrescuecd*.iso)
    do
    isofile=`echo $iso`
    version=`echo $iso | cut -d "-" -f 3 | cut -d "." -f 1,2,3`
    echo "Found SystemRescueCD image: ${iso}" >&2
    cat << EOF
    menuentry "SystemRescueCd ${version}" {
    loopback loop ${isofile}
    linux (loop)/isolinux/rescuecd isoloop=${isofile}
    initrd (loop)/isolinux/initram.igz
    }
    EOF
    done

  4. Make it executable:

  5. sudo chmod a+x /etc/grub.d/50_sysrcd

  6. Now, we are ready to update the grub menu:
    sudo update-grub


That's it, now when you reboot your system, you should see the SystemRescueCD as latest entry and you can just boot it up.

You could also have several versions of the ISO images in /boot/sysrcd and this will give several grub entries.

Nice if you need to tweak your system partitions, need to recover something from your broken Windows partition, you just have the tools there, and it only occupies about 250 MB on your Linux partition.
And whenever you want to use a newer version, just download the new one, replace the old ISO, and update the grub menu again.

Troubleshooting


If you get these messages during update-grub
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst

and
Updating /boot/grub/menu.lst ... done

this means that you still using grub version 1, not the latest one.
In that case, you should first upgrade grub with
sudo aptitude install grub2

Problems with Lightning on Ubuntu Jaunty


After putting on my fresh Ubuntu Jaunty installation, my favourite Email client Thunderbird, the Lightning extension (version 0.9), didn't worked at all.
I tried everything, reinstalling Thunderbird several times, disabling all other extensions, nothing.
Lightning painted some icons, but that was everything.
Some incompatibility. I installed SunBird 0.9, and it works fine. Earlier Lightning versions seemed to work also, so what is the matter?

Solution


Finally, I found the solution in some forum, you need to have libstdc++ version 5 on your system (Jaunty comes with version 6 by default). And it has to be there, when Lightning extension 0.9 is installed, so if you already have it in your Thunderbird setup, uninstall it first, then put libstc++5 on your system, and reinstall the Lightning extension.
sudo aptitude install libstdc++5
# or if you don't want to install more stuff:
ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.5

Firefox Window Border Fix

Today I had the same strange window border error as I had once with Thunderbird:

Suddenly, it started to miss its borders of the main window, being maximized always and didn't react on any changes like shrink, move, resize, maximize.
It covers the toolbar completely and when you open for example its addons window it doesn't show up, because it is hidden beneath the main window.

The fix is very similar:

  • Close Firefox

  • Edit by hand the file ~/.mozilla/firefox/xyz1234.default/localstore.rdf in your default profile directory.

  • Search the entry

    <RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
    width="800"
    height="600"
    sizemode="normal"
    screenX="5"
    screenY="5" />

  • Change the width, height and screenXY entries to the ones you see here

  • Restart Firefox and it should have its borders again.

GRUB for DOS

GRUB4DOS is an universal boot loader based on GNU GRUB, it's the DOS extension of GRUB.
It enables dos users to run the configuration console directly in real mode.
It can boot off DOS/LINUX, or via Windows boot manager/syslinux/lilo, or from MBR/CD.
It also has builtin BIOS disk emulation, ATAPI CDROM driver, etc.

It's much more powerful than Linux Grub and you should read its tutorial here to learn about all its options.
It's impressive.

The project also contains an utility called WINGRUB, an GUI intends to help configuring and installing GRUB in the WINDOWS environment.
This is very useful whenever your Windows destroys GRUBs MBR and you don't want to restart your system from a Linux LiveCD for recovering. With WinGrub you can do this directly from Windows.