LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-16-2013, 08:52 AM   #1
centguy
Member
 
Registered: Feb 2008
Posts: 627
Blog Entries: 1

Rep: Reputation: 48
how to install grub2 on the linux mint partition


I boot up linux mint from CentOS 6.1 bootloader with a line:

Quote:
title [2] Direct Boot Linux Mint @ sda3
root (hd0,5)
kernel /boot/vmlinuz-3.5.0-17-generic root=UUID=c960c8ab-b8c9-4359-bce8-76be204d8d32 ro quiet splash
initrd /boot/initrd.img-3.5.0-17-generic
Now, on Linux Mint, I would like to issue commands
so that the linux
mint bootloader (grub2) can be installed on /dev/sda3 = (hd0,2)

I would like then to boot Linux Mint by adding a chain load line
in the CentOS 6.1 grub.conf.

Question: What command should I issue on Linux Mint ?

Usually on normal older grub, I simply type grub,
then I type
root (hd0,2)

setup (hd0,2)

and things are done.

But what are equivalent commands on grub 2 ?

Thanks. I hope the instructions are easy to follow.
 
Old 07-16-2013, 08:55 AM   #2
centguy
Member
 
Registered: Feb 2008
Posts: 627

Original Poster
Blog Entries: 1

Rep: Reputation: 48
I just did

Quote:

