[SOLVED] Problem adding completed LFS 11.3 partition to existing GRUB
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.
Problem adding completed LFS 11.3 partition to existing GRUB
Hello --
I completed the LFS 11.3 book (systemd version) last night. I did not follow the book's directions for compiling/installing GRUB since I planned to modify the existing GRUB entries on my host computer.
The LFS 11.3 partition is on /dev/sda2. The Linux Mint 21.1 host I used to build LFS is located on /dev/sdb3. Grub is installed on the MBR of sdb, set up in the BIOS as the first drive to boot.
After I completed the book, I ran the "grub-customizer" program on my host to add an entry for LFS. To my pleasant surprise, the program added an entry automatically: "unknown Linux distribution (on /dev/sda2)". I restarted, selected this new entry from the grub menu and LFS booted just fine.
However...
I noticed my networking on the LFS system was broken so I rebooted back into the host system to research how to fix it. When I tried to boot back into LFS a second time, I got a GRUB error:
Code:
error: no such device: 440f8ee8-6803-40dc-beca-4abae454dbfe.
error: file '/boot/vmlinuz-6.1.14-lfs-11.3-systemd' not found.
Press any key to continue...
I made no changes so I'm not sure what happened. I double checked the UUID for /dev/sda2 and it is correct.
I am perplexed why the LFS entry booted once but never again. I'm not sure where to start troubleshooting for fear of making things worse/corrupting my host system. Any help would be appreciated. Thanks.
#
# 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
if [ "${initrdfail}" = 2 ]; then
set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
set next_entry="${prev_entry}"
set prev_entry=
save_env prev_entry
if [ "${next_entry}" ]; then
set initrdfail=2
fi
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 initrdfail {
if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
if [ -z "${initrdfail}" ]; then
set initrdfail=1
if [ -n "${boot_once}" ]; then
set prev_entry="${default}"
save_env prev_entry
fi
fi
save_env initrdfail
fi; fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; 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_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 30b965ce-2555-4acf-81fb-71faefa9ba3e
else
search --no-floppy --fs-uuid --set=root 30b965ce-2555-4acf-81fb-71faefa9ba3e
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=800x600
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=30
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=30
fi
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/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if [ ${grub_platform} != pc ]; then
set linux_gfx_mode=keep
elif 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
menuentry 'Linux Mint 21.1 Cinnamon' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-30b965ce-2555-4acf-81fb-71faefa9ba3e' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 30b965ce-2555-4acf-81fb-71faefa9ba3e
else
search --no-floppy --fs-uuid --set=root 30b965ce-2555-4acf-81fb-71faefa9ba3e
fi
linux /boot/vmlinuz-5.19.0-32-generic root=UUID=30b965ce-2555-4acf-81fb-71faefa9ba3e ro quiet splash
initrd /boot/initrd.img-5.19.0-32-generic
}
submenu 'Advanced options for Linux Mint 21.1 Cinnamon' $menuentry_id_option 'gnulinux-advanced-30b965ce-2555-4acf-81fb-71faefa9ba3e' {
menuentry 'Linux Mint 21.1 Cinnamon, with Linux 5.19.0-32-generic' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.19.0-32-generic-advanced-30b965ce-2555-4acf-81fb-71faefa9ba3e' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 30b965ce-2555-4acf-81fb-71faefa9ba3e
else
search --no-floppy --fs-uuid --set=root 30b965ce-2555-4acf-81fb-71faefa9ba3e
fi
echo 'Loading Linux 5.19.0-32-generic ...'
linux /boot/vmlinuz-5.19.0-32-generic root=UUID=30b965ce-2555-4acf-81fb-71faefa9ba3e ro quiet splash
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.19.0-32-generic
}
menuentry 'Linux Mint 21.1 Cinnamon, with Linux 5.19.0-32-generic (recovery mode)' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.19.0-32-generic-recovery-30b965ce-2555-4acf-81fb-71faefa9ba3e' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 30b965ce-2555-4acf-81fb-71faefa9ba3e
else
search --no-floppy --fs-uuid --set=root 30b965ce-2555-4acf-81fb-71faefa9ba3e
fi
echo 'Loading Linux 5.19.0-32-generic ...'
linux /boot/vmlinuz-5.19.0-32-generic root=UUID=30b965ce-2555-4acf-81fb-71faefa9ba3e ro recovery nomodeset dis_ucode_ldr
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.19.0-32-generic
}
menuentry 'Linux Mint 21.1 Cinnamon, with Linux 5.19.0-28-generic' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.19.0-28-generic-advanced-30b965ce-2555-4acf-81fb-71faefa9ba3e' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 30b965ce-2555-4acf-81fb-71faefa9ba3e
else
search --no-floppy --fs-uuid --set=root 30b965ce-2555-4acf-81fb-71faefa9ba3e
fi
echo 'Loading Linux 5.19.0-28-generic ...'
linux /boot/vmlinuz-5.19.0-28-generic root=UUID=30b965ce-2555-4acf-81fb-71faefa9ba3e ro quiet splash
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.19.0-28-generic
}
menuentry 'Linux Mint 21.1 Cinnamon, with Linux 5.19.0-28-generic (recovery mode)' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.19.0-28-generic-recovery-30b965ce-2555-4acf-81fb-71faefa9ba3e' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 30b965ce-2555-4acf-81fb-71faefa9ba3e
else
search --no-floppy --fs-uuid --set=root 30b965ce-2555-4acf-81fb-71faefa9ba3e
fi
echo 'Loading Linux 5.19.0-28-generic ...'
linux /boot/vmlinuz-5.19.0-28-generic root=UUID=30b965ce-2555-4acf-81fb-71faefa9ba3e ro recovery nomodeset dis_ucode_ldr
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.19.0-28-generic
}
menuentry 'Linux Mint 21.1 Cinnamon, with Linux 5.15.0-67-generic' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-67-generic-advanced-30b965ce-2555-4acf-81fb-71faefa9ba3e' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 30b965ce-2555-4acf-81fb-71faefa9ba3e
else
search --no-floppy --fs-uuid --set=root 30b965ce-2555-4acf-81fb-71faefa9ba3e
fi
echo 'Loading Linux 5.15.0-67-generic ...'
linux /boot/vmlinuz-5.15.0-67-generic root=UUID=30b965ce-2555-4acf-81fb-71faefa9ba3e ro quiet splash
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.15.0-67-generic
}
menuentry 'Linux Mint 21.1 Cinnamon, with Linux 5.15.0-67-generic (recovery mode)' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-67-generic-recovery-30b965ce-2555-4acf-81fb-71faefa9ba3e' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 30b965ce-2555-4acf-81fb-71faefa9ba3e
else
search --no-floppy --fs-uuid --set=root 30b965ce-2555-4acf-81fb-71faefa9ba3e
fi
echo 'Loading Linux 5.15.0-67-generic ...'
linux /boot/vmlinuz-5.15.0-67-generic root=UUID=30b965ce-2555-4acf-81fb-71faefa9ba3e ro recovery nomodeset dis_ucode_ldr
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.15.0-67-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/11_linux_zfs ###
### END /etc/grub.d/11_linux_zfs ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober_proxy ###
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
### END /etc/grub.d/30_os-prober_proxy ###
### BEGIN /etc/grub.d/31_uefi-firmware ###
### END /etc/grub.d/31_uefi-firmware ###
### BEGIN /etc/grub.d/35_fwupd ###
### END /etc/grub.d/35_fwupd ###
### BEGIN /etc/grub.d/40_custom_proxy ###
# 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_proxy ###
### 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/42_custom_proxy ###
menuentry "unknown Linux distribution (on /dev/sda2)" --class linux --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-440f8ee8-6803-40dc-beca-4abae454dbfe' {
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 440f8ee8-6803-40dc-beca-4abae454dbfe
else
search --no-floppy --fs-uuid --set=root 440f8ee8-6803-40dc-beca-4abae454dbfe
fi
linux /boot/vmlinuz-6.1.14-lfs-11.3-systemd root=/dev/sda2
}
### END /etc/grub.d/42_custom_proxy ###
### BEGIN /etc/grub.d/43_os-prober_proxy ###
### END /etc/grub.d/43_os-prober_proxy ###
It didn't work the first time so I ran the tune2fs command.
It didn't work after that either.
Code:
Booting a command list
error: no such device: 440f8ee8-6803-40dc-beca-4abae454dbfe.
error: file/boot/vmlinuz-6.1.14-lfs-11.3-systemd' not found.
Press any key to continue...
I appreciate your help. I'm starting to get discouraged.
the only other thing I can think of is umount the lfs partition and run a fsck on it.
You may be on to something here. Here is the output from fsck of /dev/sda:
Code:
fsck from util-linux 2.37.2
e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Found a gpt partition table in /dev/sda
Nvm I forgot I needed to specify the partition not the device (sda2 not sda):
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.