Friday, March 2, 2012

no bootable device - gpt

Some legacy BIOS's may have an issue with a GPT partitioned drive.


Ran across this recently with an Intel D975XBX board. I GPT partitioned a drive with gdisk, installed Ubuntu and when I rebooted after the install completed with surprised to see "No Bootable Device..." displayed.



The fix is this case was to mark the partition bootable using fdisk - it seems that the BIOS will complain as above unless it sees such a partition.

In this case wasn't large enough to mandate using GPT, it was just a preference.

================================================
# gdisk /dev/sda

GPT fdisk (gdisk) version 0.8.1

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

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): A3664325-EFDC-458D-96E9-059556C452EB
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1574911   768.0 MiB   8300  Linux filesystem
   2         1574912         9963519   4.0 GiB     8200  Linux swap
   3         9963520        72878079   30.0 GiB    0700  Linux filesystem
   4        72878080       625142414   263.3 GiB   0700  Linux filesystem
================================================

Fdisk will surely complain as it doesn't support GPT partitioned drives:
================================================

# fdisk /dev/sda

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Command (m for help): p


Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1   625142447   312571223+  ee  GPT
================================================

And notice that in this case it only shows 1 partition.
However if we go ahead and enable the boot flag:
================================================

Command (m for help): a
Partition number (1-4):  1
Command (m for help): w
================================================
All is fine and even though the gdisk output will not look any different the system will boot.

Note that I made this change this after the system was already installed (booted from the same systemrescuecd flash drive that I used to partition the drive) - there was no need to reinstall.

1 comment:

Note: Only a member of this blog may post a comment.