LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-09-2010, 02:09 PM   #1
newbuyer17
Member
 
Registered: Sep 2006
Posts: 38

Rep: Reputation: 15
mdraid (mdadm) and grub2 on LinuxMint


I am wanting to install ubuntu 10.10/mint 9 onto my existing system, while allowing the old distros to boot.
My setup is mirrored mdraid.

Never had any issues before with grub picking up my old systems, but grub2 just isn't working.
I've installed mint OK and it boots fine. But the main grub menu doesn't show, it just boots straight into mint.
This includes the rescue entries in the menus - it neither shows them or any custom entries.

If I run a test in virtualbox without using raid it picks up my old suse distro no problem and gives me an entry at boot.
But using md it wont.

When installed on /dev/sda there are no custom entries in etc/grub.d, so it must be picking them up dynamically.
The /boot/grub/grub.cfg from the working sda install is:
Code:
at 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 [ "${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 {
  insmod vbe         
  insmod vga         
}                    

insmod part_msdos
insmod ext2      
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set 83185308-ed97-4f53-b090-406e20e26a3e
if loadfont /usr/share/grub/unicode.pf2 ; then                         
  set gfxmode=640x480                                                  
  load_video                                                           
  insmod gfxterm                                                       
fi                                                                     
terminal_output gfxterm                                                
insmod part_msdos                                                      
insmod ext2                                                            
set root='(hd0,msdos3)'                                                
search --no-floppy --fs-uuid --set 83185308-ed97-4f53-b090-406e20e26a3e
set locale_dir=($root)/boot/grub/locale                                
set lang=en                                                            
insmod gettext                                                         
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 ###
insmod part_msdos                      
insmod ext2                            
set root='(hd0,msdos3)'                
search --no-floppy --fs-uuid --set 83185308-ed97-4f53-b090-406e20e26a3e
insmod png                                                             
if background_image /boot/grub/linuxmint.png ; then                    
  set color_normal=white/black                                         
  set color_highlight=white/light-gray                                 
else                                                                   
  set menu_color_normal=white/black                                    
  set menu_color_highlight=white/light-gray                            
fi                                                                     
### END /etc/grub.d/06_mint_theme ###                                  

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Linux Mint 10, 2.6.35-22-generic (/dev/sda3)' --class linuxmint --class gnu-linux --class gnu --class os {
        recordfail                                                                                                   
        insmod part_msdos                                                                                            
        insmod ext2                                                                                                  
        set root='(hd0,msdos3)'                                                                                      
        search --no-floppy --fs-uuid --set 83185308-ed97-4f53-b090-406e20e26a3e                                      
        linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=83185308-ed97-4f53-b090-406e20e26a3e ro   quiet splash     
        initrd  /boot/initrd.img-2.6.35-22-generic                                                                   
}                                                                                                                    
menuentry 'Linux Mint 10, 2.6.35-22-generic (/dev/sda3) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
        recordfail                                                                                                                    
        insmod part_msdos                                                                                                             
        insmod ext2                                                                                                                   
        set root='(hd0,msdos3)'                                                                                                       
        search --no-floppy --fs-uuid --set 83185308-ed97-4f53-b090-406e20e26a3e                                                       
        echo    'Loading Linux 2.6.35-22-generic ...'                                                                                 
        linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=83185308-ed97-4f53-b090-406e20e26a3e ro single                              
        echo    'Loading initial ramdisk ...'                                                                                         
        initrd  /boot/initrd.img-2.6.35-22-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,msdos3)'        
        search --no-floppy --fs-uuid --set 83185308-ed97-4f53-b090-406e20e26a3e
        linux16 /boot/memtest86+.bin                                           
}                                                                              
menuentry "Memory test (memtest86+, serial console 115200)" {                  
        insmod part_msdos                                                      
        insmod ext2                                                            
        set root='(hd0,msdos3)'                                                
        search --no-floppy --fs-uuid --set 83185308-ed97-4f53-b090-406e20e26a3e
        linux16 /boot/memtest86+.bin console=ttyS0,115200n8                    
}                                                                              
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "openSUSE 11.2 - 2.6.31.5-0.1 (on /dev/sda2)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos2)'
        search --no-floppy --fs-uuid --set fdb32d3c-7b54-4017-b518-85cdd2e971e9
        linux /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-VBOX_HARDDISK_VB63670e8f-5e367267-part2 resume=/dev/disk/by-id/ata-VBOX_HARDDISK_VB63670e8f-5e367267-part1 splash=silent quiet showopts vga=0x314
        initrd /boot/initrd-2.6.31.5-0.1-default
}
menuentry "Failsafe -- openSUSE 11.2 - 2.6.31.5-0.1 (on /dev/sda2)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos2)'
        search --no-floppy --fs-uuid --set fdb32d3c-7b54-4017-b518-85cdd2e971e9
        linux /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-VBOX_HARDDISK_VB63670e8f-5e367267-part2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
        initrd /boot/initrd-2.6.31.5-0.1-default
}
### END /etc/grub.d/30_os-prober ###

