Thursday, February 19, 2009

grub error 17


I finally managed to free up an old system at work and put it in the lab so that others on my team can start getting comfortable using a Linux desktop.

I installed 8.04 since I am still a little wary of 8.10.

A very simple install with just a single root partition and a swap partition. Things seemed fine, for a few days after which the system just locked up. After forcing a power cycle, grub complained saying "Error 17".
A quick google search will tell you that this has something to do with the hard-disk. Probably a failed disk or at the very least some errors.

Fortunately it was just the case of errors on the disk which I was able to fix by booting the live-cd and doing the following:

sudo -s
fdisk -l # to figure out the root partition.

ext3fsck -y /dev/sda2 # to find and fix disk errors

fsck found and fixed a few errors. The subsequent reboot was fine.

Searching for the error on google, showed a good discussion on the Ubuntu forums about another case when you might run into this error after a fresh install. Probably the case if you have multiple disks and/or more partitions. Check it out:


Monday, February 16, 2009

wubi and booting error

I have been running 8.04 at work using wubi and it has been working like a charm since the last 6 months.

However, I just ran into an issue where after a reboot, instead of booting, it dropped me into a busybox prompt. The problem was that grub could not find the initrd, probably due to a few _corrupted_ disk sectors where wubi had my Ubuntu image installed.

Simple fix, boot into Windows (hopefully that still works) and run 'chkdsk' on the drive.

Oh well, the price you pay for not giving yourself a dedicated partition.

Monday, February 9, 2009

formating a drive for fat32

To quickly format a drive to fat32 (for Windows) use mkfs.msdos:

Example: sudo mkfs.msdos -I -F 32 /dev/sdc

Other formatting options:

mkfs.bfs
mkfs.ext2
mkfs.minix
mkfs.reiserfs
mkfs.cramfs
mkfs.ext3
mkfs.msdos
mkfs.vfat

Monday, February 2, 2009

Ubuntu Pocket Guide


One of the strongest reasons for Ubuntu's rise in popularity as the Linux desktop distribution of choice is that you can pretty much search for answers to any of your questions. In case the entire Internet is not enough to give you the information you are looking for, feel free to download this Ubuntu Pocket Book and Reference Guide.

Free (as in open source) download!

Thursday, January 8, 2009

Windows 7 eerily similar to Fedora

versus


Seems like this will be the year for a Windows 7 release.

I haven't used Vista at all, and the last time I booted into XP was a while ago. But, the first thing that strikes me when I look at the screen shot is how similar it is to the Fedora look. Then again, it has been a while since I used Fedora either.

If at all Windows was trying to pick up design inspirations, they should have just google'd 'Ubuntu Screenshots'

Wednesday, January 7, 2009

static variables in a C++ class

Certainly mature methods of software coding recommend that you avoid global variables. So sometimes you end up using static data members within C++.

I recently learned this about using static variables in C++ classes. You need to define the static data member outside the class declaration. Failure to do this results in a linker error, the reason being because without the definition the compiler doesn't know which translation unit (hence object file) the member is supposed to go.

Sample code:
foo.h

class bar {
public:
int getBar1();
private:
static int bar1;
};

foo.cpp
#include "foo.h"

int bar::bar1;
.....
....

One more reason why I don't consider myself a C++ programmer.

Flying Linux

As I am getting ready for a flight this weekend on Virgin America, I remembered something I read a few months back.

The in-flight entertainment system on Virgin America, RED runs on Fedora/Red Hat Linux. Very cool.

Here is a good interview with Charles Ogilvie, the Director of In-flight Entertainment and designer of RED. I am certainly looking forward to checking it out. At least there are still one or two good reasons to fly.