GRUB (GRand Unified Bootloader)

Briefly, a boot loader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to an operating system kernel software (such as Linux). The kernel, in turn, initializes the rest of the operating system (e.g. a GNU system).

GNU GRUB Homepage
http://www.gnu.org/software/grub/

Problem

“There is not a boot manager screen at all, it just boots right into windows but GRUB boot window does not appear. I cannot figure out to access fedora, I do not have a boot disk and need to know if there is someway to boot into fedora”

“I forgot to install GRUB, I didn’t install GRUB in the MBR, I chose to install GRUB on the first track on the partition where I installed Fedora but that was not an active primary partition”.

Solution

You have to install GRUB on the MBR (Master Boot Record). To do this just follow this steps:

(First of all, enter your BIOS setup and in BOOT Sequence window choose to boot with CDROM first.)

1) Boot with your Fedora Core Installation CD 1.

2) Type “linux rescue” at the prompt.

3) Answer the questions about keyboard and language.

4) Tell the rescue mode to use your proper partition to mount (the one that you want to get booted into)

5) When you come to the console prompt type: chroot /mnt/sysimage

6) Type grub

7) Set the GRUB’s root device to the partition containing the boot directory like this:

grub> root (hd0,0)

Filesystem type is ext2fs, partition type 0x83

I have Windows 98 in hd0,0 ; Windows XP in hd0,1, Fedora Core /boot partition in hd0,2 and Mandrake /boot partition in hd0,6. So in my case the command should be: > root (hd0,2)

If you are not sure which partition actually holds this directory, use the command ‘find’ like this:

grub> find /boot/grub/stage1

This will search for the file name ‘/boot/grub/stage1’ and show the devices which contain the file.
Once you’ve set the root device correctly, run the command ‘setup’.

8) Then, run the command setup

grub> setup (hd0)

Checking if “/boot/grub/stage1” exists……. no
Checking if “/grub/stage1” exists……. yes
Checking if “/grub/stage2” exists……. yes
Checking if “/grub/e2fs_stage1_5” exists……. yes
Running “embed /grub/e2fs_stage1_5 (hd0)”……. 15 sectors are embedded
succeded
Running “install /grub/stage1 (hd0) (hd0) 1+15 p (hd0,2)/grub/stage2 /grub/grub.conf……. succeded
Done

This command will install GRUB boot loader on the Master Boot Record (MBR) of the first drive.

9) Type quit

grub> quit

GRUB is now in the MBR.

10) Finally, you’ll have to edit your /boot/grub/grub.conf, for example whith nano:

> nano /boot/grub/grub.conf

(/etc/grub.conf or /boot/grub/grub.conf or /boot/grub/menu.lst, they are the same file) This file has the boot partitions of the disk/s.

11) Restart your PC without the Fedora Core CD 1 Installation.

My grub.conf

default=0
timeout=30
splashimage=(hd0,2)/grub/splash.xpm.gz

title GNU/Linux Fedora Core 1 (2.4.22-1.2188.nptl)
root (hd0,2)
kernel /vmlinuz-2.4.22-1.2188.nptl ro root=LABEL=/ hdc=ide-scsi hdd=ide-scsi apm=off acpi=on vga=788
initrd /initrd-2.4.22-1.2188.nptl.img

#title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
#root (hd0,2)
#kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
#initrd /initrd-2.4.22-1.2174.nptl.img

title GNU/Linux Mandrake 9.2
kernel (hd0,6)/vmlinuz root=/dev/hda8 devfs=mount hdc=ide-scsi resume=/dev/hda9
initrd (hd0,6)/initrd.img

title Microsoft Windows 98 SE & XP Pro
rootnoverify (hd0,0)
chainloader +1

List of commands,

default=0
My default boot system is, of course, Fedora.

timeout=30
Fedora will boot in 30 seconds if you don’t touch anything.

splashimage=(hd0,2)/grub/splash.xpm.gz
Generally the splash image is in your /boot partition. In my case, hd0,2 is where I have the image.

title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
The name of your OS that will appear in your menu at starup, you can write anything you want.

root (hd0,2)
This is your /boot partition specifies which partition contains your Linux kernel image. So “root (hd0,2) tells GRUB that the kernel is on the 3rd primary partition of my first hard disk (I have two), in my case (hd0,2).

kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
Tells GRUB where to find your kernel, my kernel version is 2.4.22-1.2174, you have to type your kernel version.

rhgb
Red Hat Graphical Boot

apm=off acpi=on
I had to add ‘apm=off acpi=on’ to my kernel parameters to get power-off to work properly.

