LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Download GRUB2 for CentOS 6 (https://www.linuxquestions.org/questions/linux-server-73/download-grub2-for-centos-6-a-949220/)

vikas027 06-08-2012 08:24 AM

Download GRUB2 for CentOS 6
 
Dear All,

I am using a CentOS 6.2 64 Bit server (VMWare Virtual Machine).

While browsing some linux sites, I found that using GRUB2, we can have /boot on LVM/RAID. Just wanted to try my hands on it, but I am unable to find any GRUB2 RPM file.

I cannot update by GRUB too through any third party RPM repositories since I do not have an internet connection on the Linux box.

It would be great hep if anyone can provide links to download GRUB2 RPM suitable for CentOS 6.

acid_kewpie 06-08-2012 08:44 AM

Nothing around that I can see, I'd suggest just using the source.

rknichols 06-08-2012 09:08 AM

Be aware that the CentOS 6.2 kernel update procedures won't know how to update the GRUB-2 configuration files.

vikas027 06-08-2012 09:37 AM

Quote:

Originally Posted by acid_kewpie (Post 4698779)
Nothing around that I can see, I'd suggest just using the source.

Thanks Chris, I just used the source file grub-1.99.tar.gz from here.

I ran the following commands on runlevel 3, but still cannot see GRUB2 files like /etc/default/grub or /boot/grub/grub.cfg
Quote:

tar -xzvf grub-1.99.tar.gz
cd grub
./configure
make && make install
Do I need to make some more changes, forgive my ignorance.

acid_kewpie 06-08-2012 09:46 AM

I would expect to need to write those myself. You may find some defaults / examples in the source tree? Note that it's certainly not the source software's job to configure the grub.cfg file, it's the distro installer that would generally do that.

vikas027 06-08-2012 10:15 AM

Quote:

Originally Posted by acid_kewpie (Post 4698823)
I would expect to need to write those myself. You may find some defaults / examples in the source tree? Note that it's certainly not the source software's job to configure the grub.cfg file, it's the distro installer that would generally do that.

I got this file in the source tar ball

Code:

#
# Sample GRUB configuration file
#

# Boot automatically after 30 secs.
set timeout=30

# By default, boot the first entry.
set default=0

# Fallback to the second entry.
set fallback=1

# For booting GNU/Hurd
menuentry "GNU (aka GNU/Hurd)" {
        set root=(hd0,1)
        multiboot /boot/gnumach.gz root=device:hd0s1
        module /hurd/ext2fs.static ext2fs --readonly \
                        --multiboot-command-line='${kernel-command-line}' \
                        --host-priv-port='${host-port}' \
                        --device-master-port='${device-port}' \
                        --exec-server-task='${exec-task}' -T typed '${root}' \
                        '$(task-create)' '$(task-resume)'
        module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'
}

# For booting GNU/Linux
menuentry "GNU/Linux" {
        set root=(hd0,1)
        linux /vmlinuz root=/dev/sda1
        initrd /initrd.img
}

# For booting FreeBSD
menuentry "FreeBSD (or GNU/kFreeBSD), direct boot" {
        set root=(hd0,1,a)
        kfreebsd /boot/kernel/kernel
        kfreebsd_loadenv /boot/device.hints
        kfreebsd_module /boot/splash.bmp type=splash_image_data
        set kFreeBSD.vfs.root.mountfrom=ufs:ad0s1a
}
menuentry "FreeBSD (or GNU/kFreeBSD), via /boot/loader" {
        set root=(hd0,1,a)
        kfreebsd /boot/loader
}

# For booting NetBSD
menuentry "NetBSD" {
        set root=(hd0,1,a)
        knetbsd /netbsd
}

# For booting OpenBSD
menuentry "OpenBSD" {
        set root=(hd0,1,a)
        kopenbsd /bsd
}

# For booting Microsoft Windows
menuentry "Microsoft Windows" {
        set root=(hd0,1)
        chainloader +1
}

# For booting Memtest86+
menuentry "Memtest86+" {
        set root=(hd0,1)
        linux16 /memtest86+.bin
}

# Change the colors.
menuentry "Change the colors" {
        set menu_color_normal=light-green/brown
        set menu_color_highlight=red/blue
}

I think I need to create a file /boot/grub/grub.cfg similar to below one.
Code:

#
# Sample GRUB configuration file
#

# Boot automatically after 30 secs.
set timeout=30

# By default, boot the first entry.
set default=0

# Fallback to the second entry.
set fallback=1

# For booting GNU/Linux
menuentry "GNU/Linux" {
        set root=(hd0,1)
        linux /vmlinuz root=/dev/sda1
        initrd /initrd.img
}


I am not sure which all files needs to be removed/created from /boot/grub directory to boot from GRUB2. Any suggestions/links for this ? Thanks for all your help.

vikas027 06-08-2012 10:35 AM

Done :)
 
Hi Chris,

These commands helped me. I am able to boot from grub2. :D

Quote:

/usr/local/sbin/grub-mkconfig -o /boot/grub/grub.cfg
/usr/local/sbin/grub-install /dev/sda
mv -v /boot/grub/grub.conf /boot/ (Can be removed too)
Now, my next step is to try LVM/RAID on /boot. :)

rknichols 06-08-2012 01:37 PM

[deleted]


All times are GMT -5. The time now is 11:34 AM.