Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
move to grub2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
emc
Guru
Guru


Joined: 02 Jul 2004
Posts: 564
Location: Cracow, Poland

PostPosted: Wed Aug 05, 2015 6:36 pm    Post subject: move to grub2 Reply with quote

Hi,
I finally decide to move to grub2, but I have some doubts how to do is properly. My current grub looks like:
Code:
boot # cat grub/grub.conf
default 2
timeout 2
splashimage=(hd0,4)/grub/splash.xpm.gz

title Windows 7
rootnoverify (hd0,0)
makeactive
chainloader +1

title=Gentoo Geek Linux (3.11.10-geek) 11geek10_2
root (hd0,6)
kernel (hd0,4)/kernel-11geek10_2-x86_64-3.11.10-geek radeon.modeset=1 video=1366x768-24@60 rootfstype=ext4 root=/dev/sda7 splash=silent,theme:livecd-2007.0 console=tty1 quiet
initrd (hd0,4)/initramfs-11geek10_2-x86_64-3.11.10-geek

title=Gentoo PostFactum Linux (3.19.0-pf1) 19fp2
root (hd0,6)
kernel (hd0,4)/kernel-19pf2-x86_64-3.19.0-pf1 radeon.modeset=1 video=1366x768-24@60 rootfstype=ext4 root=/dev/sda7 splash=silent,theme:livecd-2007.0 console=tty1 quiet
initrd (hd0,4)/initramfs-19pf2-x86_64-3.19.0-pf1

title=Gentoo PostFactum Linux (3.19.0-pf1) 19fp1
root (hd0,6)
kernel (hd0,4)/kernel-19pf1-x86_64-3.19.0-pf1 radeon.modeset=1 video=1366x768-24@60 rootfstype=ext4 root=/dev/sda7 splash=silent,theme:livecd-2007.0 console=tty1 quiet
initrd (hd0,4)/initramfs-19pf1-x86_64-3.19.0-pf1

title=Gentoo PostFactum Linux (3.17.0-pf4) 17fp4
root (hd0,6)
kernel (hd0,4)/kernel-17pf4-x86_64-3.17.0-pf4 radeon.modeset=1 video=1366x768-24@60 rootfstype=ext4 root=/dev/sda7 splash=silent,theme:livecd-2007.0 console=tty1 quiet
initrd (hd0,4)/initramfs-17pf4-x86_64-3.17.0-pf4

And my /dev/sda drive looks like:
Code:
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa9c4c810

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda2          206848 137832447 137625600  65.6G  7 HPFS/NTFS/exFAT
/dev/sda3       137832448 976668671 838836224   400G  5 Extended
/dev/sda5       137834496 138096639    262144   128M 83 Linux
/dev/sda6       138098688 159070207  20971520    10G 82 Linux swap / Solaris
/dev/sda7       159072256 578502655 419430400   200G 83 Linux
/dev/sda8       578504704 976668671 398163968 189.9G  7 HPFS/NTFS/exFAT


  • sda1 - win7 sys reserved
  • sda2 - win7 c drive
  • sda3 - extended partition
  • sda5 - boot
  • sda6 - swap
  • sda7 - root
  • sda8 - win d drive


According to grub2 migration wiki page should I run?
Code:
grub2-install --grub-setup=/bin/true /dev/sda7

or /dev/sda instead?

And what's about win7 entry how to migrate?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Wed Aug 05, 2015 7:34 pm    Post subject: Reply with quote

I usually use the grub 2 from linux mint when i set up my boxes.

any reason why to switch over? as long you do not have any needs and can boot anythign you need ...

I only use grub2 on my boxes because at the time i installed it the first time it was kinda experimental and mint shipped with that. where gentoo used grub 1 at that time ..

the syntax is quite similar. but careful to get rid of all the unecessary bloat of the grub2. boot script => grub.cfg
the autogenreated configs i saw here from gentoo grub2 and mint grub2 are kinda bloated and complicated. half of the statements can be removed and makes the hole config more readable.

careful, when you use the autogenearte / complete / grub2 scripts tehy will erase your grub.cfg. the mint updater gui erased without confirmation my grub.cfg and i did not had a backup and i did not find a backup in that directory too. happened a few weeks ago.

custom boot entries belong to the 40 ... custom section of grub2 which is kinda lets say "bullshit" and a design flaw itself. and you need to add those entries to some sort of /etc direcgtory so the grub script than moves it to boot which is kinda complicated. i think thats the way how it was intended to work.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Wed Aug 05, 2015 7:41 pm    Post subject: Reply with quote

Code:
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="4"
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 video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root a0f74936-7c80-401d-9c33-98408f9603d0
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=1920x1200x32
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos1)'
  search --no-floppy --fs-uuid --set=root 68e44433-b86e-4865-bb33-75c23b8d09ff
  set locale_dir=($root)/grub/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=20
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
if background_color 0,0,0; then
  clear
fi
### 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 ###
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 12 LXDE, 3.0.0-12-generic (/dev/sda1)' --class linuxmint --class gnu-linux --class gnu --class os {
   recordfail
   set gfxpayload=$linux_gfx_mode
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos1)'
   search --no-floppy --fs-uuid --set=root 68e44433-b86e-4865-bb33-75c23b8d09ff
   linux   /vmlinuz-3.0.0-12-generic root=UUID=a0f74936-7c80-401d-9c33-98408f9603d0 ro   quiet splash vt.handoff=7
   initrd   /initrd.img-3.0.0-12-generic
}
menuentry 'Linux Mint 12 LXDE, 3.0.0-12-generic (/dev/sda1) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
   recordfail
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos1)'
   search --no-floppy --fs-uuid --set=root 68e44433-b86e-4865-bb33-75c23b8d09ff
   echo   'Loading Linux 3.0.0-12-generic ...'
   linux   /vmlinuz-3.0.0-12-generic root=UUID=a0f74936-7c80-401d-9c33-98408f9603d0 ro recovery nomodeset
   echo   'Loading initial ramdisk ...'
   initrd   /initrd.img-3.0.0-12-generic
}


Lots of bloatware and autogenerated. you probably get a similar config when you use those grub scripts.

I removed the gentoo configs below because I use a very special setup which is not that common.

just to compare, the grub1 configs are much more better to read and to understand...

grub2 for gentoo, single entry + the above junk which is autogenerated, can be as small as this:

menuentry ' 3.10.67-gentoo_2015_02_05 ' {
linux /3.10.70-gentoo_2015_02_28 init=linuxrc vga=17d ramdisk=8192 crypt_root=... realroot=... dolvm net.ifnames=0
initrd /initramfs-genkernel-x86_64-3.5.3-gentoo_Sept_2012
}

and i suggest you specify root and all stuff needed to boot the box.
Back to top
View user's profile Send private message
emc
Guru
Guru


Joined: 02 Jul 2004
Posts: 564
Location: Cracow, Poland

PostPosted: Wed Aug 05, 2015 9:41 pm    Post subject: Reply with quote

you convince me to stick with grub:0
Back to top
View user's profile Send private message
emc
Guru
Guru


Joined: 02 Jul 2004
Posts: 564
Location: Cracow, Poland

PostPosted: Wed Aug 05, 2015 9:52 pm    Post subject: Reply with quote