initrd /initrd-2.4.22-1.2174.nptl.img
Tells where your init ramdisk image is located.

title Microsoft Windows 98 SE & XP Pro
As I said, I have Windows 98 in hd0,0 and Windows XP in (hd0,1).

rootnoverify (hd0,0)
rootnoverify tells GRUB to boot from the Windows partition, but not to attempt to mount it.
(hd0,0) is where Windows XP puts the boot.ini to boot into Windows 98 and XP.

chainloader +1
chain-load is the mechanism for loading unsupported operating systems by loading another boot loader. It is typically used for loading DOS or Windows.
chainloader tells GRUB to chain to Windows’ boot loader which will start Windows.

Other options you can use:

map
If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one.

Map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. Here is an example:

grub> map (hd0) (hd1)
grub> map (hd1) (hd0)

This performs a virtual swap between your first and second hard drive.

Caution: This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won’t work.

makeactive
Set the active partition on the root disk to GRUB’s root device. This command is limited to primary PC partitions on a hard disk.

Code:

title Windows 98 SE map (hd0) (hd1) map (hd1) (hd0) makeactive rootnoverify (hd1,0) chainloader +1

hide
Hide the partition partition by setting the hidden bit in its partition type code. This is useful only when booting DOS or Windows and multiple primary FAT partitions exist in one disk.

unhide
Unhide the partition partition by clearing the hidden bit in its partition type code. This is useful only when booting DOS or Windows and multiple primary partitions exist in one disk.

Explanation and examples of the hide and unhide commands

If you installed more than one set of DOS/Windows onto one disk, they could be confused if there are more than one primary partitions for DOS/Windows. There is a solution if you do want to do so. Use the partition hiding/unhiding technique.

If GRUB hides a DOS (or Windows) partition, DOS (or Windows) will ignore the partition. If GRUB unhides a DOS (or Windows) partition, DOS (or Windows) will detect the partition. Thus, if you have installed DOS (or Windows) on the first and the second partition of the first hard disk, and you want to boot the copy on the first partition.

Here’s how to create two installations of Windows, hda1 and hda2 or (hd0,0) and (hd0,1), using the commands hide and unhide.

For Windows 98 SE “My Entry”:

Code:

title My Entry unhide (hd0,0) hide (hd0,1) rootnoverify (hd0,0) makeactive chainloader +1

For Windows 98 SE “Family Entry”

Code:

title Family Entry unhide (hd0,1) hide (hd0,0) rootnoverify (hd0,1) makeactive chainloader +1

I did not have to use the ‘hide’ or ‘unhide’ command ’cause Windows XP, 2000 or NT have a boot manager (boot.ini) included. So, I only had to point where this boot.ini is. In my case, Windows XP copies this boot.ini where Windows 98 is installed, (hd0,0)
You should definitely use the ‘hide’ or ‘unhide’ command if you have,for example, two installations of Windows 98 or ME.

If everything went just fine, voila, GRUB now becomes your main boot manager for your multi OS system.

GRUB and Linux Partitions

First of all, GRUB requires that the device name be enclosed with ( ). Please, note that the partition numbers are counted from zero, not from one.

(hd0) in GRUB = is hda in Linux
Here, ‘hd’ means it is a hard disk drive. The first integer ‘0’ indicates the drive number, that is, the first hard disk.

(hd1) in GRUB = is hdb in Linux
The first integer ‘1’ indicates the drive number, that is, the second hard disk.

(hd0,1) in GRUB = is hda2 in Linux
This expression means the second primary partition of the first hard disk drive. In this case, GRUB uses one partition of the disk, instead of the whole disk.

(hd0,4) in GRUB = hda5 in Linux
This specifies the first extended partition of the first hard disk drive. Note that the partition numbers for extended partitions are counted from ‘4’, regardless of the actual number of primary partitions on your hard disk.

(hd0,5) in GRUB = hda6 in Linux
This is the first logical unit of the extended partition of the the first hard disk.

(hd1,0) in GRUB = is hdb1 in Linux
This is the first primary partition of the second hard disk.

he Windows NT/2000 Resource Kit provides two utilities that allow you to create a Windows user-defined service for Windows applications and some 16-bit applications (but not for batch files).

Whats needed for Windows NT/2000:
Instrsrv.exe installs and removes system services from Windows NT/2000
Srvany.exe allows any Windows application to run as a service.
You can download both files here srvany.zip

This zip includes three files. The two you need srvany.exe and instsrv.exe to install the services and also srvany.wri which documents everything you can do with the program.
Note: Make sure the Services Manager is closed while running the DOS commands.
devami icin t ikla.