mint14-dell grub # sudo grub-install /dev/sda3
/usr/sbin/grub-bios-setup: warning: File system `ext2' doesn't support embedding.
/usr/sbin/grub-bios-setup: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-bios-setup: error: will not proceed with blocklists.
 
Old 07-16-2013, 09:01 AM   #3
centguy
Member
 
Registered: Feb 2008
Posts: 627

Original Poster
Blog Entries: 1

Rep: Reputation: 48
strange thing is that from /dev/sda,
I see an entry:

/dev/sda3 ext4 / 40G-LM14 ...

So /dev/sda3 is indeed ext4 and not ext2.
 
Old 07-16-2013, 12:27 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
ext[34] report as ext2 in various situations - not a problem (as such - merely confusing).

grub-install accepts a "--force" keyword. Use it with care.
 
Old 07-16-2013, 01:25 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
In your initial post, you indicate that you boot Mint from CentOS. If it boots, why change it? The title line in the entry you posted shows Mint on sda3 yet your kernel line points to: root (hd0,5) which is sda6?? Why do you think Grub files are not installed on Mint? Did you select not to install a bootloader? Usually the default is the mbr of the primary disk but that can obviously be changed during the installation of the system. You could try the suggestions at the link below:


http://members.iinet.net/~herman546/...to_a_Partition

Or, create a mount point then mount the partition and run the command below from the Mint CD as CentOS doesn't have Grub2, obviously, that is if the Mint partition actually is sda3:

Quote:
sudo grub-install --root-directory=/mnt/sda3 /dev/sda3
If that doesn't work, add the --force option to the command.
 
Old 07-16-2013, 09:36 PM   #6
centguy
Member
 
Registered: Feb 2008
Posts: 627

Original Poster
Blog Entries: 1

Rep: Reputation: 48
Thanks !

yancek: Good eye and good questions.

1. Why change it ? I have CentOS 6.1 installed before newer OS Linux Mint 14. So I do not want to disturb
the usual way of booting.

2. I have installed the bootloader to Linux Mint 14 /dev/sda3 (not MBR) during installation but chainload from
CentOS won't boot Linux Mint.
I still remember I almost used up all my knowledge to get it boot directly using vmlinuz and initrd.img.


3. sda3 is my linux Mint partition. However, I cannot put (hd0,2) in CentOS grub.conf since Linux Mint just won't boot
directly. I have hit this problem and solved it in the Fedora forum, but the easiest solution is to copy out vmlinuz
and initrd.img files to CentOS /boot directory. A bit troublesome but it always work. (finger crossed..)


I am going to try the --force and see if it works. But then note 2 seems to suggest it might not
work. Anyway, I am going to give a try and report back.
 
Old 07-16-2013, 09:41 PM   #7
centguy
Member
 
Registered: Feb 2008
Posts: 627

Original Poster
Blog Entries: 1

Rep: Reputation: 48
anyway, sometimes I just tar the working linux mint from CentOS in one machine and clone on a different machine. It is fun and practical (don't have to install all over again, need to fix graphic problem though initially) if you ask me why.
 
Old 07-16-2013, 10:46 PM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
The methods I've seen which always work for me to boot a Grub2 system from Grub Legacy:

Quote:
title Ubuntu-12.04
root (hd0,2)
kernel /boot/grub/core.img
#savedefault
##boot

title Linux Mint
root (hd0,2)
chainloader +1
Some systems I have used require the savedefault and boot options but most don't. I'm not sure from your last post if you got it working??
 
Old 07-16-2013, 11:30 PM   #9
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,101
Blog Entries: 21

Rep: Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474
My test box. A old IBM M41 with 2 internal IDE hard drives Mutibootiung gru2 distros on grub legacy and even puppy frugal.

Code:
timeout 10
color cyan/blue white/blue
foreground ffffff
background 0639a1

gfxmenu /boot/grub/message


title AntiX  at sda1, kernel 3.3.5-antix.1-486-smp
kernel /boot/vmlinuz-3.3.5-antix.1-486-smp root=/dev/sda1 nomce quiet nosplash nouveau.modeset=0 vga=791
initrd /boot/initrd.img-3.3.5-antix.1-486-smp
boot

title Semplice GNU/Linux, with Linux 3.2.0-3-486
rootnoverify (hd1,1)
chainloader +1

title Vector STD Gold 7 at /dev/sda2
rootnoverify (hd0,1)
chainloader +1

title Puppy Linux 529 frugal in sdb1 dir macpup529frugal
rootnoverify (hd1,0)
kernel /macpup529frugal/vmlinuz pmedia=atahd psubdir=macpup529frugal
initrd /macpup529frugal/initrd.gz

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=009157e5-dcf1-465a-ae33-6fb9cf5c3b38 ro
# kopt_2_6=root=UUID=009157e5-dcf1-465a-ae33-6fb9cf5c3b38 ro nosplash quiet

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(init-3) 3

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title      Debian GNU/Linux, kernel 3.5.2-antix.1-486-smp
root      (hd0,0)
kernel      /boot/vmlinuz-3.5.2-antix.1-486-smp root=UUID=009157e5-dcf1-465a-ae33-6fb9cf5c3b38 ro
initrd      /boot/initrd.img-3.5.2-antix.1-486-smp

title      Debian GNU/Linux, kernel 3.5.2-antix.1-486-smp (init-3)
root      (hd0,0)
kernel      /boot/vmlinuz-3.5.2-antix.1-486-smp root=UUID=009157e5-dcf1-465a-ae33-6fb9cf5c3b38 ro 3
initrd      /boot/initrd.img-3.5.2-antix.1-486-smp

title      Debian GNU/Linux, kernel 3.3.5-antix.1-486-smp
root      (hd0,0)
kernel      /boot/vmlinuz-3.3.5-antix.1-486-smp root=UUID=009157e5-dcf1-465a-ae33-6fb9cf5c3b38 ro
initrd      /boot/initrd.img-3.3.5-antix.1-486-smp

title      Debian GNU/Linux, kernel 3.3.5-antix.1-486-smp (init-3)
root      (hd0,0)
kernel      /boot/vmlinuz-3.3.5-antix.1-486-smp root=UUID=009157e5-dcf1-465a-ae33-6fb9cf5c3b38 ro 3
initrd      /boot/initrd.img-3.3.5-antix.1-486-smp

title      Debian GNU/Linux, kernel memtest86+
root      (hd0,0)
kernel      /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST
AntiX is on 1st partition of 1st hard drive. It is the Main bootloader for everyone else. Uses Grub legacy.
Vector is on 2nd partition of 1st hard drive. Grub was installed to root "/". Vector uses grub 2.
MacPup Puppy 529 is installed on 2nd hard drive. Partition 1. Puppys bootloader is installed to root "/"
Semplice is installed on 2nd hard drive. Partition 2. Grub is installed to root "/".Uses grub 2 also.

Hope that clears things up for you . I use blkid and fdisk -l for finding identifiers and using them where needed in grub legacy.
Pup frugal install gives/generates a .txt file you can copy inside text to your bootloader to boot puppy in what ever
bootloader you are using. Because. Both grub legacy and grub 2 do not pick up on Puppy Linux frugal installs. So it has to ne done by hand. At least in my experience.

Anyways, that is how I boot 2 internal ide drives with multiboot on a old POS IBM M41 that still chugs along just fine. Floppy drive and all. So if I was in your shoes. I would reinstall mint grub boot loader and tell it I want on root instead of mbr or whatever else and then chainload it after finding out in centos where (hdx,x) was for Mint install.

Last edited by rokytnji; 07-16-2013 at 11:35 PM.
 
Old 07-16-2013, 11:54 PM   #10
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
I tend to have a second or third install use it's own boot partition
A bit more work , but it also is a safety back up if something really goes bad

if you update one of the os's ( in my case SL6.4 ) i have to rebuild grub2 in OpenSUSE 12.3 for the change to take effect in the suse grub2 menu
( it is the system default )

your Mint install should auto detect "other/alien " OS's and set up grub2 to chainload them
 
Old 07-17-2013, 10:18 AM   #11
centguy
Member
 
Registered: Feb 2008
Posts: 627

Original Poster
Blog Entries: 1

Rep: Reputation: 48
Now on my Dell computer,

Quote:

mint14-dell ~ # sudo grub-install --force /dev/sda3
/usr/sbin/grub-bios-setup: warning: File system `ext2' doesn't support embedding.
/usr/sbin/grub-bios-setup: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.
I am able to chainload from CentOS !

But my since this system is copied from elsewhere, the /boot/grub/grub.cfg is completely not working, how do I fix it ?

I believe this is copied from the first installation on DELL
on /dev/sda7 but I have to move it to /dev/sda3 since the disk
space allocated to /dev/sda7 is too small. It could also
possibly be
that I got this from the /dev/sda7 of another Lenovo machine.
But anyhow, I need to make progress in this grub2 direction.

Why is grub.cfg so complicated than grub.conf of grub legacy ?

Any chance to fix it easily or I have to go through line by line
to change ? How do I create few basic lines to just boot using
grub2 ?

Quote:

cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"

if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}

if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 f92f5430-47e7-43af-b85c-21b25cd625f4
else
search --no-floppy --fs-uuid --set=root f92f5430-47e7-43af-b85c-21b25cd625f4
fi
font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_SG
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="$1"
if [ "$1" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Linux Mint 14 Cinnamon 64-bit, 3.5.0-17-generic (/dev/sda7)' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 f92f5430-47e7-43af-b85c-21b25cd625f4
else
search --no-floppy --fs-uuid --set=root f92f5430-47e7-43af-b85c-21b25cd625f4
fi
linux /boot/vmlinuz-3.5.0-17-generic root=UUID=f92f5430-47e7-43af-b85c-21b25cd625f4 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.5.0-17-generic
}
menuentry 'Linux Mint 14 Cinnamon 64-bit, 3.5.0-17-generic (/dev/sda7) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 f92f5430-47e7-43af-b85c-21b25cd625f4
else
search --no-floppy --fs-uuid --set=root f92f5430-47e7-43af-b85c-21b25cd625f4
fi
echo 'Loading Linux 3.5.0-17-generic ...'
linux /boot/vmlinuz-3.5.0-17-generic root=UUID=f92f5430-47e7-43af-b85c-21b25cd625f4 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.5.0-17-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 f92f5430-47e7-43af-b85c-21b25cd625f4
else
search --no-floppy --fs-uuid --set=root f92f5430-47e7-43af-b85c-21b25cd625f4
fi
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 f92f5430-47e7-43af-b85c-21b25cd625f4
else
search --no-floppy --fs-uuid --set=root f92f5430-47e7-43af-b85c-21b25cd625f4
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Microsoft Windows XP Professional (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-6048E76348E73686' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 6048E76348E73686
else
search --no-floppy --fs-uuid --set=root 6048E76348E73686
fi
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry 'CentOS release 5.2 (Final)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-7c96a27d-5f53-49ce-960d-132185ede0d1' {
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 7c96a27d-5f53-49ce-960d-132185ede0d1
else
search --no-floppy --fs-uuid --set=root 7c96a27d-5f53-49ce-960d-132185ede0d1
fi
linux /boot/vmlinuz-2.6.18-92.el5 ro root=LABEL=new-centos52 rhgb quiet irqpoll
initrd /boot/initrd-2.6.18-92.el5.img
}
submenu 'Advanced options for CentOS release 5.2 (Final)' $menuentry_id_option 'osprober-gnulinux-advanced-7c96a27d-5f53-49ce-960d-132185ede0d1' {
menuentry '[1] CentOS-52-64-dell (2.6.18-92.el5) root@sda3 (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-2.6.18-92.el5--7c96a27d-5f53-49ce-960d-132185ede0d1' {
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 7c96a27d-5f53-49ce-960d-132185ede0d1
else
search --no-floppy --fs-uuid --set=root 7c96a27d-5f53-49ce-960d-132185ede0d1
fi
linux /boot/vmlinuz-2.6.18-92.el5 ro root=LABEL=new-centos52 rhgb quiet irqpoll
initrd /boot/initrd-2.6.18-92.el5.img
}
menuentry '[3] DIRECT Clone 2nd-centos61-dell on DELL CentOS 6.1 (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-2.6.32-131.0.15.el6.x86_64--7c96a27d-5f53-49ce-960d-132185ede0d1' {
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 7c96a27d-5f53-49ce-960d-132185ede0d1
else
search --no-floppy --fs-uuid --set=root 7c96a27d-5f53-49ce-960d-132185ede0d1
fi
linux /boot/vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=LABEL=18G-C61 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet radeon.modeset=0 nouveau.modeset=0 rdblacklist=nouveau irqpoll
initrd /boot/initramfs-2.6.32-131.0.15.el6.x86_64.img
}
}

menuentry 'CentOS release 6.1 (Final)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-9b987cdb-2b56-42ee-a038-1ff8fb0ab867' {
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 9b987cdb-2b56-42ee-a038-1ff8fb0ab867
else
search --no-floppy --fs-uuid --set=root 9b987cdb-2b56-42ee-a038-1ff8fb0ab867
fi
linux /boot/vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=UUID=19d7aac9-c759-45ae-b357-eb59132c6ab0 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /boot/initramfs-2.6.32-131.0.15.el6.x86_64.img
}
submenu 'Advanced options for CentOS release 6.1 (Final)' $menuentry_id_option 'osprober-gnulinux-advanced-9b987cdb-2b56-42ee-a038-1ff8fb0ab867' {
menuentry '2nd-centos61-acer (sda5) CentOS 6.1 (2.6.32-131.0.15.el6.x86_64) (on /dev/sda6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-2.6.32-131.0.15.el6.x86_64--9b987cdb-2b56-42ee-a038-1ff8fb0ab867' {
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 9b987cdb-2b56-42ee-a038-1ff8fb0ab867
else
search --no-floppy --fs-uuid --set=root 9b987cdb-2b56-42ee-a038-1ff8fb0ab867
fi
linux /boot/vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=UUID=19d7aac9-c759-45ae-b357-eb59132c6ab0 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /boot/initramfs-2.6.32-131.0.15.el6.x86_64.img
}
}

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
 
Old 07-17-2013, 11:44 AM   #12
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Quote:
I am able to chainload from CentOS !

But my since this system is copied from elsewhere, the /boot/grub/grub.cfg is completely not working, how do I fix it ?

I believe this is copied from the first installation on DELL
on /dev/sda7 but I have to move it to /dev/sda3 since the disk
space allocated to /dev/sda7 is too small. It could also
possibly be
that I got this from the /dev/sda7 of another Lenovo machine.
What are you trying to do. You indicate you can boot Mint from CentOS, do you now want to configure the Mint Grub2 to boot CentOS?
You have 9 entries in your grub.cfg file. Have you scrolled down on the boot menu and tried the different options for CentOS. I notice the first two entries for CentOS are for 5.1 while the next three are for 6.1. Note that on the first two entries, the uuid begins with: 7c96a27d..., while the next three have a uuid beginning with: 9b987cdb... Have you tried them all? I would suggest running the blkid command to see what the correct uuid entries are. The last two entries for CentOS 6.1 show it on sda6 (hdo, msdos 6) while the first two entries for 5.2 show sda3 and the first 6.1 entry also shows sda3. Where is it? Or where are they.

Grub Legacy counts hard drives as well as partitions from zero, Grub2 counts hard drives from zero and partitions from one.

Last edited by yancek; 07-17-2013 at 11:45 AM.
 
Old 07-17-2013, 01:35 PM   #13
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Rep: Reputation: 85
This is all that's needed for /boot/grub/grub.cfg, if you have a simple setup. Change it to your needs.
Code:
# Timeout for menu
set timeout=5

# Set default boot entry as Entry 0
set default=0

# (0) Linux
menuentry "Linux" {
  set root=(hd0,1)
  linux /boot/vmlinuz root=/dev/sda1 ro
  initrd /boot/initrd
}
 
Old 07-17-2013, 11:58 PM   #14
centguy
Member
 
Registered: Feb 2008
Posts: 627

Original Poster
Blog Entries: 1

Rep: Reputation: 48
yancek: I guess my short answer is that I try to learn grub2. Thanks for your comments.

Lennie: Thanks. This is what I have been looking for. Do I edit /boot/grub/grub.cfg directly ?

Quote:

cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
How do I create one entry in /etc/grub.d and then ask the system to generate /boot/grub/grub.cfg ?

Of course I will still try out your suggestion ! Thanks.
 
Old 07-18-2013, 04:54 AM   #15
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Rep: Reputation: 85
If you change /boot/grub/grub.cfg directly, and then run os-prober (as will be done when you get an update to the kernel in Mint), it will be overwritten. On my multiboot systems I prefer to have a separate partition for grub, and manually add entries for all distros. (I don't even have grub (or any bootloader) installed in most distros.)

Here you can read about grub2, and how to add a script in /etc/grub.d.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Mint 13 install doesn't detect partition table. Zurukea Linux - Newbie 22 08-14-2013 03:40 PM
grub2 can't see my win 7 partition and yast2 bootloader can't reinstall grub2 jjrojaspy SUSE / openSUSE 5 07-07-2013 10:38 PM
install grub2 to root partition skippyV Debian 2 03-01-2013 05:07 PM
[SOLVED] Linux mint, some tweaking (hdparm, GRUB2 and so on) Ormu Linux - General 2 12-19-2011 01:16 PM
Install grub2 in partition is possible? miros84 Linux - Software 1 11-14-2010 01:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration