boot centos 7 from grub 0.97

General support questions
Post Reply
Posts: 7
Joined: 2019/09/30 09:15:05

boot centos 7 from grub 0.97

Post by roberto26 » 2019/10/15 06:53:51

Hallo everybody.

I would like to have some help in booting a CentOS 7 partition using grub 0.97 (CentOS 5.2). My problem is the following:

1. I have some servers with CentOS 5.2
All this servers have the some disk partitions. In particular they have CentOS 5.2 installed in /dev/sda2 and an unused /dev/sda3 partition.
Disks and partitions are identical for all servers.

2. I have installed CentOS 7 in the /dev/sda3 partition of one of my servers and, instead of repeating the same installation on all other computers, I would like to copy the whole partition to a file, like:

dd if=/dev/sda3 of=c7.img

and then copy the file to the /dev/sda3 partition of all other servers:

dd if=c7.img of=/dev/sda3

(note: the file c7.img has been created in a NFS shared by all servers)

3. my problem is, now that I have a fresh installation of CentOS7 in /dev/sda3, how can I boot it starting from a system running CentOS 5.2 ?
I suppose I must work on the /boot/grub/grub.cfg of the CentOS 5.2 installation and reboot, but my very naive tries have ended up with an
unbootable system. A typical grub.cfg file is like the following:

timeout 5
default 0

# kernel0 (hd0,1)
title CentOS5.2_30Mar2010_(hd0,1)
root (hd0,1)
kernel /boot/vmlinuz-2.6.18-92.el5 ro root=/dev/sda2 ro root=/dev/sda2 rhgb quiet
initrd /boot/initrd-2.6.18-92.el5.img

and what I have tried to do is to add a new entry like:

title CentOS7
root (hd0,2)
kernel /boot/vmlinuz-3.10.0-1062.1.2.el7.x86_64 ro root=/dev/sda3 rhgb quiet
initrd /boot/initramfs-3.10.0-1062.1.2.el7.x86_64.img

changing default to "1", but it didn't work.

Assuming that my explanation makes sense and that I am not trying to do a substantially wrong procedure (which I am not sure), can you give me some hints?

Thank you in advance.

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

Re: boot centos 7 from grub 0.97

Post by TrevorH » 2019/10/15 08:30:07

I know you're not going to like this answer but it is asking for trouble to do what you're trying to do and it will probably break in new and unexpected ways in the future. CentOS 7 is set up and tested using grub2 not grub legacy and although it *may* have some capability to still use grub legacy, it's an unsupported combination and at any time in the future a `yum update kernel` could blow up and trash your system.

For your own future peace of mind, I would really recommend starting over on these systems and doing a proper install on them.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 6 - General Support”