LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Can't boot lfs-8.3 from my new 4 terabyte drive (https://www.linuxquestions.org/questions/linux-from-scratch-13/cant-boot-lfs-8-3-from-my-new-4-terabyte-drive-4175648202/)

Terry Coats 02-13-2019 02:47 AM

Can't boot lfs-8.3 from my new 4 terabyte drive
 
I've been compiling lfs 8.3 on a new 4 terabyte usb drive I just purchased.
I compiled the kernel and put it in /boot as per the instructions.
grub2 is run from my host system which is Ubuntu. I ran update-grub from
there and it saw lfs 8.3 on the new drive and put it into the grub boot menu.
When I attempt to boot grub responds with a "no such partition" message and
give a long identifier. I don't know if it is a guid or uuid.
Here's the relevant portion from grub.cfg after I did update-grub:
Code:

menuentry 'unknown Linux distribution (on /dev/sdb1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-f129096a-da2e-4946-ac60-765e5bad31cb' {
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  f129096a-da2e-4946-ac60-765e5bad31cb
        else
          search --no-floppy --fs-uuid --set=root f129096a-da2e-4946-ac60-765e5bad31cb
        fi
        linux /boot/vmlinuz-4.18.5-lfs-8.3 root=/dev/sdb1 rootdelay=10

I inserted the "rootdelay=10" thinking that might be the problem since it's a usb drive. Didn't help.
I'm pretty sure the problem is because the new drive is partitioned gpt.
I've not had a drive this big before. I partitioned it into 4 equal partitions
using gparted and am using /dev/sdb1, the first partition, to compile lfs 8.3 on.
I consider myself fairly knowledgeable but this one has me stumped.
Anybody got any ideas on this?
Here's the error message from grub:
Code:

error: no such device f129069a-da2e-4946-ac60-765e5bad31cb
error: no such partition


spiky0011 02-13-2019 06:57 AM

Hi
A gpt drive needs a boot partition, not the normal mbr type I,m not at my machine but I had to have a small partion at the begining. I think its called a GPT partition

So basically I have sdb1 is GPT Partition sdb2 boot sdb3,4>>15 are primary.

Is the machine uefi boot or legacy?

arch-linq 02-13-2019 07:26 AM

here's the book sysvinit MBR (not UEFI)grub.cfg :

Code:

    cat > /boot/grub/grub.cfg << "EOF"
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext2
set root=(hd0,2)

menuentry "GNU/Linux, Linux 4.18.5-lfs-8.3" {
        linux  /boot/vmlinuz-4.18.5-lfs-8.3 root=/dev/sda2 ro
}
EOF

You said:
"grub2 is run from my host system which is Ubuntu. I ran update-grub from
there and it saw lfs 8.3 on the new drive and put it into the grub boot menu."


If one chooses to boot the host in uefi mode to build lfs then you are committed to using uefi and gpt together for LFS. That requires more skill and work than a old style MBR LFS install. For one you need a efi boot partiton of at least 512 MB which is what spiky mentioned. Also you would need to study up on ubu dual boot uefi grub.

I would read up on using os-prober and grub-mkconfig from the Ubu Wiki to solve this.

here's some info from my LFS that boots from a refind usb stick. I move drives around so I dont use efibootmgr to create a uefi bios entry for LFS.

Code:

sudo fdisk -l
Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 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: gpt
Disk identifier: 2C192639-138A-7F40-8FD1-571463E6A053

Device        Start      End  Sectors Size Type
/dev/sda1      2048  2099199  2097152  1G EFI System
/dev/sda2  2099200  44042239  41943040  20G Linux filesystem
/dev/sda3  44042240  48236543  4194304  2G Linux swap
/dev/sda4  48236544 184551423 136314880  65G Linux filesystem

Arch is the 20 GB host partition. LFS is the 65GB one.
Here's the LFS part of my arch uefi /boot/grub/grub.cfg:

Code:

# BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Linux From Scratch (20180902-systemd) (on /dev/sda4)' --class linuxfromscratch --class gnu-linux --class gnu --class os $me$
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt4'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt4' --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --h$
        else
          search --no-floppy --fs-uuid --set=root 9f4f3583-b8ec-405d-8d2e-9756ca248ea2
        fi
        linux /boot/vmlinuz-4.20.7-lfs-20190206-systemd root=/dev/sda4
}

Bottom line is this: Before you build LFS you have to decide which way you are going to boot UEFI or MBR. Not just build and then ask update-grub command to magically work on uefi or mbr. It not that smart of a script.

Terry Coats 02-13-2019 07:42 AM

Quote:

Originally Posted by spiky0011 (Post 5961423)
Hi
A gpt drive needs a boot partition, not the normal mbr type I,m not at my machine but I had to have a small partion at the begining. I think its called a GPT partition

So basically I have sdb1 is GPT Partition sdb2 boot sdb3,4>>15 are primary.

Is the machine uefi boot or legacy?

The American Megatrends bios says it is uefi capable but I guess I don't know how to mix
uefi and legacy boot. My Ubuntu host system is on an internal drive and that's where the
grub files are and I guess it's using legacy boot as I've never dome anything special
to get it to work.
I know the new gpt drive has space right at the beginning of the drive
for boot stuff but I don't know what to put there or how. I guess I should
have studied this big capacity hard-drive stuff before I bought one.
The 4 terabyte reads and writes just fine as I have been compiling software
on it. It mounts like any other drive. I've been using /dev/sdb1 (partition1)
for the linuxfromscratch work.
Thanks for the reply.

spiky0011 02-13-2019 08:45 AM

The UEFI or Legacy is in the bios as to how the machine boots, have a look through the bios to help, or google checking for uefi. Thats something you need to know. I dont use uefi boot.

Terry Coats 02-14-2019 02:21 PM

Well, I'm going to mark this solved even though it isn't.
I've wasted enough hours on it. I give up.
I've copied all the lfs 8.3 work I've done over to another
drive with a lot of space on it so I can continue to work
at compiling it. Now the first kernel I built does not
work but that's a different story. At least now I can work
on it again. Thanks to all who responded.


All times are GMT -5. The time now is 03:22 PM.