Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Booting problem GPT BIOS/ GRUB
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
professor1234
n00b
n00b


Joined: 27 Mar 2005
Posts: 47
Location: Kraków, Poland

PostPosted: Wed Dec 13, 2017 4:53 pm    Post subject: [Solved] Booting problem GPT BIOS/ GRUB Reply with quote

Hi,

I have a problem to boot the system after installation. The BIOS complains :"Hard disk boot sector invalid, bla, bla bla". I'm wondering am i screwed up something or there are some other reasons it does not work.
So - I've installed Gentoo on old Fujitsu Client S400 (CPU TM5800) - client is working correctly and other systems were running on it ok.
So I've prepared disc according to instruction [url] https://wiki.gentoo.org/wiki/Handbook:X86/Installation/Disks [/url] chapter "Alternative: Using fdisk to partition the disk". The disk looks as follow:
Code:

livecd ~ # fdisk -l /dev/sda
Disk /dev/sda: 3.5 GiB, 3774726144 bytes, 7372512 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: 8006951B-2E46-11E5-9439-0090DC057632

Device       Start     End Sectors  Size Type
/dev/sda1     2048    6143    4096    2M BIOS boot
/dev/sda2     6144  268287  262144  128M Linux filesystem
/dev/sda3   268288 1316863 1048576  512M Linux filesystem
/dev/sda4  1316864 7372478 6055615  2.9G Linux filesystem
livecd ~ #


Additionally I've set the boot flag on partition 2 (in fdisk -> x -> A -> 2 -> r -> w).

After kernel compilation I've made:
Code:

make install


This after this command I have following files in /boot
Code:

config-4.12.12-gentoo  System.map-4.12.12-gentoo
lost+found             vmlinuz-4.12.12-gentoo


After running grub-install no errors reported...
Code:

(chroot) livecd /boot # grub-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
(chroot) livecd /boot #


No errors with grub-mconfig
Code:

(chroot) livecd /boot # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.12.12-gentoo
done
(chroot) livecd /boot #


After reboot - the system is not booting.

I'm playing with that 2nd day, had in mean time read some about GPT/BIOS/UEFI etc... Honestly I would prefer the regular old fashion method. I've tried with lilo but it does not work too (I've removed partition 1 & 2 created bootable ext2, copied the kernel there, prepared lilo.conf, runned lilo - no errors but again no boot...)
The disk is gpt but I afraid to change it into dos with an example parted as I don't want to lose partitions...

The parted is showing following data:
Code:

livecd ~ # parted -l /dev/sda
Model: ATA CF CARD 4GB (scsi)
Disk /dev/sda: 3775MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  3146kB  2097kB                        bios_grub
 2      3146kB  137MB   134MB   ext2                  legacy_boot
 3      137MB   674MB   537MB   linux-swap(v1)
 4      674MB   3775MB  3100MB  ext4


Command for grub-install with efi gives following error:
Code:

(chroot) livecd / # grub-install --target=x86_64-efi --efi-directory=/boot
grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.


Is there some "few commands solution" for that maybe ?


Last edited by professor1234 on Wed Dec 13, 2017 8:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 39653
Location: 56N 3W

PostPosted: Wed Dec 13, 2017 5:54 pm    Post subject: Reply with quote

professor1234,

I suspect that you are mixing
Code:
Disklabel type: gpt
and BIOS.

The BIOS cannot read the GPT partition table, so whatever you set there is only used by the kernel, once its loaded.
When you make a GPT disklable, you get a protective DOS disklable too.

Your BIOS will read the partition table in the protective DOS disklable but its a fake.
To keep the BIOS happy, set the bootable flag here.

Code:
fdisk -t dos /dev/sda
will allow you to do that.
Do not edit the partition table and do not be alarmed that it contains only one partition.
Ins purpose is to hold the flag settings for the BIOS to read and to warn that GPT is in use.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
professor1234
n00b
n00b


Joined: 27 Mar 2005
Posts: 47
Location: Kraków, Poland

PostPosted: Wed Dec 13, 2017 7:45 pm    Post subject: Reply with quote

Hi NeddySeagoon,

Thank you for feedback.

I've made the command but it looks, it's not changing anything:
Code:

livecd ~ # fdisk -t dos /dev/sda

Welcome to fdisk (util-linux 2.28.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

livecd ~ # fdisk -l /dev/sda
Disk /dev/sda: 3.5 GiB, 3774726144 bytes, 7372512 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: 8006951B-2E46-11E5-9439-0090DC057632



Still the disk label is gpt. Anyhow I've tried to reboot, stil does not go up.

I was wondering to change it with parted, but message stopped me:
Code:

livecd ~ # parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel msdos
Warning: The existing disk label on /dev/sda will be destroyed and all data on
this disk will be lost. Do you want to continue?
Yes/No? No
(parted) quit
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 39653
Location: 56N 3W

PostPosted: Wed Dec 13, 2017 8:01 pm    Post subject: Reply with quote

professor1234,

You have two disklables.

Code:
fdisk -t dos /dev/sda
allows you to see and alter the dos disklable.
Code:
fdisk -t gpt /dev/sda
allows you to see and alter the gpt disklable.
Code:
fdisk /dev/sda
allows you to see and alter the default disklable, for you, that's gpt.

None of those commands on their own do anything other than start fdisk.

You need to press
Code:
(m for help)
and look at the dos partition table,
toggle the bootable flag on the single partition, then write the partition table to disk.

-- edit --
Code:

$ sudo fdisk -t dos /dev/sda -l
Password:
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors  Size Id Type
/dev/sda1  *        1 3907029167 3907029167  1.8T ee GPT

Partition 1 does not start on physical sector boundary.

Notice the Boot flag.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
professor1234
n00b
n00b


Joined: 27 Mar 2005
Posts: 47
Location: Kraków, Poland

PostPosted: Wed Dec 13, 2017 8:27 pm    Post subject: Reply with quote

I works now.
Many thanks for your support.
Best Regards.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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