Grub doesn't automatically boot OS after install, hangs at grub prompt

General support questions including new installations
macNCheeseB
Posts: 40
Joined: 2011/03/21 20:14:27

Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by macNCheeseB » 2011/03/21 21:20:52

I have used CentOS for a while and have never run into this issue. I searched all over and didn't see a similar issue anywhere, so here goes ...

I did an install of CentOS as a server (no GUI) with only the base. Partition is /boot ext3, size of 100MB. The rest of the drive is partitioned as / with ext3. This is being done on a CompactFlash card of 32GB in size. The BIOS sees it as an IDE drive.

When the install completes and the system reboots, the grub stops at the grub> prompt. There is no menu for OS options. If I do the following commands:
[code]
grub>root (hd0,0)
grub>kernel /vmlinuz-2.6.18-194.el5 root=LABEL=/
grub>initrd /initrd-2.6.18-194.el5.img
grub>boot
[/code]

The system boots up with no issue. Everything appears to be in normal working condition. Executing hdparm -vi gives me this:

[code]
/dev/hdd:
multcount = 0 (off)
IO_support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 0 (off)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 62004/255/63, sectors = 62500864, start = 0

Model=SanDisk SDCFX-032G, FwRev=HDX 6.02, SerialNo=DLZ120710173909
Config={ HardSect NotMFM Removeable DTR>10Mbs nonMagnetic }
RawCHS=62004/16/63, TrkSize=0, SectSize=576, ECCbytes=4
BuffType=DualPort, BuffSize=1kB, MaxMultSect=1, MultSect=off
CurCHS=62004/16/63, CurSects=62500032, LBA=yes, LBAsects=62500864
IORDY=no, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2
AdvancedPM=yes: disabled (255) WriteCache=enabled
Drive conforms to: Unspecified: ATA/ATAPI-4

* signifies the current active mode
[/code]

I have tried installing with --force-lba, with and without LVM and many other ways. There was a cryptic message on a forum that I may need to pass HD geometry into grub, but I can't find any clear way to do that.

Has anybody seen this type of issue? Does anybody have an idea why it won't boot automatically but if I manually enter the commands it starts just fine?

Thanks in advance for any help.

B

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by pschaff » 2011/03/21 22:01:05