anyway grub2-themes are really nice ;(
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Wed Aug 05, 2015 10:05 pm    Post subject: Reply with quote

GRUB2 is really nice - if you write your own config. I don't know why the autogenerated ones are so horrible.

Code:

set default=0
set timeout=15
set root=(hd0,msdos2)

menuentry "Default Linux" {
    linux "/EIS/bzImage-default"
    initrd "/early-microcode.img"
}


Basically that's my config (the part that matters).

Plus a bunch of Live CDs and other stuff.

Code:

submenu "Live CD >" {
    submenu "ArchLinux >" {
        menuentry "ArchLinux 2015.07.01 amd64" {
            set isofile="archlinux-2015.07.01-dual.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201507 img_dev=/dev/disk/by-label/boot_iso img_loop=$isofile earlymodules=loop
            initrd (loop)/arch/boot/x86_64/archiso.img
        }

        menuentry "ArchLinux 2015.07.01 i686" {
            set isofile="archlinux-2015.07.01-dual.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/arch/boot/i686/vmlinuz archisolabel=ARCH_201507 img_dev=/dev/disk/by-label/boot_iso img_loop=$isofile earlymodules=loop
            initrd (loop)/arch/boot/i686/archiso.img
        }
        menuentry "ArchLinux 2014.07.03 amd64" {
            set isofile="archlinux-2014.07.03-dual.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201407 img_dev=/dev/disk/by-label/boot_iso img_loop=$isofile earlymodules=loop
            initrd (loop)/arch/boot/x86_64/archiso.img
        }

        menuentry "ArchLinux 2014.07.03 i686" {
            set isofile="archlinux-2014.07.03-dual.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/arch/boot/i686/vmlinuz archisolabel=ARCH_201407 img_dev=/dev/disk/by-label/boot_iso img_loop=$isofile earlymodules=loop
            initrd (loop)/arch/boot/i686/archiso.img
        }
    }

    submenu "Debian >" {
        menuentry "Debian jessie amd64 netinst" {
            linux /debian/jessie-amd64-linux
            initrd /debian/jessie-amd64-initrd
        }
        menuentry "Debian jessie i386 netinst" {
            linux /debian/jessie-i386-linux
            initrd /debian/jessie-i386-initrd
        }
        menuentry "Debian wheezy amd64 netinst" {
            linux /debian/wheezy-amd64-linux
            initrd /debian/wheezy-amd64-initrd
        }
        menuentry "Debian wheezy i386 netinst" {
            linux /debian/wheezy-i386-linux
            initrd /debian/wheezy-i386-initrd
        }
        menuentry "Debian squeeze amd64 netinst" {
            linux /debian/squeeze-amd64-linux
            initrd /debian/squeeze-amd64-initrd
        }
        menuentry "Debian squeeze i386 netinst" {
            linux /debian/squeeze-i386-linux
            initrd /debian/squeeze-i386-initrd
        }
    }

    submenu "grml >" {
        menuentry "grml64-full - release 2013.09" {
            set isofile="grml64-full_2013.09.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/boot/grml64full/vmlinuz apm=power-off boot=live live-media-path=/live/grml64-full/ bootid=grml64full201309 findiso=$isofile apm=power-off vga=791 nomce
            initrd (loop)/boot/grml64full/initrd.img
        }
        menuentry "grml32-full - release 2013.09" {
            set isofile="grml32-full_2013.09.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/boot/grml32full/vmlinuz apm=power-off boot=live live-media-path=/live/grml32-full/ bootid=grml32full201309 findiso=$isofile apm=power-off vga=791 nomce
            initrd (loop)/boot/grml32full/initrd.img
        }
    }

    submenu "KNOPPIX >" {
        menuentry "KNOPPIX 7.2.0 CD" {
            set isofile="KNOPPIX_V7.2.0CD-2013-06-16-EN.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/boot/isolinux/linux bootfrom=/dev/sda3/$isofile acpi=off keyboard=us language-us
            initrd (loop)/boot/isolinux/minirt.gz
        }
        menuentry "KNOPPIX 7.2.0 DVD" {
            set isofile="KNOPPIX_V7.2.0DVD-2013-06-16-EN.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/boot/isolinux/linux bootfrom=/dev/sda3/$isofile acpi=off keyboard=us language-us
            initrd (loop)/boot/isolinux/minirt.gz
        }
    }

    submenu "Lubuntu >" {
        menuentry "Lubuntu 14.04 Desktop amd64" {
            set isofile="lubuntu-14.04-desktop-amd64.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Lubuntu 14.04 Desktop i386" {
            set isofile="lubuntu-14.04-desktop-i386.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Lubuntu 13.10 Desktop amd64" {
            set isofile="lubuntu-13.10-desktop-amd64.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Lubuntu 13.10 Desktop i386" {
            set isofile="lubuntu-13.10-desktop-i386.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Lubuntu 13.04 Desktop amd64" {
            set isofile="lubuntu-13.04-desktop-amd64.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Lubuntu 13.04 Desktop i386" {
            set isofile="lubuntu-13.04-desktop-i386.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
    }

    submenu "openSUSE >" {
        menuentry "openSUSE 13.2 KDE Live amd64" {
            set isofile="openSUSE-13.2-KDE-Live-x86_64.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/boot/x86_64/loader/linux isofrom_device=/dev/disk/by-label/boot_iso isofrom_system=/$isofile initrd=initrd ramdisk_size=512000 ramdisk_blocksize=4096 splash=silent
            initrd (loop)/boot/x86_64/loader/initrd
        }
        menuentry "openSUSE 13.2 KDE Live i686" {
            set isofile="openSUSE-13.2-KDE-Live-i686.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/boot/i386/loader/linux isofrom_device=/dev/disk/by-label/boot_iso isofrom_system=/$isofile initrd=initrd ramdisk_size=512000 ramdisk_blocksize=4096 splash=silent
            initrd (loop)/boot/i386/loader/initrd
        }
    }

    submenu "SystemRescueCD >" {
        menuentry "SystemRescueCD 4.5.4 amd64" {
            set isofile="systemrescuecd-x86-4.5.4.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue64 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
        menuentry "SystemRescueCD 4.5.4 i586" {
            set isofile="systemrescuecd-x86-4.5.4.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue32 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
        menuentry "SystemRescueCD 4.4.1 amd64" {
            set isofile="systemrescuecd-x86-4.4.1.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue64 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
        menuentry "SystemRescueCD 4.4.1 i586" {
            set isofile="systemrescuecd-x86-4.4.1.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue32 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
        menuentry "SystemRescueCD 4.2.0 amd64" {
            set isofile="systemrescuecd-x86-4.2.0.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue64 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
        menuentry "SystemRescueCD 4.2.0 i586" {
            set isofile="systemrescuecd-x86-4.2.0.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue32 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
        menuentry "SystemRescueCD 3.8.1 amd64" {
            set isofile="systemrescuecd-x86-3.8.1.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue64 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
        menuentry "SystemRescueCD 3.8.1 i586" {
            set isofile="systemrescuecd-x86-3.8.1.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue32 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
        menuentry "SystemRescueCD 3.7.1 amd64" {
            set isofile="systemrescuecd-x86-3.7.1.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue64 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
        menuentry "SystemRescueCD 3.7.1 i586" {
            set isofile="systemrescuecd-x86-3.7.1.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/isolinux/rescue32 isoloop=$isofile
            initrd (loop)/isolinux/initram.igz
        }
    }

    submenu "Ubuntu >" {
        menuentry "Ubuntu 15.04 Desktop amd64" {
            set isofile="ubuntu-15.04-desktop-amd64.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Ubuntu 15.04 Desktop i386" {
            set isofile="ubuntu-15.04-desktop-i386.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Ubuntu 14.10 Desktop amd64" {
            set isofile="ubuntu-14.10-desktop-amd64.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Ubuntu 14.04.1 Desktop amd64" {
            set isofile="ubuntu-14.04.1-desktop-amd64.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Ubuntu 14.04 Desktop amd64" {
            set isofile="ubuntu-14.04-desktop-amd64.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Ubuntu 14.04 Desktop i386" {
            set isofile="ubuntu-14.04-desktop-i386.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Ubuntu 13.10 Desktop amd64" {
            set isofile="ubuntu-13.10-desktop-amd64.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
        menuentry "Ubuntu 13.10 Desktop i386" {
            set isofile="ubuntu-13.10-desktop-i386.iso"
            loopback loop (hd0,msdos3)/$isofile
            linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/$isofile noprompt noeject
            initrd (loop)/casper/initrd.lz
        }
    }
}

submenu "Memtest >" {
    menuentry "memtest86" {
        linux16 /boot/memtest86/memtest
    }
    menuentry "memtest86+" {
        linux16 /boot/memtest86plus/memtest
    }
}

submenu "Other >" {
    menuentry "Windows 7/bootmgr" {
        search --file --no-floppy --set=root /bootmgr
        ntldr /bootmgr
   boot
    }
    menuentry "Windows XP/ntldr" {
        search --file --no-floppy --set=root /ntldr
        ntldr /ntldr
   boot
    }
    menuentry "FreeDOS 1.1" {
        set root=(hd0,msdos1)
        chainloader +1
    }
}
Back to top
View user's profile Send private message
emc
Guru
Guru


Joined: 02 Jul 2004
Posts: 564
Location: Cracow, Poland

PostPosted: Wed Aug 05, 2015 10:08 pm    Post subject: Reply with quote

yeah, but questio is still valid:
Quote:

According to grub2 migration wiki page should I run?
Code:
grub2-install --grub-setup=/bin/true /dev/sda7

or /dev/sda instead?
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Wed Aug 05, 2015 11:22 pm    Post subject: Reply with quote

/dev/sda while your boot partition (where grub files go) is defined in fstab and mounted in /boot...
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 434
Location: Stockholm

PostPosted: Thu Aug 06, 2015 9:08 pm    Post subject: Reply with quote

A combination of boot-loaders work fine for me:

/dev/sda1 -- Windows boot record (never touched this)
/dev/sda3 -- grub
/dev/sda7 -- grub2

Config files need not be on same partition as the boot records. I told Bios to load /dev/sda3 (fdisk toggle boot flag). Windows and grub2 are then chainloaded from grub:
Code:
title           Windows
root            (hd0,0)
chainloader     +1

title           grub2 sda7
root            (hd0,6)
chainloader     +1

grub and grub2 were installed like this:
Code:
grub-install --root-directory=/boot /dev/sda3

grub2-install --root-directory=/ --boot-directory=/grub2 --force /dev/sda7
grub2-mkconfig -o /grub2/grub/grub.cfg

This works for Windows 7. Windows 10 needs dos command "shutdown /p" to be powered off...
Back to top
View user's profile Send private message
emc
Guru
Guru


Joined: 02 Jul 2004
Posts: 564
Location: Cracow, Poland

PostPosted: Sat Aug 08, 2015 3:54 pm    Post subject: Reply with quote

NICE! Can you post how you HDD(s) look like, I meant partition, what grub2 boot to?
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 434
Location: Stockholm

PostPosted: Sat Aug 08, 2015 5:20 pm    Post subject: Reply with quote

I use grub2 to boot FreeBSD (FB didn't like my partition table). For that I only coded:

/etc/grub.d/40_custom
Code:
/etc/grub.d/40_custom #!/bin/sh
exec tail -n +3 $0
# 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 "FreeBSD (direct boot)" {
        insmod ufs2
        search  --no-floppy --fs-uuid --set=root 52f2ac1c661593d7
        kfreebsd /boot/kernel/kernel
        kfreebsd_loadenv /boot/device.hints
        set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ufsid/52f2ac1c661593d7
        set kFreeBSD.vfs.root.mountfrom.options=rw
}
menuentry "FreeBSD (via /boot/loader)" {
        insmod ufs2
        search  --no-floppy --fs-uuid --set=root 52f2ac1c661593d7
        kfreebsd /boot/loader
}
menuentry "FreeBSD (alt direct boot)" --class freebsd --class bsd --class os {
        insmod ufs2
        set root=(hd0,3)
        kfreebsd /boot/kernel/kernel
        kfreebsd_loadenv /boot/device.hints
        set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0s3
        set kFreeBSD.vfs.root.mountfrom.options=rw
}
grub2-mkconfig then generated a usable 431 lines looong config file... :)
For linux I still use grub:0
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum