FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 07-16-2012, 05:15 AM
Gregory Machin
 
Default Can't get Grub work on clone of machine

Hi.
I have cloned a RHEL 5.6 physical server over to a ESXi 5.0 Virtual Machine.

Using a live CD on the new Virtual Machine I created 3 partition /boot
(/dev/sda1), / (/dev/sda2) and swap (/dev/sda3), I then mounted the /
(sda2) partition and created the /boot directory and mount the boot
partition partition /dev/sda1 into /boot. I then used rsync to copy
the source machine over to the Virtual Machine.

I have not been able to get Grub to go further than :

GRUB Loading stage1.5.
GRUB Loading, please wait...
Error 2

I have tried :
the Super Grub http://www.supergrubdisk.org/wiki/Howto_Fix_Grub#GRUB_solution_.28Linux_shell.29

http://wiki.centos.org/TipsAndTricks/ReinstallGRUB

# chroot /mnt/sysimage
# grub-install /dev/sda
/dev/sda does not have any corresponding BIOS drive.

http://www.av8n.com/computer/htm/grub-reinstall.htm

# grub-install --root-directory=/mnt/sysimage /dev/sda
/dev/sda does not have any corresponding BIOS drive.


I have also tried a number using the grub console with a number of
different configurations all failed .

fdisk output :

Disk /dev/sda: 549.7 GB, 549755813888 bytes
255 heads, 63 sectors/track, 66837 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 131 1048576 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 131 60968 488669184 83 Linux
/dev/sda3 60968 66838 47152128 82 Linux swap / Solaris

fstab

[root@nzhmlwks113 vm]# cat fstab
/dev/sda2 / ext3 defaults 1 1
/dev/sda1 /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
/dev/sda3 swap swap defaults 0 0

grub.conf

# 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/VolGroup00/LogVol01
# initrd /initrd-version.img
#boot=/dev/sda1
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-308.11.1.el5)
root (hd0,1)
kernel /vmlinuz-2.6.18-308.11.1.el5 ro root=LABEL=/ ramdisk_size=8388608
initrd /initrd-2.6.18-308.11.1.el5.img
title Red Hat Enterprise Linux Server (2.6.18-308.1.1.el5)
kernel /vmlinuz-2.6.18-308.1.1.el5 ro root=LABEL=/ ramdisk_size=8388608
initrd /initrd-2.6.18-308.1.1.el5.img


I have also tried "ro root=/dev/sda2"

I have been look at then for 8 hour now and I'm clueless as to what I
have missed. I'm hoping a fresh pair of eyes can see the issue.
Thanks in advance.

GM
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-16-2012, 01:54 PM
Yves Bellefeuille
 
Default Can't get Grub work on clone of machine

On Monday 16 July 2012, Gregory Machin <gdm@linuxpro.co.za> wrote:

> # chroot /mnt/sysimage
> # grub-install /dev/sda
> /dev/sda does not have any corresponding BIOS drive.

Try this:

mount /dev/sda1 /mnt/sysimage/boot
mount -t none /dev /mnt/sysimage/dev -o bind
chroot /mnt/sysimage/boot
mount /proc
mount /sys

--
Yves Bellefeuille <yan@storm.ca>
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-16-2012, 02:21 PM
 
Default Can't get Grub work on clone of machine

Yves Bellefeuille wrote:
> On Monday 16 July 2012, Gregory Machin <gdm@linuxpro.co.za> wrote:
>
>> # chroot /mnt/sysimage
>> # grub-install /dev/sda
>> /dev/sda does not have any corresponding BIOS drive.
>
> Try this:
>
> mount /dev/sda1 /mnt/sysimage/boot
> mount -t none /dev /mnt/sysimage/dev -o bind
> chroot /mnt/sysimage/boot
> mount /proc
> mount /sys

What *is* mounted as /? If you've booted off, say, a USB key, or CD, that
might be seen as sda, and the real h/d is sdb.

mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-16-2012, 03:14 PM
Les Mikesell
 
Default Can't get Grub work on clone of machine

On Mon, Jul 16, 2012 at 12:15 AM, Gregory Machin <gdm@linuxpro.co.za> wrote:
> I have cloned a RHEL 5.6 physical server over to a ESXi 5.0 Virtual Machine.
>
> Using a live CD on the new Virtual Machine I created 3 partition /boot
> (/dev/sda1), / (/dev/sda2) and swap (/dev/sda3), I then mounted the /
> (sda2) partition and created the /boot directory and mount the boot
> partition partition /dev/sda1 into /boot. I then used rsync to copy
> the source machine over to the Virtual Machine.
>
> I have not been able to get Grub to go further than :
>
> GRUB Loading stage1.5.
> GRUB Loading, please wait...
> Error 2

First, if your source layout is typical, you might have been able to
use the free VMware Converter tool to clone to ESXi (or an image)
directly. Most of my linux boxes have a custom raid layout and don't
work so I don't have much linux experience with it, but it works great
with windows.

Another approach is to do a minimal install, upgrade the kernel to
match the source machine, then blow away everything but the /boot
partition and copy over from the source. This gets grub installed and
the right kernel modules in the ramdisk to match the new hardware -
and you can look at /etc/modprobe.conf to see what those modules are
if you don't know as much as anaconda does about hardware and modules.

But, starting from what you have, stage 1.5 is still in the MBR so it
seems odd that you have enough to boot at all but are missing that
part. I'd try booting in rescue mode, running grub and:
root (hd0,1)
setup (hd0)
quit


--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-17-2012, 12:11 AM
Gregory Machin
 
Default Can't get Grub work on clone of machine

On Tue, Jul 17, 2012 at 2:21 AM, <m.roth@5-cent.us> wrote:
> Yves Bellefeuille wrote:
>> On Monday 16 July 2012, Gregory Machin <gdm@linuxpro.co.za> wrote:
>>
>>> # chroot /mnt/sysimage
>>> # grub-install /dev/sda
>>> /dev/sda does not have any corresponding BIOS drive.
>>
>> Try this:
>>
>> mount /dev/sda1 /mnt/sysimage/boot
>> mount -t none /dev /mnt/sysimage/dev -o bind
>> chroot /mnt/sysimage/boot
>> mount /proc
>> mount /sys
>
> What *is* mounted as /? If you've booted off, say, a USB key, or CD, that
> might be seen as sda, and the real h/d is sdb.
>
> mark


Hi Mark.

Thanks for your input.
When I chroot to /mnt/sysimage the only hard drive listed is sda. Both
from "linux rescue"
and chroot mount reflects the same drive / partition mapping :
Rescue :
/dev/sda2 on /mnt/sysimage type ext3 (rw,data=ordered)
/dev/sda1 on /mnt/sysimage/boot type ext3 (rw,data=ordered)

Chroot :
/dev/sda2 on / type ext3 (rw,defaults)
/dev/sda1 on /boot type ext3 (rw,defaults)

Thanks

Greg
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-17-2012, 12:20 AM
Gregory Machin
 
Default Can't get Grub work on clone of machine

On Tue, Jul 17, 2012 at 3:14 AM, Les Mikesell <lesmikesell@gmail.com> wrote:
> On Mon, Jul 16, 2012 at 12:15 AM, Gregory Machin <gdm@linuxpro.co.za> wrote:
>> I have cloned a RHEL 5.6 physical server over to a ESXi 5.0 Virtual Machine.
>>
>> Using a live CD on the new Virtual Machine I created 3 partition /boot
>> (/dev/sda1), / (/dev/sda2) and swap (/dev/sda3), I then mounted the /
>> (sda2) partition and created the /boot directory and mount the boot
>> partition partition /dev/sda1 into /boot. I then used rsync to copy
>> the source machine over to the Virtual Machine.
>>
>> I have not been able to get Grub to go further than :
>>
>> GRUB Loading stage1.5.
>> GRUB Loading, please wait...
>> Error 2
>
> First, if your source layout is typical, you might have been able to
> use the free VMware Converter tool to clone to ESXi (or an image)
> directly. Most of my linux boxes have a custom raid layout and don't
> work so I don't have much linux experience with it, but it works great
> with windows.
>
> Another approach is to do a minimal install, upgrade the kernel to
> match the source machine, then blow away everything but the /boot
> partition and copy over from the source. This gets grub installed and
> the right kernel modules in the ramdisk to match the new hardware -
> and you can look at /etc/modprobe.conf to see what those modules are
> if you don't know as much as anaconda does about hardware and modules.
>
> But, starting from what you have, stage 1.5 is still in the MBR so it
> seems odd that you have enough to boot at all but are missing that
> part. I'd try booting in rescue mode, running grub and:
> root (hd0,1)
> setup (hd0)
> quit
>
>
> --
> Les Mikesell
> lesmikesell@gmail.com


Hi Les.

I started with VMware standalone converter 4.3 and the 5.0 and
couldn't get it to work, but it worked fine when converting another
machine to the same ESXi host.

