Monday, June 2, 2008

GRUB Error Codes Revealed

GRUB Error Messages

Errors Reported by the Stage 1

The general way that the Stage 1 handles errors is to print an error string and then halt. Pressing Ctrl-Alt-Del will reboot.

The following is a comprehensive list of error messages for the Stage 1:

  • "Hard Disk Error"

    This error message will occur if the Stage 2 or Stage 1.5 is being read from a hard disk, and the attempt to determine the size and geometry of the hard disk fails.

  • "Floppy Error"

    This error message will occur if the Stage 2 or Stage 1.5 is being read from a floppy disk, and the attempt to determine the size and geometry of the floppy disk fails. It's listed as a different error since the probe sequence is different than for hard disks.

  • "Read Error"

    This error message will occur if a disk read error happens while trying to read the Stage 2 or Stage 1.5.

  • "Geom Error"

    This error message will occur if the location of the Stage 2 or Stage 1.5 is not in the area supported by reading the disk with the BIOS directly. This could occur because the BIOS translated geometry has been changed by the user or the disk is moved to another machine or controller after installation, or GRUB was not installed using itself (if it was, the Stage 2 version of this error would have been seen during that process and it would not have completed the install).


Errors Reported by the Stage 1.5

The general way that the Stage 1.5 handles errors is to print an error number in the form "Error: " and then halt. Pressing Ctrl-Alt-Del will reboot.


Errors Reported by the Stage 2

The general way that the Stage 2 handles errors is to abort the operation in question, print an error string, then (if possible) either continue based on the fact that an error occurred or wait for the user to deal with the error.

