Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UEFI vs BIOS partitioning configuration
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
mtangy
n00b
n00b


Joined: 08 Dec 2016
Posts: 10

PostPosted: Wed Feb 01, 2017 8:13 pm    Post subject: UEFI vs BIOS partitioning configuration Reply with quote

I am trying to install via LiveDVD on my old HP DV6 2066dx laptop. I'm fairly certain it does not use UEFI since the system settings say it has BIOS v. F.08. The handbook makes it seem like boot partition "boot" flag should only be set if your system using UEFI, however the screenshot makes it seem otherwise. Does anyone know if the boot flag should be set if your system uses a BIOS? My boot table in parted looks as follows:

Number Start End Size File system Name Flags
1 1.00MiB 3.00MiB 2.00MiB grub bios_grub
2 3.00MiB 131MiB 128MiB boot
3 131MiB 643MiB 512MiB swap
4 643MiB 20479MiB 19836MiB rootfs

after executing "set 2 boot on" (which I am uncertain if its necessary for me) my partition looks like this:

Number Start End Size File system Name Flags
1 1.00MiB 3.00MiB 2.00MiB grub bios_grub
2 3.00MiB 131MiB 128MiB boot boot, esp
3 131MiB 643MiB 512MiB swap
4 643MiB 20479MiB 19836MiB rootfs

Does anyone know which of the two is correct for a system that contains a BIOS? The handbook says it should look like this which I don't believe is an option for me:

" The end result looks like so:

(parted)print
Model: Virtio Block Device (virtblk)
Disk /dev/sda: 20480MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1.00MiB 3.00MiB 2.00MiB grub bios_grub
2 3.00MiB 131MiB 128MiB boot boot
3 131MiB 643MiB 512MiB swap
4 643MiB 20479MiB 19836MiB rootfs "

Any input would be much appreciated

thanks
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Feb 01, 2017 8:32 pm    Post subject: Reply with quote

mtangy,

The boot flag is something to keep the BIOS happy. Linux does not care.

A trap for the unwary mixing BIOS and GPT, is that GPT creates a fake MSDOS partition table too.
It contains a single entry describing as much space as it can, with type 0xee.
The 0xee tells that GPT is in use and that this partition table is a fake.

However, the BIOS can only see the fake MSDOS partition table, so if you need the boot flag set, you must set it here, not in the real GPT partition table.

Try to boot without it, if the flag is needed, the BIOS will say something like Operating System Not Found or no Bootable Disk Found.
Boot the install media and add the boot flag to the MSDOS partition table.
Code:
fdisk -t dos /dev/sd...
from memory.
Ignore the dire warnings about GPT being 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
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1655
Location: United Kingdom

PostPosted: Wed Feb 01, 2017 10:06 pm    Post subject: Reply with quote

mtangy,

For a GPT HDD with a machine using PC BIOS you don't need to set the boot flag. For example, the following partitioning scheme (one of many possible schemes):

1 MiB of unpartitioned space before /dev/sda1.
/dev/sda1 unformatted 1 MiB partition, Code EF02, with the bios_grub flag set.
/dev/sda2 ext2 partition, Code 8300, boot flag not set, which will contain /boot.
/dev/sda3 ext4 partition, Code 8300, which will contain / (root).
/dev/sda4 ext4 partition, Code 8300, which will contain /home.
/dev/sda5 linuxswap partition, Code 8200.

results in the following bootable installation:

Code:
# fdisk -l /dev/sda
Disk /dev/sda: 36 GiB, 38654705664 bytes, 75497472 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: E1A118BD-3C8D-4331-8C2F-BCBA4B16A660

Device        Start      End  Sectors  Size Type
/dev/sda1      2048     4095     2048    1M BIOS boot
/dev/sda2      4096  1052671  1048576  512M Linux filesystem
/dev/sda3   1052672 42995711 41943040   20G Linux filesystem
/dev/sda4  42995712 63967231 20971520   10G Linux filesystem
/dev/sda5  63967232 75495423 11528192  5.5G Linux swap

# gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 75497472 sectors, 36.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): E1A118BD-3C8D-4331-8C2F-BCBA4B16A660
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 75497438
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095   1024.0 KiB  EF02
   2            4096         1052671   512.0 MiB   8300  /boot
   3         1052672        42995711   20.0 GiB    8300  /
   4        42995712        63967231   10.0 GiB    8300  /home
   5        63967232        75495423   5.5 GiB     8200

# blkid
/dev/sda3: UUID="8cbac366-2794-45ca-b92e-bbbf3a34ca3e" TYPE="ext4" PARTLABEL="/" PARTUUID="46a5fd0f-abdb-4e58-aa1c-f6b997f3839c"
/dev/sda1: PARTUUID="9108be00-67b5-4fad-9eaa-71581abc36af"
/dev/sda2: UUID="9484d7f2-906e-4e31-9899-6ef157695c98" TYPE="ext2" PARTLABEL="/boot" PARTUUID="c4ebecfa-a41a-4d72-b3ce-83af81a426cb"
/dev/sda4: UUID="00c19787-8955-40d7-bb64-9e3f51c9cd5a" TYPE="ext4" PARTLABEL="/home" PARTUUID="b485acef-3161-48ca-a39d-bcc3cab33e59"
/dev/sda5: UUID="91b61f58-4af5-4e28-aa6d-30f91c107c6c" TYPE="swap" PARTUUID="e9ac2da5-984c-4c22-bd51-a744d4e3a9f0"

_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
mtangy
n00b
n00b


Joined: 08 Dec 2016
Posts: 10

PostPosted: Wed Feb 01, 2017 10:29 pm    Post subject: Reply with quote

NeddySeagoon wrote:
mtangy,

The boot flag is something to keep the BIOS happy. Linux does not care.

A trap for the unwary mixing BIOS and GPT, is that GPT creates a fake MSDOS partition table too.
It contains a single entry describing as much space as it can, with type 0xee.
The 0xee tells that GPT is in use and that this partition table is a fake.

However, the BIOS can only see the fake MSDOS partition table, so if you need the boot flag set, you must set it here, not in the real GPT partition table.

Try to boot without it, if the flag is needed, the BIOS will say something like Operating System Not Found or no Bootable Disk Found.
Boot the install media and add the boot flag to the MSDOS partition table.
Code:
fdisk -t dos /dev/sd...
from memory.
Ignore the dire warnings about GPT being in use.


Thanks! If needed should I add that boot flag to the BIOS boot partition (/dev/sda1-using the default partitioning scheme) or the Boot/EFI system partition (/dev/sda2)?

Also, I added ext3 file system to the BIOS boot partition and then realized that the default partitioning scheme doesn't specify any file system for that partition. Do you know if this will cause issue on boot-up?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Feb 01, 2017 10:39 pm    Post subject: Reply with quote

mtangy,

Neither. The BIOS cannot read the GPT partition table.
You must set it on the only partition in the MSDOS Partiton table.

From a server of mine that mixes BIOS and GPT.
The actual used partition table .. its GPT
Code:
fdisk -l /dev/sda
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: gpt
Disk identifier: AC420C5F-F4BE-47A9-9CD4-F56645A1D63E

Device        Start        End    Sectors  Size Type
/dev/sda1      2048      63487      61440   30M Linux filesystem
/dev/sda2     63488   16001023   15937536  7.6G Linux filesystem
/dev/sda3  16001024 3907028991 3891027968  1.8T Linux filesystem


The fake MSDOS partition table from the same drive
Code:
fdisk -l -t dos /dev/sda
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

Notice that it has the bootable flag set and its type ee, which means that the real partition table is the GPT one.
The BIOS can only read the fake MSDOS partition table.
_________________
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
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