LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   grub not booting the correct device (https://www.linuxquestions.org/questions/linux-server-73/grub-not-booting-the-correct-device-4175479841/)

colorpurple21859 10-08-2013 05:18 AM

find out what kernel and and initrd with
Quote:

ls /boot
. may have to change the partition that grub is looking at if your kernels aren't located on your boot partition. ls will give you the root device names.
Code:

set root=(hd0,3)
Then
Code:

linux /boot/<name of kernel> root=/dev/cciss/c0d0p3
initrd /boot/<name of initrd>
boot

you can also use ls to find a /boot/grub/grub.cfg file if one exist. if it does then you can load it with this
Code:

configfile (hd0,3)/boot/grub/grub.cfg
then run update-grub to create a /boot/grub/grub.cfg file and/or copy the one from you root partition to your boot partition.

InventiousTech 10-08-2013 12:30 PM

It's like this machine is possessed, I went and re-installed the OS and selected "delete partitions and set up default scheme", and it seemed to work. However, when I rebooted , it gave this error:
Code:

"file '/boot/grub/i386-pc/normal.mod' not found"
Any idea what the issue might be now?

colorpurple21859 10-08-2013 01:08 PM

Looks like grub didn't install correctly. Try installing grub from install disk again.

InventiousTech 10-10-2013 07:51 AM

Ok, so I re-installed grub, but now it's just back to the grub prompt, no default OS. I can boot using the linux, initrd, and boot commands, which I suppose is OK, but since there's only one OS, it should boot CentOS automatically. I looked at the menu.lst file, and everything looks fine; kernel and initrd are specified correctly and the default=0 line is there. At this point it's not a huge issue, as I won't be turning it off very often, but I would like to be able to start right into the OS.

colorpurple21859 10-10-2013 09:16 AM

Quote:

I looked at the menu.lst file
Do you install grub legacy? If I'm not mistaken grub legacy won't do uefi gpt parititions. You need grub2, which what was installed before you reinstalled the Os.

InventiousTech 10-10-2013 09:26 AM

To be honest I'm not completely sure, it's never said grub2, it's always said just grub. However, it's my understanding that legacy used menu.lst, and grub2 uses grub.cfg. Both files are there, so if I had to guess I would say it's the new one with a linked menu.lst for compatibility. But you're the expert, so if I do have grub legacy installed, how would I update it to grub2?

EDIT: I installed grub like so:
Code:

mount /dev/cciss/c0d0p1 /mnt
grub-install --root-directory=/mnt /dev/cciss/c0d0

EDIT 2:

When I run
Code:

rpm -qa | grep grub
I get this:
Code:

grub-0.97-13.10.e15
So it looks like I've got grub legacy installed. How do I update?

colorpurple21859 10-10-2013 10:22 PM

If your using linux at the grub prompt for your kernel then you are using grub2. Look in your /boot and see if you have a efi directory. If so go down the /boot/efi/??/?? until you find grubx64.efi. Copy /boot/grub/grub.cfg to this directory and see if this fixes the grub menu problem.

InventiousTech 10-11-2013 08:04 AM

I think it's grub legacy, it doesn't seem to recognize normal linux commands. The only ones I've used are these:
Code:

ls /
linux /vmlinuz-2.6.18-348.el5PAE
initrd /initrd-2.6.18-348.el5PAE.img
boot

Also, there's no EFI directory in /boot.

colorpurple21859 10-11-2013 10:40 AM

Quote:

linux /vmlinuz-2.6.18-348.el5PAE
If this is working then your using grub2. kernel /vmlinuz-2.6.18-348.el5PAE is what you would be using if it was grub legacy.

colorpurple21859 10-11-2013 10:44 AM

Did you try and copy the grub.cfg file to the /boot/efi directory? If it doesn't exist mount your first partition, it shoud be a fat32 partition and then see if you can find the directory with grubx64.efi in it. That is where you want to copy your grub.cfg to.

InventiousTech 10-12-2013 08:20 AM

Well, I mounted /dev/cciss/c0d0p1 to /mnt, but still no dice. There's no efi directory, and there's no grubx64.efi anywhere. I'm labeling this thread as solved, because at this point it's a minor annoyance rather than a real issue. Anyway, thanks for all the help, if you have any more ideas about the grub issue please post.

colorpurple21859 10-12-2013 12:40 PM

I thought we had done this, but anyways download and run bootinfoscript and post the results.
http://bootinfoscript.sourceforge.net/

InventiousTech 10-12-2013 05:53 PM

Ok, so here are the results. To my unpracticed eye there seems to be less data here than there should be.
Code:

                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================


VolGroup00-LogVol00': __________________________________________________________

    File system:     
    Boot sector type:  Unknown
    Boot sector info:
    Mounting failed:  mount: unknown filesystem type ''

VolGroup00-LogVol01': __________________________________________________________

    File system:     
    Boot sector type:  Unknown
    Boot sector info:
    Mounting failed:  mount: unknown filesystem type ''
mount: unknown filesystem type ''

============================ Drive/Partition Info: =============================

no valid partition table found
"blkid" output: ________________________________________________________________

Device          UUID                                  TYPE      LABEL

/dev/cciss/c0d0p1 bf25444d-1ebb-4eca-b2d6-d5f63664b0ae  ext3      /boot
/dev/mapper/VolGroup00-LogVol00 199a9094-0c96-42fe-821b-da10d0be8b7d  ext3     
/dev/mapper/VolGroup00-LogVol01                                        swap     
/dev/VolGroup00/LogVol00 199a9094-0c96-42fe-821b-da10d0be8b7d  ext3     
/dev/VolGroup00/LogVol01                                        swap     

========================= "ls -R /dev/mapper/" output: =========================

/dev/mapper:
control
VolGroup00-LogVol00
VolGroup00-LogVol01

================================ Mount points: =================================

Device          Mount_Point              Type      Options

/dev/cciss/c0d0p1 /boot                    ext3      (rw)
/dev/mapper/VolGroup00-LogVol00 /                        ext3      (rw)


======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on VolGroup00-LogVol00'


Unknown BootLoader on VolGroup00-LogVol01'



========= Devices which don't seem to have a corresponding hard drive: =========

hda no block devices found

=============================== StdErr Messages: ===============================

  One or more specified logical volume(s) not found.
  One or more specified logical volume(s) not found.
  One or more specified logical volume(s) not found.
hexdump: /dev/mapper/VolGroup00-LogVol00': No such file or directory
hexdump: stdin: Bad file descriptor.
hexdump: /dev/mapper/VolGroup00-LogVol00': No such file or directory
hexdump: /dev/mapper/VolGroup00-LogVol00': Bad file descriptor
  One or more specified logical volume(s) not found.
  One or more specified logical volume(s) not found.
  One or more specified logical volume(s) not found.
hexdump: /dev/mapper/VolGroup00-LogVol01': No such file or directory
hexdump: stdin: Bad file descriptor.
hexdump: /dev/mapper/VolGroup00-LogVol01': No such file or directory
hexdump: /dev/mapper/VolGroup00-LogVol01': Bad file descriptor
mdadm: No arrays found in config file


colorpurple21859 10-13-2013 07:51 AM

You don't have any more info because of mounting problems. However from what I can tell if you have a /boot/grub files also located here
Quote:

/dev/mapper/VolGroup00-LogVol00 / ext3
Then maybe copy the grub.cfg file from your
Quote:

/dev/cciss/c0d0p1 /boot
will fix the problem. Using
Code:

set
at the grub command prompt should tell you what hard drive/partition that grub is looking for grub files and therefore grub.cfg. Look for the line that starts with prefix. Another thought is does a /boot/grub/grub.cfg even exist, if not you may need to run update-grub or create one by hand.

InventiousTech 10-13-2013 08:18 AM

Ok, so I mounted /dev/mapper/VolGroup00-LogVol00 and there is a /boot directory, but the boot folder is empty. Also, there is no grub.cfg in /boot/grub of c0d0p1, but there is a grub.conf, which might fulfill the same function.
Code:

set
at the grub prompt says that it's booting from /dev/cciss/c0d0p1.


All times are GMT -5. The time now is 10:24 PM.