Archive

Author Archive

Getting to know GRUB

July 16, 2011 5 comments

Hey Everyone!!!
Nice to be with you all again. So today its going to be the multiboot menu, since many of us run multiple OS on our system.

When I first installed Linux a couple of years back, mine first was FEDORA and since then I am in love with it. Currently I am riding F-14(that another beauty of FEDORA) and when I look at the multi boot menu, I feel why can’t we do something about it there are a lots of menu options, the count down timer, then there is this a blue colored background image (though blue is one of by favorite colors).

Many of us do not require to use all the options provided and selecting those options even by mistake is a sigh of trouble.(Reboot the system. well, you can fast forward turn off the system,not recommended though.)

Firstly, What is GRUB?

GRUB stands for GRand Unified Bootloader. A bootloader is a program that is the first one to be loaded in the memory. It’s the one that checks your hard drive for OS installations and loads the KERNEL in the memory. When we do a OS installation the process adds an entry to the Master Boot Record(MBR). Bootloader is the one to fetch the data along with the partition location for the OS installed.

There are other bootloaders available as well. Another famous bootloader program is LInux LOader(LILO). LILO was the default bootloader in the starting years multiboot systems. But now a days GRUB is becoming the default bootloader. Both allows you to modify the entries and the countdown timer. But GRUB has some remarkable advantages over LILO and they are :

  1. you can practically add unlimited entries in the bootloader where as with LILO you are limited to sixteen entries.
  2. now GRUB come with a graphical interface, rather than a black and white screen, you can have a more presentable screen.
  3. GRUB provides support for Command Line where you can read practically any file on the hard disk.

Here we are going to learn how we can customize the GRUB menu on a Fedora System. For this you need to learn about one file located in the directory “/boot/grub/”, grub.conf. This file contains all the details regarding the basic settings available with the GRUB menu.

To get to this file you need to do follow these steps:

  1. Login to any user account.
  2. Open console and gain elevated privileges by logging in as “su”.
  3. change the active directory to “/boot/grub/”.
  4. open “grub.conf” in any editor( gedit in my case).

Screenshot-1

The file just looks like as shown.

image

(click to magnify)

The image shows the default configuration file content. Each line in this configuration file hold information regarding different behavior of GRUB menu.

Lets look into each in details.

option_comments

This section is marked with pound sign denotes the comments.this bear no meaning to the BIOS, but to the user. The section contains the basic information about the GRUB installed on the system.

Anaconda is the name of the Fedora installer.

Each time you start your system the GRUB loads settings from this file so if you want to change any settings unlike LILO, you don’t have to install GRUB again and again. The other details mentioned in this section are the self explanatory and straight forward.

Line:“default=0”

This is the section which tell the GRUB which option to load as default OS in case the user does not explicitly selects the option. This follows a zero based index sequence. Change this value to the option number you want to make as default OS.

Line:“timeout=15”

This option is the “timeout” part. The time allowed to the user to select an option from the bootloader list before the default option is loaded. the default value is 15 sec. and more depending upon the distribution you use. Set this to suit your comforts for fast startup of the system.

Line:“splashimage=(hd0,4)/grub/splash.xpm.gz”

GRUB support for a graphical interface, allows the support for a background image to the GRUB menu. This option specifies the location of the splash image to be shown as background image. Again, the location is specified relative to the “/boot/“ directory. (More on this later in this post).

Line:“hiddenmenu”

This option “hiddenmenu” tells the GRUB to initially hide the list from the user. A different screen is displayed to the with a few ever details(the default option name and the count down timer). And on interruption, the GRUB list is displayed.

The menu options in GRUB:

option f

This section(shown in the picture) is the real deal for the GRUB. It stores the details of each option in the grub menu like the partition on which the corresponding OS is installed, Kernel location. “title” specifies the name to appear in the list. “root” is the partition of harddisk in which the OS installed. “kernel” specifies the location of the kernel image on the harddrive. “initrd” is an image file for the sequence for preparing the system for the kernel to be loaded and provide kernel with details of hardware on the system.”rootnoverify” is used with the operating systems which cannot be loaded directly, that is , no kernel file is specified for the same. It is taken that the kernel will be found on the specified partition and loaded. Since these OS cannot be loaded directly so the are done via method called “chainloader”. This is a method to pass the control to another bootloader from GRUB to one located on the specified partition pointed by the menu entry.


So now you know “grub.conf” file and are all set to edit the settings according to your preferences.

The first thing I would suggest you to edit is the “default” option. Remember it follows a zero based index, so set the option to the OS you work on default.

Next is the “timeout” option. No one wants to wait for 15 long seconds while booting. That’s eternity. Please do some thing about it!!

Next is the “splashimage”. This is some fancy stuff where you can put the image of your choice. But to do that you need to know something about the image you select. The image specified with an extension xpm (XBitMap), a way to store image in ASCII format.

XPixMap (XPM) consists of an ASCII image format and a C library. The format defines how to store color images (XPixMap) in a portable and powerful way. The library provides a set of functions to store and retrieve images to and from XPM format data.

To specify an image of your own, follow the following steps.

Select an image and open it in any editor(I used KolourPaint). Transform the image to size 640×480 and change the color scheme to 8-bit color(256 colors). Save the image in XPM format.Compress the image to “.gz” archive format and copy it to the folder “/boot/grub/”. Now change the name of file from “splash” to one specified by you(“spin” in my case) and you are done.

The following images specifies the process in sequence:

(Transform the image)

Screenshot-2

(apply color scheme from image effects)

Screenshot-4

(store the file under the name “grubindex” with the extension “.xpm”)

Screenshot-6

(add the image to “.gz” archive )

Screenshot7

(With “su” login use mv command to move the file spin.xpm.gz to the directory “/boot/grub/” and modify the file grub.conf)

Screenshot8

The next are the OS on the system listed in the GRUB. “title” is any valid string, so you can change it to some thing more meaningful. Like “Windows7” sound to me more meaningful than “other” and “Fedora (2.6.33…fc13.i686…)” would still mean “Fedora 13”. You can also add or remove any entry to the list from this section.


Some important notations:

sda-specifies the primary hard drive.

sba- denotes any removable storage devices.

(hd?,?)-denotes the primary storage, that is, hard drive(hd?) and the partition number on the storage

i386/i686-Compilation of OS for various processors.
The packages are built (optimized) for the:
i386 – Intel 386 processor
i486 – Intel 486 processor
i586 – Intel Pentium early AMD
i686 – Intel Pentium Pro and beyond


Well for now that already quite a stuff. Not to make this really long and boring, I leave you to make your multiboot menu some more interesting.

See you very soon, with yet some interesting stuff.

aloha!!

Kumar Abhishek.
(“m@rcus”)

Customizing System Startup

July 5, 2011 3 comments

Hello Everyone!!
Told you I’ll be back very soon and this mark the beginning for a lot to come!!

This is by far the most obvious asked question and a very ill handled problem among most of the students and even some non-technical users.

Why has my system become slow??

And the most common solution is format the system.But doing that you are wasting a hell lot of time. You just lost all your settings in various innocent application and a hell of a time formatting, reinstalling the OS, the applications you had. And now you would stress your brain cell remembering the settings you applied to each of them because you didn’t made a written note of the settings coz you perfected them over a time.

Well it certainly freaks me out!!

Well the problem is,

any Computing Device whether Windows or Linux based when it boots up has to perform all the task that you gave to it!

Yes, you do appoint many task to the Operating System in terms of startup programs and services each time you install a new program. All of them should be initialized loaded into primary memory to be at your reach. Now the point is, you often do not need all the applications, all at once. So why waste the precious “System Resources”, memory and computing power coz they are limited. There is one more thing that does not occur coz you system is slow but makes you wait. That is the timeout at different stages of Startup.

So lets get started.

Step 1:

when you boot your System the first step is BIOS initialization. Can’t do tweaks with that.
But what’s with the blinking cursor that stays on the screen for quite a time.

Yes here you  can do the tricks. your BIOS is configured to check a few devices and load the OS kernel found on the first device. By default this is configured in the following order:

  • Disk drives,
  • Removable devices,
  • Hard disk,
  • Network

That not quite like the perfect one. Yes you recognized it.

Well I know my OS is on my hard drive.

Yes do it. Go into BIOS and change the boot order.
I prefer the order as:

  • Hard drive,
  • Removable devices,
  • Disk disk,
  • Network

(NOTE: OS installation through removable devices ,like flash drive,External hard drive is also possible and is quite fast)

And here you just saved 5 seconds of startup time.


Step 2: Optional on many computers. This is the part were you meet with multiboot menu on system running more than one Operating Systems. Most general case is a Linux installation parallel to Microsoft Windows. This is were we get into Linux my personal favorite. You can do a lot with the Grub/LILO loader menu.and that I will be discussing in my next post.


Step 3:

[For Windows System]
Finally I get to see the login screen. Well here is the thing. A compromise between speed and time. Ask your self

Is this my personal System?
Do all the users know the password to my System?

If your answer is “yes” and no body has access to your system without your permission or your password is a “public property” but still you have to tell your secret Girlfriend’s name to everybody around you just qualified to save some more time.

Login to the account yeah wait a minute just another and yet another..
yeah now you see your desktop.

        1. Goto Start->Run (press Win+R).
        2. type “control userpasswords2” (obviously without quotes).

(NOTE:This is quite a powerful dialog box you got. So handle the option carefully,especially XP users. You may end up deleting the only user you have and thus the customization you did)

The trick is a small check box you see

User Accounts
Go ahead and uncheck the box. You will be asked your password to confirm the action.Now you saved the time to enter the password at the login screen and you are directly taken to Desktop the next time you login.This saves your few seconds you could have used for manual typing and the cost of typing errors.And as a bonus you also kept your girlfriend’s name a secret. The good thing is your account is still password protected. and when you leave your system to get yourself a cup of coffee just press Win+L and lock your desktop.


Step 4:

Here is the part where each one is for himself. What I mean is, our need differs in ways.
And that should define what programs we keep in startup and the services we run in background.

Take for example, I use Photoshop very often, do c and c# coding, so its logical for me to keep Adobe Bridge running.
But keep running a Mat LAB thread and IIS server running in background doesn’t makes sense.

Yes that what I am talking about. Again,

  1. Reach for Run dialog box (remember, WIN+R).
  2. type “msconfig.msc”

Again a powerful toolbox.

(NOTE: Do not mess up with the option you are not sure about. You may end up loosing track of your OS installation from Master Boot Record(MBR).)

Here our job is to configure startup tab and services tab.

Services under System Configuration

Here you see a bunch of services running that you can do away with. As for example, I certainly would not need FAX services on my PC. Do not worry if you disabled any important services, you know where to enable to from. Windows doesn’t allows you to disable any critical services and child services in hierarchy. So explore your needs.

Startup under System Configuration

Customizing Startups is again your needs and your demands. There are certainly a few threads I like to disable. And I often keep a check on the startup programs. Some programs just don’t get it “They are not NEEDED here” and of course my mood changes and the application I work on for a time frame.

Just toggle the check boxes and click apply.

And here you saved some more seconds and made some free space available for your application to use.

NOW grab a stop watch as when you click OK, the system demands reboot. If you read this article in whole I take it, you  must have taken the stopwatch reading earlier. Time to see the improvements.

(KEY: Start your watch on boot up, coz you performed a hell of customization saving them will take time.)


Some more Facts:

Apart from all the settings, tweaks you applied there are a few thing you should know:

Try not to install loads of program and do remove programs not required in recent future. It just increases the job of OS.

Try to keep your Windows Directory used space minimum as possible, use other drives for storing data. In case you have less primary memory, OS uses a apart of system directory as paging memory and you would want to make sure its available.

Do remove temporary files  periodically, as with the amount of data the response rate of applications also increases.

Defragment your Hard Drive periodically, less the fragmentation better the response.

Some more help available:

A number of tools are available free as well as commercially to help you take care of the job at hand.

CCleaner, TuneUP, Process Explorer, O & O Defrag,Ultra Defrag.
But use the Windows in-build tools to do the job as explained and you do get better results.


I hope this is useful to you all as it has been for me. So now hold your collar tight coz your pc got a performance boost over the guy sitting next to you.

That’s it for the day!
OMG its 4’oclock morning.

See you all very soon coz I have a lot to say(write) and even more to share.
signing off!!

Kumar Abhishek.
(“m@rcus”)

Categories: System Configuration
Design a site like this with WordPress.com
Get started