View previous topic :: View next topic |
Author |
Message |
slackline Veteran
Joined: 01 Apr 2005 Posts: 1471 Location: /uk/sheffield
|
Posted: Wed Nov 14, 2012 4:31 pm Post subject: GRUB2 on root partition |
|
|
Hi,
I'm stuck with Grub2 again after having to have the HD replaced under warranty
I posted further up in this thread a solution to my install problems was to simply do away with a separate boot partition and install it on the main root partition (i.e. /boot resides under the main partition of /).
So as this is a fresh install I opted to only create two partitions, root (/) and one for data (I.e. /home)....
Code: |
/dev/sda1 / ext4 noatime 0 1
/dev/sda2 /home ext4 noatime 0 2 |
I'm in a chroot'd environment, having mounted /dev/sda1 at /mnt/gentoo and /dev/sda2 at /mnt/gentoo/home and then chroot.
I've compiled my kernel and copied it to the /boot/ directory using the following...
Code: |
#!/bin/sh
exec tail -n +3 $0
menuentry "Gentoo 3.6.6" {
insmod ext2
search --no-floppy
linux /boot/3.6.6 root=/dev/sda1 rootfstype=ext4 libachi.ignore_sss=1 i915.i915_enable_rc6=1
} |
...and I make the configuration file with...
Code: |
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg
done
# cat /boot/grub2/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
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 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,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 b7ac1d8e-a726-4b27-8d16-90f605e86aae
else
search --no-floppy --fs-uuid --set=root b7ac1d8e-a726-4b27-8d16-90f605e86aae
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_US
insmod gettext
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### 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 "Gentoo 3.6.6" {
insmod ext2
search --no-floppy
linux /boot/3.6.6 root=/dev/sda1 rootfstype=ext4 libahci.ignore_sss=1 i915.i915_enable_rc6=1
}
### 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
|
However I'm finding I can't actually install as this continually fails...
Code: |
# grub2-install /dev/sda
source_dir doesn't exist. Please specify --target or --directory
|
I've tried the following variants, none of which work....
Code: |
# grub2-install --target=/dev/sda1
source_dir doesn't exist. Please specify --target or --directory
# grub2-install --target=/dev/sda1 --directory=/boot/
/usr/sbin/grub2-install: line 337: /boot//modinfo.sh: No such file or directory
# grub2-install --directory=/dev/sda1
source_dir doesn't exist. Please specify --target or --directory
# grub2-install --directory=/boot
/usr/sbin/grub2-install: line 337: /boot/modinfo.sh: No such file or directory
|
As I read last time if /boot is on its own partition this should only be mounted after chrooting, but in this instance as I've opted not to have a separate /boot partition that is obviously impossible (isn't it?) as I have to mount the partition before I can chroot into it.
Any pointers on how to solve this appreciated as I can't see that I'm doing anything different from lasts time.
Thanks in advance,
slack _________________ "Science is what we understand well enough to explain to a computer. Art is everything else we do." - Donald Knuth
Last edited by slackline on Thu Nov 15, 2012 7:31 am; edited 1 time in total |
|
Back to top |
|
|
slackline Veteran
Joined: 01 Apr 2005 Posts: 1471 Location: /uk/sheffield
|
Posted: Wed Nov 14, 2012 5:35 pm Post subject: |
|
|
Ok, I seem to have got this to install now using...
Code: |
# grub2-install --directory=/usr/lib/grub/i386-pc/ /dev/sda
Installation finished. No error reported.
|
Fingers crossed for the reboot, if it works I'll report back and file a bug _________________ "Science is what we understand well enough to explain to a computer. Art is everything else we do." - Donald Knuth |
|
Back to top |
|
|
|
|
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
|
|