The following is a comprehensive list of error messages for the Stage 2 (error numbers for the Stage 1.5 are listed before the colon in each description):

  • 1 : "Selected item won't fit into memory"

    This error is returned if a kernel, module, or raw file load command is either trying to load it's data such that it won't fit into memory or it is simply too big.

  • 2 : "Selected disk doesn't exist"

    This error is returned if the device part of a device- or full filename refers to a disk or BIOS device that is not present or not recognized by the BIOS in the system.

  • 3 : "Disk read error"

    This error is returned if there is a disk read error when trying to probe or read data from a particular disk.

  • 4 : "Disk write error"

    This error is returned if there is a disk write error when trying to write to a particular disk. This would generally only occur during an install of set active partition command.

  • 5 : "Disk geometry error"

    This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BIOS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general).

  • 6 : "Attempt to access block outside partition"

    This error is returned if a linear block address is outside of the disk partition. This generally happens because of a corrupt filesystem on the disk or a bug in the code handling it in GRUB (it's a great debugging tool).

  • 7 : "Partition table invalid or corrupt"

    This error is returned if the sanity checks on the integrity of the partition table fail. This is a bad sign.

  • 8 : "No such partition"

    This error is returned if a partition is requested in the device part of a device- or full filename which isn't on the selected disk.

  • 9 : "Bad filename (must be absolute pathname or blocklist)"

    This error is returned if a filename is requested which doesn't fit the syntax/rules listed in the Filesystem Description.

  • 10 : "Bad file or directory type"

    This error is returned if a file requested is not a regular file, but something like a symbolic link, directory, or FIFO.

  • 11 : "File not found"

    This error is returned if the specified filename cannot be found, but everything else (like the disk/partition info) is OK.

  • 12 : "Cannot mount selected partition"

    This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB.

  • 13 : "Inconsistent filesystem structure"

    This error is returned by the filesystem code to denote an internal error caused by the sanity checks of the filesystem structure on disk not matching what it expects. This is usually caused by a corrupt filesystem or bugs in the code handling it in GRUB.

  • 14 : "Filesystem compatibility error, can\'t read whole file"

    Some of the filesystem reading code in GRUB has limits on the length of the files it can read. This error is returned when the user runs into such a limit.

  • 15 : "Error while parsing number"

    This error is returned if GRUB was expecting to read a numbur and encountered bad data.

  • 16 : "Device string unrecognizable"

    This error is returned if a device string was expected, and the string encountered didn't fit the syntax/rules listed in the Filesystem Description.

  • 17 : "Invalid device requested"

    This error is returned if a device string is recognizable but does not fall under the other device errors.

  • 18 : "Invalid or unsupported executable format"

    This error is returned if the kernel image boing loaded is not recognized as Multiboot or one of the supported native formats (Linux zImage or bzImage, FreeBSD, or NetBSD).

  • 19 : "Loading below 1MB is not supported"

    This error is returned if the lowest address in a kernel is below the 1MB boundary. The Linux zImage format is a special case and can be handled since it has a fixed loading address and maximum size.

  • 20 : "Unsupported Multiboot features requested"

    This error is returned when the Multiboot features word in the Multiboot header requires a feature that is not recognized. The point of this is that the kernel requires special handling which GRUB is likely unable to provide.

  • 21 : "Unknown boot failure"

    This error is returned if the boot attempt did not succeed for reasons which are unknown.

  • 22 : "Must load Multiboot kernel before modules"

    This error is returned if the module load command is used before loading a Multiboot kernel. It only makes sense in this case anyway, as GRUB has no idea how to communicate the presence of location of such modules to a non-Multiboot-aware kernel.

  • 23 : "Must load Linux kernel before initrd"

    This error is returned if the initrd command is used before loading a Linux kernel. Similar to the above error, it only makes sense in that case anyway.

  • 24 : "Cannot boot without kernel loaded"

    This error is returned if GRUB is told to execute the boot sequence without having a kernel to start.

  • 25 : "Unrecognized command"

    This error is returned if an unrecognized command is entered into the command-line or in a boot sequence section of a config file and that entry is selected.

  • 26 : "Bad or incompatible header on compressed file"

    This error is returned if the file header for a supposedly compressed file is bad.

  • 27 : "Bad or corrupt data while decompressing file"

    This error is returned the run-length decompression code gets an internal error. This is usually from a corrupt file.

  • 28 : "Bad or corrupt version of stage1/stage2"

    This error is returned if the install command is pointed to incompatible or corrupt versions of the stage1 or stage2. It can't detect corruption in general, but this is a sanity check on the version numbers, which should be correct.

Thanx to: erich@uruk.org

Wednesday, May 21, 2008

Completely Removing Linux When Dual Booting with Windows

Completely Removing Linux When Dual Booting with Windows


There may be some cases when you may need to remove your linux system completely, like:

  • You find you have allocated too much space to the linux partitions and feel you use it very less frequently

  • You are not satisfied with the hardware support for your particular hardware

  • You find the current distro less satisfying and want to wait for the next release

  • You do not like linux!

  • You just want to remove it!!


This is one of the cases when you may be interested in removing it either temporarily or even permanently depending on the circumstances. Though many people say it is impossible, it actually is possible and also extremely easy.


FOR WINDOWS XP AND LINUX COMBO:

You will need:

  • One Windows XP installed CD/DVD (Not the recovery disks).

  • Access to the Windows Account as an administrator.




Step 1:

  • Backup all the useful data in the linux partitions to another windows partition so that you don't repent later.


Step 2:

  • Open the Windows Computer Management Console ( Control Panel->Administrative Tools (In Classic View)->Computer Management. )

  • Go To 'Disk Management'


Step 3:

  • Identify the partitions where you have installed linux by the size and free space (This may be difficult)


Step 4:

  • Right click a linux partition and select 'Format...'

  • In The Format Dialog.. Select 'NTFS' as the filesystem so that you can regain it back in linux.

  • Repeat for all the Linux partitions, viz., ROOT, HOME, SWAP...


Step 5:

  • Now that you have done the above tasks, reboot.


(WARNING: After rebooting, neither your old XP nor linux will start... so dont be alarmed!!! )


Step 6:

  • Insert the XP installer CD and boot from it.

  • Let the drivers load and wait for the first screen.

  • It will scan the current partitions and show a list of current windows installations.

  • Select the XP installation and press 'R' so that you enter a DOS-Like console called Recovery Console


Step 7:

  • Enter 'FIXMBR' (Without the quotes) on the prompt so that the MBR is reformatted


Step 8:

  • Enter 'FIXBOOT' (Again without the quotes)

  • This will reset the MBR to boot from the windows partition instead of the linux partition.

  • This is virtually the last step as the problem is solved now.

  • Reboot via 'REBOOT' command and remove the XP CD.



BACKUP PLAN:

If the above steps dont work, use this simple, but more time consuming backup plan...


  • Boot from XP CD

  • When the first screen comes DONT select 'R' for recovery but hit 'ESC' key to install a fresh copy

  • Again a list of currently installed Xps is shown

  • Select your current Installation to repair

  • Hit 'R' to repair

  • Wait for approx 45 mins so that the repair process completes..

  • Done


Wednesday, May 7, 2008

Five Most Important Steps After Installing Ubuntu...

Hey guys, with the number of linux users increasing day by day and seeing the exponential growth of linux in the desktop sector, the number of people experiencing problems getting used to the new O.S. has also increased.
As a user who has been through such problems, i felt the need to present a small how-to for how to get your Ubuntu working smoothly without glitches and how to solve all the basic problems which ward off the so called "n00bs" from adopting this revolution.

This how to contains the first 5 steps that need to be done by any ubuntu user, starting with the most important one...

1)Setting up Repositories and CD packages in Ubuntu

2)Geting And Installing the drivers for your Graphics Card

3)Pump up the Glam Quotient (install Compiz Configuration Tool And Emerald Window Decorator)

4)Get the Music and Video Codecs right

5)Geting Great Wallpapers and Themes and Much More.....


If you have successfully followed all the above steps, give yourself a pat on the back!!!!

You have done something thought very-very difficult by others!!!

Easy Eh...!!!!

I hope it was useful...

For queries, mail me at kinnarshah8888@gmail.com


Geting Great Wallpapers and Themes and Much More...

The best place to get jazzy artwork and themes for ubuntu is: www.gnome-look.org

Go thru the various stuff put up, especially in the 'most downloaded' and the 'highest rated' sections.


Theme tar-balls (.tar files) can be installed by drag-dropping them to the apperance window.

Same applies for icon-themes, cursor-themes, etc


See how glamorous your computer dearest can be!!!

Get the Music and Video Codecs right

Now that you have installed your fav debian linux system and configured it, there is one major hurdle still left: Audio-Video Codecs.

This is a relatively easy task compared the above... so chill!!!!


After refreshing the repo according to “Configuring Repositories” post in my blog, type the following in the terminal:


sudo apt-get install ubuntu-restricted-extras


Start playing the music DJ!!!!

Pump up the Glam Quotient (install Compiz Configuration tool and Emerald )

Installing Compiz Configuration Tool




The configuration tool for compiz is known as “Compiz Config Settings Manager”

It can be installed by typing the following in the terminal:

sudo apt-get install compiz-config-settings-manager

It can be opened in the following ways:

  • System->Preferences->Advanced Desktop Effect Settings

  • Type: ccsm in the terminal

Tweak the settings as per your wishes and they will be instantly applied.


Bonus:

Setting Up The Rotating Cube:

  • Disable Desktop Wall

  • Enable Desktop Cube, Rotate Cube, 3D Windows (only in hardy), Cube Caps, Cube Reflection, Cube Gears (if you like it).

  • Rotate the cube by CTRL-ALT-HoldLeftClick and guide with the mouse by dragging.

  • Behold!!!!!


Installing Emerald Window Decorator


Emerald is the most rocking window decorator in the history of linux (and hence even windows!!!)

It has many graphics engines that enable a variety of what are known as “themes” in windows. It has a host of features like transparency, off-shoot skinning (difficult to explain), bitmap skinning, etc with all the control in your hands.

You can install it by typing :


sudo apt-get install emerald


in the terminal

You can open it by : System->Preferences->Emerald Theme Manager

Themes can be installed via the 'Import' button

Select the theme and see it instantly applied.

If it is not automatically appplied, type the following in the terminal to apply it: emerald --replace


Starting Emerald At System Startup:

  • Go to System->Preferences->Sessions

  • Add a new script to the startup tab via the Add button

  • In Name, type anything like “Emerald”

  • In command, type: emerald --replace

  • Hit OK


To get the themes the best destination is www.gnome-look.org

Geting And Installing the drivers for your Graphics Card In Ubuntu

Many people have problems with the drivers provided by the default ubuntu installation. This problem occurs specially in ubuntu as it believes in the real “Open Source” philosophy and doesnot include any closed source drivers in the distro.

The cards with usual problems are:

  1. ATI

  2. Nvidia


Intel cards usually work out of the box.


Now to find the cardthat you have, type the following in the terminal:


lspci | grep -i graph


Now check the presence of NVIDIA or ATI in the output


NVIDIA is present:

  • Get the driver binary from nvidia.com

  • Say it is “Nvidia-Linux-{architecture)-{version_number}.run”

  • Save it to desktop

  • Add the 8.04 CD to the Synaptic repository (Go to Adding The Repositories Section that explains repositories for guidance)

  • Install the build-essential package by executing the following in the terminal:


sudo apt-get install build-essential


  • Go to the virtual terminal by CTRL+ALT+F1

  • Login

  • Stop Gnome Display Manager by typing:


sudo /etc/init.d/gdm stop


  • Go to the desktop by:


cd Desktop


  • Execute the installer by:


sh NVIDIA*.run


  • Go thru the normal instructions, keeping your eyes open at all times.

  • After the install completes, start the Display Manager by :


sudo /etc/init.d/gdm start


  • Get back to the graphic terminal by CTRL+ALT+F7

Assuming that you din't goof up, you are done!!!


ATI is present:

  • Here you need to install XGL ( AFAIK AIGLX works, but it dint work for me... so goin with the general way)

  • Enable all repository components (See the Configuring Repositories post for a how to) .... and refresh the database.

  • Install XGL by executing:


sudo apt-get install xserver-xgl


  • Restart the X-Server by CTRL-ALT-BKSPC

  • Hopefully your work is done!!!

Setting up Repositories and CD packages in Ubuntu

The first thing to do after installing ubuntu (or in that case, any debian operating system) is to enable all the sources of software and packages that are available across the standard repository loop.

This is a straight forward process and involved almost no file editing...so rejoice!!!

Follow the following steps:

  • Open System->Administration->Synaptic Package Manager

  • Go to Settings->Repositories

  • Tick All the checkboxes in the 'Ubuntu Software' and 'Third Party' tabs except “Source Code” (unless you are interested in downloading source code)

  • Enable updates in the Updates tab

  • Close the settings window

  • Refresh the local database by hitting the 'Reload' button

  • Thats It!!!!



Adding CD-Roms With Packages To The Database


  • Open Synaptic package manager

  • Go to: Edit->Add CD Rom...

  • Load the CD

  • Wait for the process to complete

  • Hit YES if any other CD is left or else NO

Thats it!!!

Friday, May 2, 2008

TOP 5 : Media Players For Linux

One of the many perks of being a Linux user is that you have plenty of excellent software to choose from. This is especially true if you are in search for an essential application like a media player because there are definitely loads of options. However, this could sometimes be a disadvantage particularly to new-to-Linux users for the reason that they could get overwhelmed with the many choices they have.

To somehow guide those who are still looking for a media player that will suit their needs, I have put together a list that I hope will help.

Amarok

Amarok is a free software music player for Linux or other varieties of Unix. It makes use of core components from the K Desktop Environment, but is released independently of the central KDE release cycle.

Amarok serves many functions rather than just playing music files. For example, Amarok can be used to organize a library of music into folders according to genre, artist, and album, can edit tags attached to most music formats, associate album art, attach lyrics, and automatically "score" music as it is played.

Here are the primary functions or uses for Amarok:
* Playing media files in various formats including but not limited to (depending on the setup) FLAC, Ogg, MP3, AAC, WAV, Windows Media Audio, Apple Lossless, WavPack, TTA and Musepack. Amarok does not play digital music files embedded with DRM.
* Tagging digital music files (currently FLAC, Ogg, WMA, AAC, MP3, and RealMedia).
* Associating cover art with a particular album, and retrieving the cover art from Amazon
* Creating and editing playlists, including smart and dynamic playlists. The dynamic playlists can use such information as the "score" given to a song by an Amarok script, and the playcount which is stored with the song.
* Synchronizing, retrieving, playing, or uploading music to the following digital music players: iPod, iriver iFP, Creative NOMAD, Creative ZEN, MTP, Rio Karma and USB devices with VFAT (generic MP3 players) support.
* Displaying artist information from Wikipedia and retrieving song lyrics.
* Last.fm support, including submitting played tracks (including those played on some digital music players) to Last.fm, retrieving similar artists, and playing Last.fm streams.
* Podcast

Rhythmbox

Rhythmbox is an audio player that plays and helps organize digital music. Originally inspired by Apple's iTunes, it is free software, designed to work well under the GNOME Desktop using the GStreamer media framework. It is currently under active development.

Playback from a variety of digital music sources is supported, excluding MIDI. The most common playback is music stored locally as files on the computer (the 'Library'). Rhythmbox supports playing streamed Internet radio and podcasts as well. The Replay Gain standard is supported.



Totem

Totem is a free software media player (audio and video) for the GNOME computer desktop environment that runs on Linux, Solaris, BSD and other Unix and Unix-like systems. It is officially included in GNOME starting from version 2.10 (released in March 2005), but de facto it was already included in most GNOME environments. The default backend is GStreamer framework but Totem can also use xine libraries. Totem is included as the default media player in many desktop Linux distributions, including Ubuntu, Mandriva Linux and others.

Thanks to a large number of plugins developed for GStreamer, Totem is able to play all mainstream media formats, both open and proprietary ones. It also understands numerous playlist formats, including SHOUTcast, M3U, XML Shareable Playlist Format (XSPF), SMIL, Windows Media Player playlists and RealAudio playlists. Playlists are easily manageable using drag-and-drop features.


VLC

VLC media player is a portable multimedia player, encoder, and streamer supporting many audio and video codecs and file formats as well as DVDs, VCDs, and various streaming protocols. It is able to stream over networks and to transcode multimedia files and save them into various different formats. VLC used to stand for VideoLAN Client, but that meaning is now deprecated.

VLC uses a large number of free decoding and encoding libraries. Many of its codecs are provided by the libavcodec codec library from the FFmpeg project, but it uses mainly its own muxer and demuxers. It also gained distinction as the first player to support playback of encrypted DVDs on Linux by using the libdvdcss DVD decryption library.

Version 0.8.6, which adds support for WMV version 9 and enhances support for H.264, was released on 10 December 2006.

MPlayer

MPlayer is a free and open source media player distributed under the GNU General Public License. The program is available for all major operating systems, including Linux and other Unix-like systems; Microsoft Windows and Mac OS X. Versions for OS/2, AmigaOS and MorphOS are also available. The Windows versions work with some minor problems, and also in DOS using HX DOS Extender. A port for DOS using DJGPP is also available.

MPlayer supports a wide variety of media formats. In addition to its wide range of supported formats MPlayer can also save all streamed content to a file.

MPlayer is a command line application that has different optional GUIs for each of its supported operating systems. Commonly used GUIs are gmplayer (the default GUI for GNU/Linux and other Unix-like systems, and Microsoft Windows), MPlayer OS X (for Mac OS X), MPUI (for Windows) and WinMPLauncher (also for Windows). Several other GUI frontends are also available for each platform.

Funny : A Message from Steve Ballmer to Ubuntu








Good day to everyone.




After two years in the making, Canonical Ltd. has announced right on cue the Long Term Support (LTS) release of Ubuntu 8.04. In behalf of Microsoft Corporation, I would like to congratulate Mark Shuttleworth and each and every Ubuntu community members who made it all possible.

Now, you might be wondering why I'm posting my message here in this mostly Linux and Open Source related blog. My friends, my answer to that is simple , " I LOVE LINUX". Yes I do. It's a secret that I've been trying to keep for so many years. And because it's a secret no more, I would like to take this opportunity to tell the whole world that I love all the Free and Open Source guys. I love Linus Torvalds, Eric S. Raymond and Jon "Maddog" Hall. I love Richard M. Stallman and his hair, and all the FOSS people that I failed to mention here, I love them all. Seriously, I want to be like them.

Let me tell you another secret. I have been using this new version of Ubuntu since yesterday. Mark sent me a very special limited edition of Ubuntu 8.04 on a Blu-ray disk, the one with a serial and activation number. And all I can tell you is this; I really adore what I'm seeing that I wanted to do the monkey dance all over again. The Wubi thing, which let you install Ubuntu inside Windows is just magnificent. I also tried the spinning cube desktop effects and was just blown away that I immediately called Mr. Gates. He told me that he's been playing with it since last year and have been wanting to implement it on the next Windows version. However, he told me that he wanted to beat Linux by putting 3 desktop cubes spinning together side-by-side. I told him that it was a bad idea. Why not put 6 cubes? Bill then told me that he'd think about it.

We all know that Windows Vista is the finest, greatest and most excellent computer operating system in the history of mankind. But after extensively using Ubuntu last night for 26 long minutes, I can say that it is a good OS. Not as superb and as breathtaking as Vista but it is good nonetheless. And because Ubuntu is a nice OS, we are offering to buy Canonical Ltd. for 999.9 Billion Dollars. Take it or leave it Mr. SpaceShuttleworth.

I won't end this message without leaving you this wonderful motto. I want you all to live and breathe with this motto and place it deep inside your heart.
"SAY NO TO PIRACY"

Thank you very much!

Sincerely,
Steve Ballmer
Microsoft, CEO


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Disclaimer: This is just a silly parody taken from the internet and should not be taken seriously. It is purely for fun and no harm is intended to anyone.
Credits: www.junauza.com

Wednesday, April 30, 2008

How to:Restore an over written GRUB boot partition:

Hi guys, sometimes when we install a fresh copy of Windows or even repair windows, the MBR gets overwritten leaving us stuck with only windows and no way to access our dah'lin linux system. Here I have tried to present a short HOWTO on how to get back your all O.S. in bootable form through grub after windows install, repair or whatever...



Step 1: Boot from a live CD

(Why: booting from a live CD puts you in a linux environment with root privileges which are needed to edit grub)

Step 2:
Execute the following in the terminal without the $ sign... $ stands for the prompt(similar to c:\> in windows)
(Applications->Accessories->Terminal )

$sudo -i

(Why: sudo -i converts the current terminal session into root session.You wont have to attach sudo before every command)

Step 3:
Execute

$grub


This will put you to the Grub shell

Step 4:
Find your previous bootable linux partition by


grub>find /boot/grub/stage1

Suppose you get:
(sd0,7)
which meens that in the drive that is referenced at sd0, the partition is the 7th partititon.
you may get different outputs of the type (disk_code,num)
so in the following steps, replace the disk_code by your actual disk code( hd0...sd0...sda... etc) and num by your partition number.
DONT BLINDLY COPY !!! :-p

Step 5:
Reset back the root partition to the original partition by executing:

grub>root (disk_code,num)

(Dont forget to substitute the values of disk_code and num )


Step 6:
Install grub starting with the MBR by executing:

grub>setup (disk_code)

This will install part of the bootloader into the MBR and the main parts into the partition where your linux is installed.
Again...Dont forget to substitute the values of disk_code and num )

Step 7:
Assuming all went well, give yourself a pat on the back as you hav just reinstalled the bootloader and stopped yourself from making the idiotic mistake of format-and-install-again-and-again.... :-)

Now for the last parts...execute

grub>exit

(Why: Simply to quit grub and go back to the main prompt for the last step)

Step 8:
Restart the system either by the graphical way (System->Shutdown->Restart ) or the terminal by executing

$reboot


easy huh???
watch out for a howto on the basics of editing the grub's menu file (menu.list).....coming soon...