Following these instructions :
mount /dev/sda1 /mnt/sysimage/boot
mount -t none /dev /mnt/sysimage/dev -o bind
chroot /mnt/sysimage/boot
mount /proc
mount /sys

then

root (hd0,1)
setup (hd0)
quit

I get the following:
root (hd0,1)
Filesystem type is ext2fs, partition type 0x83
setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 2: Bad file or directory
quit

I have checked that the stage1 file is in /boot/grub/ So Im confused.

Thanks
Greg
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-17-2012, 12:33 AM
Yves Bellefeuille
 
Default Can't get Grub work on clone of machine

On Monday 16 July 2012, Gregory Machin <gdm@linuxpro.co.za> wrote:

> I have not been able to get Grub to go further than :
>
> GRUB Loading stage1.5.
> GRUB Loading, please wait...
> Error 2

My previous advice was nonsense; sorry. :-(

This, however, should work:

(as root)

mount --bind /dev /mnt/sysimage/dev
mount --bind /proc /mnt/sysimage/proc
mount --bind /sys /mnt/sysimage/sys
chroot /mnt/sysimage
grub-install /dev/sda

--
Yves Bellefeuille <yan@storm.ca>
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-17-2012, 01:18 AM
Les Mikesell
 
Default Can't get Grub work on clone of machine

On Mon, Jul 16, 2012 at 7:20 PM, Gregory Machin <gdm@linuxpro.co.za> wrote:
>
> Following these instructions :
> mount /dev/sda1 /mnt/sysimage/boot
> mount -t none /dev /mnt/sysimage/dev -o bind
> chroot /mnt/sysimage/boot
> mount /proc
> mount /sys

Not sure you need any of that if your boot/rescue environment has grub.

> then
>
> root (hd0,1)
> setup (hd0)
> quit
>
> I get the following:
> root (hd0,1)
> Filesystem type is ext2fs, partition type 0x83
> setup (hd0)
> Checking if "/boot/grub/stage1" exists... no
> Checking if "/grub/stage1" exists... no
>
> Error 2: Bad file or directory
> quit
>
> I have checked that the stage1 file is in /boot/grub/ So Im confused.

Either your rsync copy of the boot filesystem was not complete, or
what grub thinks is (hd0,1) is not the filesystem where you put it.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-17-2012, 02:35 AM
Gregory Machin
 
Default Can't get Grub work on clone of machine

On Tue, Jul 17, 2012 at 1:18 PM, Les Mikesell <lesmikesell@gmail.com> wrote:
> On Mon, Jul 16, 2012 at 7:20 PM, Gregory Machin <gdm@linuxpro.co.za> wrote:
>>
>> Following these instructions :
>> mount /dev/sda1 /mnt/sysimage/boot
>> mount -t none /dev /mnt/sysimage/dev -o bind
>> chroot /mnt/sysimage/boot
>> mount /proc
>> mount /sys
>
> Not sure you need any of that if your boot/rescue environment has grub.
>
>> then
>>
>> root (hd0,1)
>> setup (hd0)
>> quit
>>
>> I get the following:
>> root (hd0,1)
>> Filesystem type is ext2fs, partition type 0x83
>> setup (hd0)
>> Checking if "/boot/grub/stage1" exists... no
>> Checking if "/grub/stage1" exists... no
>>
>> Error 2: Bad file or directory
>> quit
>>
>> I have checked that the stage1 file is in /boot/grub/ So Im confused.
>
> Either your rsync copy of the boot filesystem was not complete, or
> what grub thinks is (hd0,1) is not the filesystem where you put it.
>
> --
> Les Mikesell
> lesmikesell@gmail.com

Hi Les.

Just to clarify my understanding of grub's syntax for hard disk partitions
/dev/sda = hd0
/dev/sda1 = hd0,0
/dev/sda2 = hd0,1

Thanks
Greg
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-17-2012, 03:42 AM
Les Mikesell
 
Default Can't get Grub work on clone of machine

On Mon, Jul 16, 2012 at 9:35 PM, Gregory Machin <gdm@linuxpro.co.za> wrote:
>>
> Just to clarify my understanding of grub's syntax for hard disk partitions
> /dev/sda = hd0

Normally yes, but grub may have its own idea about what bios will
consider to be hd0. You can force it with:
device (hd0) /dev/sda

> /dev/sda1 = hd0,0
> /dev/sda2 = hd0,1

Yes, you probably really need
root (hd0,0) instead the (hd0,1) I said earlier.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 07:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org