View previous topic :: View next topic |
Author |
Message |
1clue Advocate
Joined: 05 Feb 2006 Posts: 2569
|
Posted: Sat Feb 07, 2015 4:29 am Post subject: Grub mounts wrong /boot. Solved. |
|
|
Hi,
I bought an SSD and moved my install over to that mostly. I kept the spinner for things like swap or things that don't get used much.
sda is the ssd, which I want to boot completely from.
sdb is the spinner which is older.
This layout as is mounted is the way I want it. The /mnt partition is my old /boot. This isn't the whole partition table but it's what matters for this discussion.
I installed the kernel into /dev/sda2 (which correctly mounts as /boot) and rebooted, got my old kernel and nothing in the list to boot from other than older kernels.
I recompiled again, thinking it was a tatered kernel. Same story.
I copied /boot/grub/grub.cfg to /mnt/grub/grub.cfg, and it boots with the new kernel.
How do I tell the box not to use the grub from /dev/sdb but instead from /dev/sda?
Code: |
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda1 8:1 0 2M 0 part
├─sda2 8:2 0 512M 0 part /boot
├─sda3 8:3 0 10G 0 part /
└─sda4 8:4 0 420G 0 part
└─ssdvg1-host_home 253:3 0 10G 0 lvm /home
sdb 8:16 0 698.7G 0 disk
├─sdb1 8:17 0 2M 0 part
├─sdb2 8:18 0 512M 0 part /mnt
├─sdb3 8:19 0 10G 0 part
└─sdb4 8:20 0 688.1G 0 part
├─hddvg1-host_swap 253:0 0 24G 0 lvm [SWAP]
├─hddvg1-host_usr_src 253:1 0 5G 0 lvm /usr/src
└─hddvg1-mysql 253:2 0 1G 0 lvm
|
Code: |
# cat /boot/grub/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
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
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 loadfont unicode ; then
set gfxmode=1920x1080
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
if [ "x$grub_platform" = xefi ]; then
set gfxpayload=keep
fi
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.17.7-hardened-r1kr01 ...'
linux /vmlinuz-3.17.7-hardened-r1kr01 root=/dev/sda3 ro
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-073ca60e-886c-490d-910b-58ff6e628013' {
menuentry 'Gentoo GNU/Linux, with Linux 3.17.7-hardened-r1kr01' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.17.7-hardened-r1kr01-advanced-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
if [ "x$grub_platform" = xefi ]; then
set gfxpayload=keep
fi
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.17.7-hardened-r1kr01 ...'
linux /vmlinuz-3.17.7-hardened-r1kr01 root=/dev/sda3 ro
}
menuentry 'Gentoo GNU/Linux, with Linux 3.17.7-hardened-r1kr01 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.17.7-hardened-r1kr01-recovery-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
if [ "x$grub_platform" = xefi ]; then
set gfxpayload=keep
fi
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.17.7-hardened-r1kr01 ...'
linux /vmlinuz-3.17.7-hardened-r1kr01 root=/dev/sda3 ro single
}
menuentry 'Gentoo GNU/Linux, with Linux 3.13.6-hardened-r3-kr1' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.6-hardened-r3-kr1-advanced-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.13.6-hardened-r3-kr1 ...'
linux /kernel-3.13.6-hardened-r3-kr1 root=/dev/sda3 ro
}
menuentry 'Gentoo GNU/Linux, with Linux 3.13.6-hardened-r3-kr1 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.6-hardened-r3-kr1-recovery-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.13.6-hardened-r3-kr1 ...'
linux /kernel-3.13.6-hardened-r3-kr1 root=/dev/sda3 ro single
}
menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo-kr3' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-kr3-advanced-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.12.13-gentoo-kr3 ...'
linux /kernel-3.12.13-gentoo-kr3 root=/dev/sda3 ro
}
menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo-kr3 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-kr3-recovery-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.12.13-gentoo-kr3 ...'
linux /kernel-3.12.13-gentoo-kr3 root=/dev/sda3 ro single
}
menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo-kr2' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-kr2-advanced-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.12.13-gentoo-kr2 ...'
linux /kernel-3.12.13-gentoo-kr2 root=/dev/sda3 ro
}
menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo-kr2 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-kr2-recovery-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.12.13-gentoo-kr2 ...'
linux /kernel-3.12.13-gentoo-kr2 root=/dev/sda3 ro single
}
menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-advanced-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.12.13-gentoo ...'
linux /kernel-3.12.13-gentoo root=/dev/sda3 ro
}
menuentry 'Gentoo GNU/Linux, with Linux 3.12.13-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.13-gentoo-recovery-073ca60e-886c-490d-910b-58ff6e628013' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 73e8bc45-4613-4f80-9ae5-5f78c21a6415
else
search --no-floppy --fs-uuid --set=root 73e8bc45-4613-4f80-9ae5-5f78c21a6415
fi
echo 'Loading Linux 3.12.13-gentoo ...'
linux /kernel-3.12.13-gentoo root=/dev/sda3 ro single
}
}
### 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.
### 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 ###
|
Last edited by 1clue on Sat Feb 07, 2015 5:41 pm; edited 1 time in total |
|
Back to top |
|
|
Roman_Gruber Advocate
Joined: 03 Oct 2006 Posts: 3846 Location: Austro Bavaria
|
Posted: Sat Feb 07, 2015 10:57 am Post subject: Re: Grub mounts wrong /boot |
|
|
1clue wrote: |
How do I tell the box not to use the grub from /dev/sdb but instead from /dev/sda?
|
I have a very old box but in my days I used to tell my bios where to boot from!
When you power your box the first thing that starts is the bios. Therefore => bios => select the disc where to boot from |
|
Back to top |
|
|
1clue Advocate
Joined: 05 Feb 2006 Posts: 2569
|
Posted: Sat Feb 07, 2015 5:40 pm Post subject: |
|
|
That's really embarrassing.
I've been building my own PC hardware since the early 90's. I knew that.
Thanks. |
|
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
|
|