Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm working on booting a recently compiled/installed LFS system using UEFI. The reason for choosing UEFI versus Legacy is that the system currently has both Win7 (on a separate SATA Harddrive 0) and RHEL 6.5 (separate SATA Harddrive 1) installed; each of which boots via UEFI, and as I understand UEFI/Legacy boot operations, I must choose one or the other for all OSes on the system (do correct me if I am in error). At any rate, if I can get it to run UEFI or Legacy, I'm open to either, but as the system current stands, on all occasions I seem to be unable to install GRUB2 on the chrooted LFS system (installed on SATA Harddrive 4):
3) I am not an expert in this area but if you have not enforced UEFI in bios then it is still possible to use normal grub or normal grub2
with a chainloader entry to get windows to boot.
so for example
set boot order to sdb.....and assumes you can do that or swap cables if you can't
grub to MBR of sdb
windows entry for grub legacy something like
Quote:
title chainload
root (hd1)
chainloader +1
for grub2 something like
Quote:
menuentry "chainload" {
insmod ntfs
set root='hd1'
chainloader +1
)
...and there is an UEFI partition on my RHEL6 drive:
Code:
Model: ATA WDC WD5000AZLX-0 (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 211MB 210MB fat16 boot <--Right here.
2 211MB 735MB 524MB ext4
3 735MB 500GB 499GB lvm
That said, converting the partition from the current fat16 to fat32 is an option, but since I can boot to grub; for the time being I may forgo such a conversion. Also, my current RHEL6 is partitioned with fat16 and UEFI works like a bandit.
Also per your suggestion:
Quote:
if you have not enforced UEFI in bios then it is still possible to use normal grub or normal grub2
Unfortuately for this new LFS system, UEFI is enabled and is the current method for booting into Win7 or RHEL6, with which I will remain.
Lastly, thanks for the link - you have indeed been helpful.
* * *
As to the matter of still not being able to boot, the additional steps taken were the following:
1) Uninstalled and recompiled GRUB2 with "--with-platform=efi" option:
Code:
root:/# time { clear && echo Extracting and Compiling GRUB2... && tar -xvJf grub-2.00.tar.xz >> ./logs/grub-install.log && \
cd grub-2.00 && sed -i -e '/gets is a/d' grub-core/gnulib/stdio.in.h && echo Configuring... && \
./configure --with-platform=efi \
--prefix=/usr \
--sysconfdir=/etc \
--disable-grub-emu-usb \
--disable-efiemu \
--disable-werror >> ../logs/grub-install.log 2>> ../logs/grub-install.log && echo Make... && \
make -j32 >> ../logs/grub-install.log 2>> ../logs/grub-install.log && echo Make Install... && \
make -j32 install >> ../logs/grub-install.log 2>> ../logs/grub-install.log; }
2) Ran grub-mkimage and grub-mkconfig and copied the files to the EFI partition:
Code:
root:/# cd /sources/grub-2.00/grub-core
root:/# /usr/bin/grub-mkimage -p=/boot/efi/EFI/grub -d /usr/lib/grub/x86_64-efi \
-O x86_64-efi -o grub_x64.efi boot linux part_gpt fat ext2 normal \
configfile lspci ls reboot datetime loadenv search lvm help
root:/# cp grub_x64.efi /boot/efi/EFI/grub
root:/# grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg
Though GRUB now loads the kernel image, the system halts right after an OS selection is made:
Code:
Loading Linux 3.10.26-lfs-7.4...
_
So that GRUB could at least load the image, I reinstalled GRUB, and ran "grub-install" from the /sources/grub-2.00 directory which seemed to have an effect:
Code:
root:/# tar -xvJf grub-2.00.tar.xz >> ../logs/grub-install.log
root:/# cd grub-2.00
root:/# sed -i -e '/gets is a/d' grub-core/gnulib/stdio.in.h
root:/# ./configure --with-platform=efi \
> --prefix=/usr \
> --sysconfdir=/etc \
> --disable-grub-emu-usb \
> --disable-efiemu \
> --disable-werror >> ../logs/grub-install.log 2>> ../logs/grub-install.log
root:/# make -j >> ../logs/grub-install.log 2>> ../logs/grub-install.log
root:/# make -j install >> ../logs/grub-install.log 2>> ../logs/grub-install.log
root:/sources/grub-2.00# grub-install --target=x86_64-efi /dev/sda
/usr/sbin/grub-install: line 831: which: command not found
Installation finished. No error reported.
root:/sources/grub-2.00# grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.10.26-lfs-7.4
done
root:/# cp /boot/efi/EFI/grub/grub.cfg /boot/grub
That said, to help alleviate the error, I re-ran the kernel configuration using "make defconfig" and updated a minimal number of specific options through "make menuconfig." After that, I recompiled the kernel and rebooted whereupon GRUB again loaded the correct kernel image, but the system immediately halted.
While the problem with GRUB appears to be resolved, a new problem in loading the kernel looms ahead.
Anyone have any general ideas of why the system is stopping?
also it might help if you upload your grub.cfg and link to it?
in particular does LFS have this grub.cf snippet?
Quote:
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
lower down you will need
insmod font
instead of a script function you could simply use one line commands and see which one works
try
insmod efi_gop
insmod font
reboot to test and if it fails try
insmod efi_uga
insmod font
I have a 32 systen non-UEFI so I actually lack those modules
Thanks for the reply. I apologize for the slight tardiness - I've been working on this quite diligently for the last 24-48 hours.
Reaper7X,
Thank you for your input - I actually don't seem to have that file in /etc/defaults/:
Code:
root:/etc/default# ls -la
total 12
drwxr-xr-x 2 root root 4096 Jan 16 15:25 .
drwxr-xr-x 12 root root 4096 Jan 19 17:03 ..
-rw-r--r-- 1 root root 118 Jan 16 15:25 useradd
root:/etc/default#
This missing file may be an clue as to an interesting interaction I'm getting with GRUB. See ****** below...
So, after recompiling and re-installing GRUB, I'm now getting:
Code:
Booting a command list
Loading Linux 3.10.26-lfs-7.4...
_
The "_" appears to be a non-blinking cursor and again, I have no kernel output.
*********
Here's the really interesting thing, if I copy the LFS Kernel image file and the System Map file to the Red Hat /boot partition, I can boot via UEFI to the Red Hat GRUB, call the LFS Kernel, and the LFS system boots just fine. But, if I try to boot via UEFI directly to the GRUB on my LFS /boot partition, I get the above output and the system halts. Correct me if I'm wrong, but I believe that this tells me that the Kernel is fine. What might this indicate?
It should be noted, however, the RHEL6.5 system is partitioned with LVMs (with the exception of /boot and /boot/efi), whereas LFS is standard partitions (also, I changed /boot/efi to fat32, per the UEFI spec).
*********
At any rate, here's the grub.cfg file:
Code:
#
# 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
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 loadfont unicode ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'GNU/Linux' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-/dev/mapper/vg_sqt-lv_root' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 caad3563-6c2c-425a-9c00-aa3563f8388d
else
search --no-floppy --fs-uuid --set=root caad3563-6c2c-425a-9c00-aa3563f8388d
fi
echo 'Loading Linux 3.10.26-lfs-7.4 ...'
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/mapper/vg_sqt-lv_root ro
}
submenu 'Advanced options for GNU/Linux' $menuentry_id_option 'gnulinux-advanced-/dev/mapper/vg_sqt-lv_root' {
menuentry 'GNU/Linux, with Linux 3.10.26-lfs-7.4' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.26-lfs-7.4-advanced-/dev/mapper/vg_sqt-lv_root' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 caad3563-6c2c-425a-9c00-aa3563f8388d
else
search --no-floppy --fs-uuid --set=root caad3563-6c2c-425a-9c00-aa3563f8388d
fi
echo 'Loading Linux 3.10.26-lfs-7.4 ...'
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/mapper/vg_sqt-lv_root ro
}
menuentry 'GNU/Linux, with Linux 3.10.26-lfs-7.4 (recovery mode)' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.26-lfs-7.4-recovery-/dev/mapper/vg_sqt-lv_root' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 caad3563-6c2c-425a-9c00-aa3563f8388d
else
search --no-floppy --fs-uuid --set=root caad3563-6c2c-425a-9c00-aa3563f8388d
fi
echo 'Loading Linux 3.10.26-lfs-7.4 ...'
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/mapper/vg_sqt-lv_root 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 ###
### BEGIN /etc/grub.d/i386-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 loadfont unicode ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/i386-00_header ###
### BEGIN /etc/grub.d/i386-10_linux ###
menuentry 'GNU/Linux' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-/dev/mapper/vg_sqt-lv_root' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 caad3563-6c2c-425a-9c00-aa3563f8388d
else
search --no-floppy --fs-uuid --set=root caad3563-6c2c-425a-9c00-aa3563f8388d
fi
echo 'Loading Linux 3.10.26-lfs-7.4 ...'
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/mapper/vg_sqt-lv_root ro
}
submenu 'Advanced options for GNU/Linux' $menuentry_id_option 'gnulinux-advanced-/dev/mapper/vg_sqt-lv_root' {
menuentry 'GNU/Linux, with Linux 3.10.26-lfs-7.4' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.26-lfs-7.4-advanced-/dev/mapper/vg_sqt-lv_root' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 caad3563-6c2c-425a-9c00-aa3563f8388d
else
search --no-floppy --fs-uuid --set=root caad3563-6c2c-425a-9c00-aa3563f8388d
fi
echo 'Loading Linux 3.10.26-lfs-7.4 ...'
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/mapper/vg_sqt-lv_root ro
}
menuentry 'GNU/Linux, with Linux 3.10.26-lfs-7.4 (recovery mode)' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.26-lfs-7.4-recovery-/dev/mapper/vg_sqt-lv_root' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 caad3563-6c2c-425a-9c00-aa3563f8388d
else
search --no-floppy --fs-uuid --set=root caad3563-6c2c-425a-9c00-aa3563f8388d
fi
echo 'Loading Linux 3.10.26-lfs-7.4 ...'
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/mapper/vg_sqt-lv_root ro single
}
}
### END /etc/grub.d/i386-10_linux ###
### BEGIN /etc/grub.d/i386-20_linux_xen ###
### END /etc/grub.d/i386-20_linux_xen ###
### BEGIN /etc/grub.d/i386-30_os-prober ###
### END /etc/grub.d/i386-30_os-prober ###
### BEGIN /etc/grub.d/i386-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/i386-40_custom ###
### BEGIN /etc/grub.d/i386-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/i386-41_custom ###
### BEGIN /etc/grub.d/x86_64-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 loadfont unicode ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/x86_64-00_header ###
### BEGIN /etc/grub.d/x86_64-10_linux ###
menuentry 'GNU/Linux' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-/dev/mapper/vg_sqt-lv_root' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 caad3563-6c2c-425a-9c00-aa3563f8388d
else
search --no-floppy --fs-uuid --set=root caad3563-6c2c-425a-9c00-aa3563f8388d
fi
echo 'Loading Linux 3.10.26-lfs-7.4 ...'
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/mapper/vg_sqt-lv_root ro
}
submenu 'Advanced options for GNU/Linux' $menuentry_id_option 'gnulinux-advanced-/dev/mapper/vg_sqt-lv_root' {
menuentry 'GNU/Linux, with Linux 3.10.26-lfs-7.4' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.26-lfs-7.4-advanced-/dev/mapper/vg_sqt-lv_root' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 caad3563-6c2c-425a-9c00-aa3563f8388d
else
search --no-floppy --fs-uuid --set=root caad3563-6c2c-425a-9c00-aa3563f8388d
fi
echo 'Loading Linux 3.10.26-lfs-7.4 ...'
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/mapper/vg_sqt-lv_root ro
}
menuentry 'GNU/Linux, with Linux 3.10.26-lfs-7.4 (recovery mode)' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10.26-lfs-7.4-recovery-/dev/mapper/vg_sqt-lv_root' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd1,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2 caad3563-6c2c-425a-9c00-aa3563f8388d
else
search --no-floppy --fs-uuid --set=root caad3563-6c2c-425a-9c00-aa3563f8388d
fi
echo 'Loading Linux 3.10.26-lfs-7.4 ...'
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/mapper/vg_sqt-lv_root ro single
}
}
### END /etc/grub.d/x86_64-10_linux ###
### BEGIN /etc/grub.d/x86_64-20_linux_xen ###
### END /etc/grub.d/x86_64-20_linux_xen ###
### BEGIN /etc/grub.d/x86_64-30_os-prober ###
### END /etc/grub.d/x86_64-30_os-prober ###
### BEGIN /etc/grub.d/x86_64-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/x86_64-40_custom ###
### BEGIN /etc/grub.d/x86_64-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/x86_64-41_custom ###
Thank you kindly for both of your input - you continue to be most helpful.
Slackware has a few extra configuration steps for their UEFI booting Grub2 here in the SlackBuild so you might want to see what they're doing and possibly backport it to LFS:
Apologies for the tardy post - I finally got this thing working. Unfortunately, UEFI was a no-go, but I did end up getting it to work through a BIOS boot. Of particular note was that the kernel device driver configuration was in need of a major overhaul (perhaps now I can go back and try to do an EFI boot, if I ever feel froggy enough).
Here's how I did it:
1) Create an MBR partition table on the target drive (with fstab), so the table now looks like this:
Code:
[root@localhost ~]# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): u
Changing display/entry units to sectors
Command (m for help): p
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 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
Disk identifier: 0x00082ae8
Device Boot Start End Blocks Id System
/dev/sdb1 * 2000 1026000 512000+ 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2 1028160 946340954 472656397+ 83 Linux
/dev/sdb3 946340955 976768064 15213555 82 Linux swap / Solaris
Note the boot flag on sdb1 and the start sector of sdb1 at sector 2000 (as opposed to 1 or 63). This decision is based on the GNU GRUB2 User Manual, linked here: http://www.gnu.org/software/grub/man...S-installation
After copying the LFS system files to the new partitions, I uninstalled the current GRUB2 installation; recompiled and re-installed GRUB2 under the i386-pc platform, like so:
set default=0
set timeout=5
insmod ext2
set root=(hd0,msdos1)
menuentry "SqueekToy, Linux 3.10.26-lfs-7.4" {
linux /vmlinuz-3.10.26-lfs-7.4 root=/dev/sda2 ro
}
Notice the difference between the fdisk command showing that LFS is on sdb (causing much consternation when debugging), whereas GRUB is calling for root on sda. This is the result of a personal choice in that when I boot to the LFS system, I also disable all other SATA drives through the BIOS configuration. Thus, the kernel sees the first BIOS-found drive as sda (the only active drive, sda; which is LFS).
One gotcha was the CONFIG_CMDLINE_BOOL kernel configuration option. Found here: Processor Type and Features --> Built-in kernel command line
Make sure that little guy is turned off - the drives weren't mounting properly because the option was on and overriding any commands sent to the kernel from the bootloader. So, when GRUB specified "root=/dev/sda2," the kernel was using its own built-in commands instead of GRUB's. From what I understand, unless you have weird requirements (an embedded system), the bootloader should be giving all direction that the kernel needs.
Anyways, she seems to be up and running.
Again, thanks for all the help, I really appreciate it and I could not ask for more from the Linux community.
This is the result of a personal choice in that when I boot to the LFS system, I also disable all other SATA drives through the BIOS configuration. Thus, the kernel sees the first BIOS-found drive as sda (the only active drive, sda; which is LFS).
If you ever get tired of doing that, the UUID of the LFS partition can be used in the grub.cfg linux command instead of the device name. And your set root command containing GRUB device syntax can be replaced with the search command containing --fs-uuid --set=root and the UUID. Then it won't matter in what order the kernel discovers and names your drives, and you won't need to disable any of them to boot the LFS system. Anyway, this how I deal with this matter for systems on external USB drives.
P.S.: Using UUIDs (or LABELs) in the grub.cfg file requires that you create an initial ram filesystem. It's a trivial thing to do and explained in the book.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.