Welcome to the CentOS fora. Reading [url=https://www.centos.org/modules/newbb/viewforum.php?forum=47]FAQ & Readme First[/url] is recommended for new users.
[quote]
macNCheeseB wrote:
Does anybody have an idea why it won't boot automatically but if I manually enter the commands it starts just fine?
[/quote]
Because GRUB is not finding /boot/grub/grub.conf. Please show us that file along with /etc/fstab, and[code]fdisk -l
blkid | sort[/code]

User avatar
TrevorH
Forum Moderator
Posts: 29171
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by TrevorH » 2011/03/21 22:09:45

What's the content of /boot/grub/device.map?

macNCheeseB
Posts: 40
Joined: 2011/03/21 20:14:27

Re: Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by macNCheeseB » 2011/03/22 12:28:23

Thanks for the welcome.

The requested output is shown below:

grub.conf:
[code]
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hdd2
# initrd /initrd-version.img
#boot=/dev/hdd
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/
initrd /initrd-2.6.18-194.el5.img
title Other
rootnoverify (hd1,0)
chainloader +1
[/code]

fstab output:
[code]
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
[/code]


here is the device map:
[code]
# this device map was generated by anaconda
(hd0) /dev/hdd
(hd1) /dev/sda
[/code]

The command fdisk -l blkid did not return any output. So, here is the output of fdisk -l (if it is of any use):
[code]
Disk /dev/hdd: 32.0 GB, 32000442368 bytes
255 heads, 63 sectors/track, 3890 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 * 1 13 104391 83 Linux
/dev/hdd2 14 3890 31142002+ 83 Linux

Disk /dev/sda: 1056 MB, 1056178176 bytes
2 heads, 63 sectors/track, 16371 cylinders
Units = cylinders of 126 * 512 = 64512 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 16372 1031392+ 6 FAT16
[/code]


I originally tried to install from the install CD, but got the symptom in this thread. I then tried again using a kickstart script that was pulled from a working CentOS 5.5 install, loaded on a flash drive. The install disk was pointed to that file so the install could execute without supervision. That resulted in the same symptom. The second drive seen in the files above are the flash drive that has the kickstart script on it.

Thanks for your help.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by pschaff » 2011/03/22 13:12:58

[quote]
macNCheeseB wrote:
...
The command fdisk -l blkid did not return any output. So, here is the output of fdisk -l (if it is of any use): ...[/quote]
Yes it is, and that is what was requested. That was supposed to be two separate command lines.

It is quite unusual to have /dev/hdd as the first bootable disk. That device designation means to me that it is the slave disk on the secondary IDE controller. PATA disks are generally better configured as the master, and preferably the only disk on the IDE interface, possibly with a CD device as the slave. The bootable disk would usually be the primary master, rather than the secondary slave, but things may be somewhat confused by the presence of both SATA and PATA drives. If there is a /dev/sda it would usually be the boot device.

All this may be an excuse for why GRUB is confused, but not necessarily a clear path to a clean solution. If it were my system I would do the following:
1. Make the PATA disk the master rather than the slave. If there is another IDE interface then make it the master on that cable.
2. Change the BIOS boot order to make the SATA disk the first boot device.
3. Boot in rescue mode, chroot, and swap all instances of hd0 and hd1 in /boot/grub/grub.conf to hd1 and hd0.
4. [url=http://wiki.centos.org/TipsAndTricks/ReinstallGRUB]Re-install GRUB[/url] to /dev/sda.
5. Reboot. If there is a problem then try this at the GRUB prompt:[code]find /grub/stage1[/code]

P.S. Just occurred to me that it is possible /dev/sda could be removable media rather than SATA. If that is the case please let us know before proceeding. Yet another wrinkle would be if /dev/hdd is actually SATA but the controller is configured in the legacy PATA mode.

macNCheeseB
Posts: 40
Joined: 2011/03/21 20:14:27

Re: Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by macNCheeseB » 2011/03/22 13:36:46

[quote]P.S. Just occurred to me that it is possible /dev/sda could be removable media rather than SATA. If that is the case please let us know before proceeding. Yet another wrinkle would be if /dev/hdd is actually SATA but the controller is configured in the legacy PATA mode.[/quote]

Yes, that is the case. sda is the USB flash drive that loaded the kickstart script used for this particular install. On a previous install I used an attached CD drive, so the sda didn't show up in any of the config files for that install. As for the hdd being a SATA, I don't believe that is the case. It is a CompactFlash card, capable of UDMA 5 transfer (per the specs). But I believe the interface is IDE. If I set the BIOS as either SATA/PATA or PATA-only it shows up the same.

As for making the hdd the master, I can't do that in this setup. This install is being done to a CF card on a board that has a CF slot as part of the motherboard. The options in the BIOS allow me to use that spot as an IDE device either as primary slave or secondary slave. I can't seem to find any way to change it to be the master on either channel. In any case, it is the only drive in the system (or will be when I remove the flash drive).

B

macNCheeseB
Posts: 40
Joined: 2011/03/21 20:14:27

Re: Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by macNCheeseB » 2011/03/22 13:42:53

And here is the output of blkid | sort

[code]
/dev/hdd1: LABEL="/boot" UUID="928951e7-e97d-4f5e-8e83-1e5062cc2ed6" TYPE="ext3"
/dev/hdd2: LABEL="/" UUID="195ba5f8-daeb-4e6a-a1ae-3ec3b9806d80" TYPE="ext3"
/dev/sda1: SEC_TYPE="msdos" UUID="0007-5985" TYPE="vfat"
[/code]

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by pschaff » 2011/03/22 13:56:52

[quote]
macNCheeseB wrote:
... In any case, it is the only drive in the system (or will be when I remove the flash drive).
[/quote]
OK - forgot all that nonsense from me. Sorry I neglected to refresh my memory by going back to the first post.

Does it boot without the external drive attached?

macNCheeseB
Posts: 40
Joined: 2011/03/21 20:14:27

Re: Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by macNCheeseB » 2011/03/22 14:03:44

[quote]
Does it boot without the external drive attached?
[/quote]

No, I removed the flash drive and rebooted and it stops at the grub> prompt.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Grub doesn't automatically boot OS after install, hangs at grub prompt

Post by pschaff » 2011/03/22 14:52:55

What does [code]find /grub/stage1[/code]show?

Post Reply

Return to “CentOS 5 - General Support”