### 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  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
If I run an update-grub it finds and lists suse again, so all is well.

Moving on to the mdadm install, when I run a update-grub it will not find the old suse install, but it does put the other entries in grub.cfg.
Even if I manually add an entry to a custom file in /etc/grub.d is still doesn't display it when running a update-grub.
I can mount the appropriate md0 filesystem OK, so that is working OK.
On boot, even the rescue etc options are not shown, and it boots straight into Mint.

Here is the grub.cfg file generated on the md install, which doesn't work. Nothing is picked up on the search section, and even custom entries I've added are not found on update-grub or shown at boot (nothing is shown, its just a black screen then boots into Mint).
Code:
cat 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 [ "${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 {
  insmod vbe         
  insmod vga         
}                    

insmod raid
insmod mdraid
insmod part_msdos
insmod part_msdos
insmod ext2      
set root='(md2)' 
search --no-floppy --fs-uuid --set 7313b7d2-81d5-4589-ab29-42cfc30098ce
if loadfont /usr/share/grub/unicode.pf2 ; then                         
  set gfxmode=640x480                                                  
  load_video                                                           
  insmod gfxterm                                                       
fi                                                                     
terminal_output gfxterm                                                
insmod raid                                                            
insmod mdraid                                                          
insmod part_msdos                                                      
insmod part_msdos                                                      
insmod ext2                                                            
set root='(md2)'                                                       
search --no-floppy --fs-uuid --set 7313b7d2-81d5-4589-ab29-42cfc30098ce
set locale_dir=($root)/boot/grub/locale                                
set lang=en                                                            
insmod gettext                                                         
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 ###
insmod raid                            
insmod mdraid                          
insmod part_msdos                      
insmod part_msdos                      
insmod ext2                            
set root='(md2)'                       
search --no-floppy --fs-uuid --set 7313b7d2-81d5-4589-ab29-42cfc30098ce
insmod png                                                             
if background_image /boot/grub/linuxmint.png ; then                    
  set color_normal=white/black                                         
  set color_highlight=white/light-gray                                 
else                                                                   
  set menu_color_normal=white/black                                    
  set menu_color_highlight=white/light-gray                            
fi                                                                     
### END /etc/grub.d/06_mint_theme ###                                  

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Linux Mint 10, 2.6.35-22-generic (/dev/md2)' --class linuxmint --class gnu-linux --class gnu --class os {
        recordfail                                                                                                  
        insmod raid                                                                                                 
        insmod mdraid                                                                                               
        insmod part_msdos                                                                                           
        insmod part_msdos                                                                                           
        insmod ext2                                                                                                 
        set root='(md2)'                                                                                            
        search --no-floppy --fs-uuid --set 7313b7d2-81d5-4589-ab29-42cfc30098ce                                     
        linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=7313b7d2-81d5-4589-ab29-42cfc30098ce ro   quiet splash    
        initrd  /boot/initrd.img-2.6.35-22-generic                                                                  
}                                                                                                                   
menuentry 'Linux Mint 10, 2.6.35-22-generic (/dev/md2) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
        recordfail                                                                                                                   
        insmod raid                                                                                                                  
        insmod mdraid                                                                                                                
        insmod part_msdos                                                                                                            
        insmod part_msdos                                                                                                            
        insmod ext2                                                                                                                  
        set root='(md2)'                                                                                                             
        search --no-floppy --fs-uuid --set 7313b7d2-81d5-4589-ab29-42cfc30098ce                                                      
        echo    'Loading Linux 2.6.35-22-generic ...'                                                                                
        linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=7313b7d2-81d5-4589-ab29-42cfc30098ce ro single                             
        echo    'Loading initial ramdisk ...'                                                                                        
        initrd  /boot/initrd.img-2.6.35-22-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 raid                    
        insmod mdraid                  
        insmod part_msdos              
        insmod part_msdos              
        insmod ext2                    
        set root='(md2)'               
        search --no-floppy --fs-uuid --set 7313b7d2-81d5-4589-ab29-42cfc30098ce
        linux16 /boot/memtest86+.bin                                           
}                                                                              
menuentry "Memory test (memtest86+, serial console 115200)" {                  
        insmod raid                                                            
        insmod mdraid                                                          
        insmod part_msdos                                                      
        insmod part_msdos                                                      
        insmod ext2                                                            
        set root='(md2)'                                                       
        search --no-floppy --fs-uuid --set 7313b7d2-81d5-4589-ab29-42cfc30098ce
        linux16 /boot/memtest86+.bin console=ttyS0,115200n8                    
}                                                                              
### END /etc/grub.d/20_memtest86+ ###                                          