http://www.tacktech.com/display.cfm?ttid=197

semget: No space left on device Last Modified: Mar 28, 2006, 11:30 am

This relates to semaphores on your system (you’ve run out). Run the following to clear them out:

ipcs | grep apache | awk ‘{print $2}’ > sem.txt
for i in `cat sem.txt`; do { ipcrm -s $i; }; done;

Thunderbird problems: “building summary file for Inbox”

Mozilla Thunderbird has trouble downloading new mail. The status bar shows “building summary file for Inbox”. Subsequent attempts to download mail may result in new messages being downloaded that are empty when you try to read them, multiple entries for new messages in the Inbox, or large numbers of reported unread messages that cannot be found. The symptoms may suggest a corrupt Inbox.

Solution

These problems can occur if you do not compact the Inbox. Mozilla Thunderbird mailboxes require periodic maintenance to prevent such problems from occurring. By the time the problems occur, compacting the Inbox, though still required, may not be sufficient to resolve the problem.

Method 1

Compact the Inbox if you have not already done so. Right-click the Inbox and select Compact this folder.

  • Close Mozilla Thunderbird.
  • Using Windows Explorer, navigate to the folder containing the messages for this account. This will be in a location similar to: C:\Documents and Settings\\Application Data\Thunderbird\Profiles\xxxxxx.default\Mail\. If you have multiple accounts on the same mail server then you may need to look at the names of the subfolders to identify which folder belongs to which account.
  • Delete the file named Inbox.msf. (Do not delete the file named Inbox, with no file type extension. This is the file containing your messages, and it will probably be very large.)
  • Restart Mozilla Thunderbird.

If the problem has not been resolved, try Method 2.

Method 2

Recreate the problem account.

  • Select the problem account and click View settings for this account.
  • Change the name of the account to e.g. Old .
  • Select Server Settings, and clear all the options that check for or download new messages.
  • Click Add Account, then create a new account with the same settings as the old one.
  • Select all the messages in the Inbox of the old account and drag and drop them into the Inbox of the new one.
  • Drag and drop any message folders from the old account to the new one.
  • Manually recreate any message filters that existed in the old account.
  • Once you are sure that all your messages have been transferred to the recreated account, delete the old one.

If necessary, you can use the Folderpane Tools extension to change the order of your Thunderbird accounts so that the recreated account appears in the same position as the original.

Compacting the Inbox

To ensure that this problem does not occur, you should configure Thunderbird to automatically compact mail folders. Click on Tools, Options, select Offline & Disc Space, and check Compact folders when it will save over xxxx KB.

Applies to
  • Mozilla Thunderbird 1.0 and up

exim

What are some tools that I can use to troubleshoot mail delivery issues with Exim on my linux / BSD / unix server?

This article will highlight some of the utilities included with the standard exim installation that assist in troubleshooting mail delivery issues.

Exigrep

Exigrep is very useful when you need to search for specific strings in the exim logfile. The reason for this is that it will look for the search string you specify, match that to a message-ID, and then display all the lines pertaining to that message.

Usage: exigrep /path/to/exim/logfile

Examples:
root@cpdemo [~]# exigrep 1BbLM3-0007fA-0v /var/log/exim_mainlog
2004-06-18 10:32:35 1BbLM3-0007fA-0v <= root@cpdemo.example.com U=root P=local S=1037
2004-06-18 10:32:37 1BbLM3-0007fA-0v => /dev/null <
devnull@cpdemo.example.com> R=system_aliases T=**bypassed**
2004-06-18 10:32:37 1BbLM3-0007fA-0v Completed

-OR-

root@cpdemo [~]# exigrep inspirem@cpdemo.example.com /var/log/exim_mainlog
2004-06-14 00:00:00 1BZjZg-000750-Ch <= inspirem@cpdemo.example.com U=inspirem P=local S=597
2004-06-14 00:00:00 1BZjZg-000750-Ch == example
@yahoo.com R=defer_router defer (-1): All deliveries are handled by MailScanner
2004-06-14 00:00:03 1BZjZg-000750-Ch => example
@yahoo.com R=lookuphost T=remote_smtp H=mx1.mail.yahoo.com [64.157.4.78]
2004-06-14 00:00:03 1BZjZg-000750-Ch Completed

2004-06-15 00:00:01 1Ba63E-0004gD-US <= inspirem@cpdemo.example.com U=inspirem P=local S=597
2004-06-15 00:00:01 1Ba63E-0004gD-US == example
@yahoo.com R=defer_router defer (-1): All deliveries are handled by MailScanner
2004-06-15 00:00:04 1Ba63E-0004gD-US => example
@yahoo.com R=lookuphost T=remote_smtp H=mx1.mail.yahoo.com [64.156.215.19]
2004-06-15 00:00:04 1Ba63E-0004gD-US Completed

Also notice that if you are looking for information that is listed in multple email transactions(ie. email addresses, sending hosts, etc …), exigrep will provide a space in between each email transaction.

Exiwhat

The ‘exiwhat’ command displays what each running exim process is doing at that given moment. This can be helpful in tracking down the cause for hanging exim processes or monitoring exim processes while they perform certain functions during testing.

Example:

root@cpdemo [~]# exiwhat
2118 daemon: -q1h, listening for SMTP on port 25 (IPv4)
2130 daemon: no queue runs, listening for SMTPS on port 465 (IPv4)
31640 handling incoming connection from [67.19.0.37]

Exim -bh

This section describes another usage of the exim mail server binary with special arguments that allow you to simulate a mail delivery from an external IP as the sender from the local server with the exim installation. This can be very useful when you need to recreate the mail delivery issue and you don’t have access to the sender’s machine to do so(ex. mail relaying, blacklists, etc.).

Usage: exim -bh

This will create a fake SMTP session which appears to be from . Not only that, but it also displays what exim is doing behind the scenes, and also what it would normally log. Now, bear in mind that this will not actually inject a message into the queue, nor will it actually log anything. This does however require knowledge of SMTP commands, but they are fairly easy. I have highlighted them in bold below for easier reading. Example:

root@cpdemo [/var/spool/exim/input]# exim -bh 216.87.129.155

**** SMTP testing session as if from host 216.87.129.155
**** but without any ident (RFC 1413) callback.
**** This is not for real!

>>> host in host_lookup? no (option unset)
>>> host in host_reject_connection? no (option unset)
>>> host in sender_unqualified_hosts? no (option unset)
>>> host in recipient_unqualified_hosts? no (option unset)
>>> host in helo_verify_hosts? no (option unset)
>>> host in helo_try_verify_hosts? no (option unset)
>>> host in helo_accept_junk_hosts? yes (matched “*”)
220-cpdemo.domain.com ESMTP Exim 4.34 #1 Fri, 18 Jun 2004 16:05:31 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
helo bbozo-2.example.com
>>> bbozo-2.example.com in helo_lookup_domains? no (end of list)
250 cpdemo.domain.com Hello bbozo-2.example.com [216.87.129.155]
mail from: ken@bbozo-2.example.com
250 OK
rcpt to: inspirem@cpdemo.domain.com
>>> using ACL “check_recipient”
>>> processing “accept”
>>> check hosts = :
>>> host in “:”? no (end of list)
>>> accept: condition test failed
>>> processing “warn”
>>> check condition = ${if and {{match{$local_part}{(.*)-bounces+.*}} {exists {/usr/local/cpanel/3rdparty/mailman/lists/${lc:$1}/config.pck}}} {yes}{no}}
>>> = no
>>> warn: condition test failed
>>> processing “accept”
>>> check condition = ${if and {{match{$local_part}{(.*)-bounces+.*}} {exists {/usr/local/cpanel/3rdparty/mailman/lists/${lc:$1}/config.pck}}} {yes}{no}}
>>> = no
>>> accept: condition test failed
>>> processing “warn”
>>> check condition = ${if and {{match{$local_part}{(.*)-bounces+.*}} {exists {/usr/local/cpanel/3rdparty/mailman/lists/${lc:$1}_${lc:$domain}/config.pck}}} {yes}{no}}
>>> = no
>>> warn: condition test failed
>>> processing “accept”
>>> check condition = ${if and {{match{$local_part}{(.*)-bounces+.*}} {exists {/usr/local/cpanel/3rdparty/mailman/lists/${lc:$1}_${lc:$domain}/config.pck}}} {yes}{no}}
>>> = no
>>> accept: condition test failed
>>> processing “require”
>>> check verify = sender
>>> ken@bbozo-2.example.com in “nobody@lsearch;/etc/localdomains“? no (end of list)
>>> ken@bbozo-2.example.com in “cpanel@lsearch;/etc/localdomains“? no (end of list)
>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> routing ken@bbozo-2.example.com
>>> bbozo-2.example.com in “lsearch;/etc/localdomains”? no (end of list)
>>> bbozo-2.example.com in “! +local_domains”? yes (end of list)
>>> calling lookuphost router
>>> 216.87.129.155 in “0.0.0.0 : 127.0.0.0/8 : 64.94.110.0/24”? no (end of list)
>>> routed by lookuphost router
>>> ———– end verify ————
>>> require: condition test succeeded
>>> processing “accept”
>>> check domains = +local_domains
>>> cpdemo.domain.com in “lsearch;/etc/localdomains”? yes (matched “lsearch;/etc/localdomains”)
>>> cpdemo.domain.com in “+local_domains”? yes (matched “+local_domains”)
>>> check verify = recipient
>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> routing inspirem@cpdemo.domain.com
>>> cpdemo.domain.com in “! +local_domains”? no (matched “! +local_domains” – cached)
>>> cpdemo.domain.com in “! +local_domains”? no (matched “! +local_domains” – cached)
>>> cpdemo.domain.com in “! +local_domains”? no (matched “! +local_domains” – cached)
>>> cpdemo.domain.com in “lsearch;/etc/userdomains”? no (end of list)
>>> cpdemo.domain.com in “! lsearch;/etc/userdomains”? yes (end of list)
>>> cpdemo.domain.com in “lsearch;/etc/localdomains”? yes (matched “lsearch;/etc/localdomains”)
>>> calling virtual_aliases_nostar router
>>> virtual_aliases_nostar router declined for inspirem@cpdemo.domain.com
>>> cpdemo.domain.com in “lsearch;/etc/userdomains”? no (end of list)
>>> cpdemo.domain.com in “lsearch;/etc/userdomains”? no (end of list)
>>> cpdemo.domain.com in “lsearch;/etc/localdomains”? yes (matched “lsearch;/etc/localdomains”)
>>> cpdemo.domain.com in “lsearch;/etc/localdomains”? yes (matched “lsearch;/etc/localdomains”)
>>> calling virtual_aliases router
>>> virtual_aliases router declined for inspirem@cpdemo.domain.com
>>> calling system_aliases router
>>> system_aliases router declined for inspirem@cpdemo.domain.com
>>> calling local_aliases router
>>> local_aliases router declined for inspirem@cpdemo.domain.com
>>> cpdemo.domain.com in “! lsearch;/etc/userdomains”? yes (end of list)
>>> cpdemo.domain.com in “! lsearch;/etc/userdomains”? yes (end of list)
>>> calling localuser router
>>> routed by localuser router
>>> ———– end verify ————
>>> accept: condition test succeeded
250 Accepted
Data
354 Enter message, ending with “.” on a line by itself
From: Ben bozo <ken@bbozo-2.example.com>
Subject: Test
>>> host in ignore_fromline_hosts? no (option unset)

Test.
.
>>> using ACL “check_message”
>>> processing “require”
>>> check verify = header_sender
>>> verifying From: header address Ben bozo <ken@bbozo-2.example.com>
>>> ken@bbozo-2.example.com in “nobody@lsearch;/etc/localdomains“? no (end of list)
>>> ken@bbozo-2.example.com in “cpanel@lsearch;/etc/localdomains“? no (end of list)
>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> routing ken@bbozo-2.example.com
>>> bbozo-2.example.com in “lsearch;/etc/localdomains”? no (end of list)
>>> bbozo-2.example.com in “! +local_domains”? yes (end of list)
>>> calling lookuphost router
>>> 216.87.129.155 in “0.0.0.0 : 127.0.0.0/8 : 64.94.110.0/24”? no (end of list)
>>> routed by lookuphost router
>>> require: condition test succeeded
>>> processing “accept”
>>> accept: condition test succeeded
LOG: 1BbQZP-00005P-Gg <= ken@bbozo-2.example.com H=(bbozo-2.example.com) [216.87.129.155] P=smtp S=264
250 OK id=1BbQZP-00005P-Gg

**** SMTP testing: that is not a real message id!

SMTP/Exim debug mode
Description

To test verbose mail-delivery and debugging via the Exim SMTP server in @Mail, you can use the following command:

/usr/local/atmail/mailserver/bin/exim -d -v ‘user@localdomain.com’
^D ( control D )

This will step through each router in Exim, until the message is delivered or bounced.

This command can be useful for debugging, ( to test why a message cannot be delivered, database connection details, exim router reports, aliases and catch-all delivery )

For a more simple version use the command:

# /usr/local/atmail/mailserver/bin/exim -bt ‘username@localdomain.com’

username@localdomain.com
router = spamcheck_router, transport = spamcheck

This will emulate message-delivery and report which router can handle the message. The above message reports the message is accepted within @Mail.

For accounts that do not exist the following is returned:

username@localdomain.com is undeliverable:
Unrouteable address