### BEGIN /etc/grub.d/30_os-prober ###
if [ "x${timeout}" != "x-1" ]; then   
  if keystatus; then                  
    if keystatus --shift; then        
      set timeout=-1                  
    else                              
      set timeout=0                   
    fi                                
  else                                
    if sleep --interruptible 3 ; then 
      set timeout=0                   
    fi                                
  fi                                  
fi                                    
### END /etc/grub.d/30_os-prober ###  

### 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.                                                
menuentry 'copyMint 10, 2.6.35-22-generic (/dev/md2)' --class linuxmint --class gnu-linux --class gnu --class os {
        recordfail                                                                                                
        insmod raid                                                                                               
        insmod mdraid                                                                                             
        insmod part_msdos                                                                                         
        insmod part_msdos                                                                                         
        insmod ext2                                                                                               
        set root='(md2)'                                                                                          
        search --no-floppy --fs-uuid --set 7313b7d2-81d5-4589-ab29-42cfc30098ce                                   
        linux   /boot/vmlinuz-2.6.35-22-generic root=UUID=7313b7d2-81d5-4589-ab29-42cfc30098ce ro   quiet splash
        initrd  /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Suse (/dev/md0)' --class gnu-linux --class gnu --class os {
        recordfail
        insmod raid
        insmod mdraid
        insmod part_msdos
        insmod part_msdos
        insmod ext2
        set root='(md0)'
        search --no-floppy --fs --set /dev/md0
        linux   /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/md0 ro   splash
        initrd  /boot/initrd-2.6.31.5-0.1-default
}
menuentry 'Suse2 (/dev/md0)' {
        recordfail
        insmod raid
        insmod mdraid
        insmod part_msdos
        insmod part_msdos
        insmod ext2
        set root='(md0)'
        linux   /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/md0 ro   splash
        initrd  /boot/initrd-2.6.31.5-0.1-default
}

### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
/etc/mdadm/mdadm.cfg is setup and I can mount OK.
Code:
cat mdadm.conf
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=8ea2ef6d:9764842c:7bd6ae87:413a3ae4
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=16cf184f:50461f3b:b5ce49ec:e8e6efa5
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=99743c63:948a0c3e:8bdd08bc:3384c9f3
What am I doing wrong? It can't be anything too fundamental as surely mint wouldn't boot?

Can anyone out there help with this, its driving me crazy.
Thanks

Last edited by newbuyer17; 12-09-2010 at 02:21 PM.
 
Old 12-10-2010, 07:40 AM   #2
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
With software raid (i.e. mdadm) you have to have the software (i.e. kernel that supports software raid) running in order to create the arrays. This means that your initrd image that is run prior to loading the operating system and full kernel has to support raid. It's kind of chicken and egg deal, which one came first? There are a couple of things that you can do.

1- Put /boot on its own partition and leave it outside of the software raid devices.

Or

2- Rebuild your initrd image to support root on raid. Here is a link that may help explain the process:

http://www.centos.org/modules/newbb/...=6944&forum=27

Hope this helps.

Regards,

Fordeck
 
Old 12-11-2010, 02:40 PM   #3
newbuyer17
Member
 
Registered: Sep 2006
Posts: 38

Original Poster
Rep: Reputation: 15
Hi,
Thanks for the reply.
I dont think it is applicable though. When you install mdadm in Mint, it rebuilds the ram disk as part of the install in apt-get.
I am able to boot the mint install which is on md disks, would it not be the case that I wouldn't be able to do so without the boot image having md support?

If you still think it is applicable I can look at rebuilding it.
Thanks
 
Old 12-11-2010, 03:13 PM   #4
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Looking at #1 I believe that you should look at the /etc/default/grub file. I just booted my new Linux Mint 10 installed system. There is a parameter called GRUB_HIDDEN_TIMEOUT in the /etc/default/grub file. You could alter its value. I don't want to experiment with mine.

Once you have made a change then you must run update-grub2 in order for your changes to be copied to the /boot/grub/grub.cfg file. Naturally that has to be done as root or via sudo.
 
Old 12-13-2010, 07:03 AM   #5
newbuyer17
Member
 
Registered: Sep 2006
Posts: 38

Original Poster
Rep: Reputation: 15
Thanks, but hasn't made any difference.
Unless anyone has any better ideas I guess I could try downgrading grub2 to grub instead.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] GRUB2 after a minor update of GRUB2 /boot prefix no longer needed?? wikapuki Linux - Software 1 10-24-2010 02:39 PM
mdraid, backup superblock/metadata stalks Linux - General 1 10-01-2009 02:19 PM
Upgrade to OpenSuSE 11.1 GM from RC1 killed RAID5 (mdraid) XFS array Marshalle Linux - Server 14 12-25-2008 08:33 PM
MDADM screws up the LVM partitions? Can't mount the LVMs after mdadm stopped alirezan1 Linux - Newbie 3 11-18-2008 04:42 PM
Software Raid Question(install new disk with mdraid) poj Linux - Software 3 05-23-2006 05:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:29 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