7

Background

I'm setting up a new build, with all new hardware, tabula rosa. I want to have multiple Linux installations and common data partitions.

From what I'e gathered so far, using new hardware and up-to-date kernels, I should be able to use rEFInd as a simple boot manager and use a fully modern boot process.

I've read Rod's general instructioms, but I need some more specific advice.

Question

Since disk partition editors tend to "helpfully" hide the EFI partition, how can I set that up on a new unformatted disk?

With gparted 0.16.1, I created a gpt type partition table. But, there's no indication that this is the case: the display looks no different than before or a legacy partion table in place. So did it do anything? The New partition command gives no options for the special EFI reserved partition, so did it do that automatically too? screenshot

Constraints and Assumptions

There is no existing OS, and no optical drives. Assume that any existing contents on the ssd should be blown away (junkware from the manufacturer or previous attempts to partition). I'm booting UBCD from a USB thumbdrive, so using gparted or other tools included in the Partion Magic image would be easiest.

Once I have a proper GPT disk with the special EFI partition, I'm comfortable using gparted etc. for addional partions, as I've done as long as there have been PC's with HDD's.

7
  • I tried gparted and found the option to create gpt, but (1) it didn't seem to do anything, and (2) I don't see any efi partition or how to make it in another step, amd (3) Mint's installer crashed, so it must not have been right.
    – JDługosz
    Commented Mar 14, 2015 at 13:23
  • I saw the italics -- but it does not make a lot of sense unless you explain why you have been unable to do this -- the easiest way to do that is to explain what you actually tried and what actually happened. Otherwise people have to guess where you're at and are disinclined to go through "Oh no I did that already", etc. Anyway, if you want to create a GPT disk, start with fdisk and use the g option. Then you create the partitions, including the EFI one. I'd leave gparted out of this if you can't get it to work.
    – goldilocks
    Commented Mar 14, 2015 at 13:34
  • Re the gparted screenshot: Primary vs. logical/extended partitions are characteristics of MBR based drives. Because the MBR table is only big enough to reference 4 primary partitions, if you want more you must make one a "logical partition" which is really just another table holding references to "extended partitions" (which are normal, but possibly not bootable). GPT drives don't have this limitation. So if you only have the choice to create primary partitions, it's likely a GPT context. The EFI partition is a normal one, just it's small, has a special label, and no filesystem.
    – goldilocks
    Commented Mar 15, 2015 at 12:32
  • I know how MBR Extended partitions work. The EFI has a predefined UUID, and doesn't care about labels. It's formatted as FAT32, not unformatted (how could it work?). Point is, no options on 'new' or anywhere else allowed entering the distinguished UUID, or reports the UUID of existing partitions.
    – JDługosz
    Commented Mar 15, 2015 at 12:42
  • Okay. I don't think you have to do anything more than ensure the partition is the right type -- and evidently FAT formatted (it could work without an fs, BTW, which is why I assumed that). Have a look here: superuser.com/questions/764799/… <- Although this person used windows in the end, if you look at the answers they are saying the purpose of the EFI partition is to hold bootloaders installed by OS's, and at least some current linux install disks will do exactly that. Since it's fat formatted, you should be able to look at it before and after...
    – goldilocks
    Commented Mar 15, 2015 at 12:51

2 Answers 2

10

Current util-linux versions of fdisk support GPT, the one I'm looking at here is fdisk from util-linux 2.24.2 (reported via fdisk -v).

Run fdisk /dev/whatever. Have a look at the options with m. Note these change depending on the state of the partition table. First check what state the disk is currently in with p. Note the Disklabel type; if it is gpt you don't have to do anything, you can delete the existing partitions and start creating your own.

If not, use the g option. This will eliminate any existing partitions because fdisk does not convert the MBR table. You can now start adding partitions with n. For the EFI partition, use t to set the type to 1, then the table should read, e.g.,

 Device    Start          End   Size Type
 /dev/sdb1   256    122096640 465.8G EFI System

Obviously that's a bit silly, but hopefully the point is clear. None of your changes take effect until you use w and exit.

9
  • Thanks for the clear answer. The fdisk on the parted magic image is 2.23.2 so the menu was a little different, but I got it created and then set to the right type. I looked again in GParted and formatted as fat32 there. GParted doesn't show anything concerning the type anywhere, and (looking again with fdisk) did not mess it up either.
    – JDługosz
    Commented Mar 15, 2015 at 9:58
  • It's especially unclear because fdisk's m help does not list everything, and is missing p and t in particular. It shows when I tested it in a VM. On the real machine, it adds a warning that GPT is experimental, and doesn't show the same options. I think the difference might be the EFI bootware? (I had to boot with BIOS in the VM since VMWare's UEFI has no fallback to legacy bootable media.
    – JDługosz
    Commented Mar 17, 2015 at 10:52
  • Hmmph. Well GPT is a pretty recent addition to fdisk, I don't know when the "experimental" warning was removed (because I remember seeing it, but then a while back noticed it wasn't there -- that could happen in one minor version 2.23 -> 2.24). The p and t options should definitely be there or something is very very wrong. That's part of the base functionality, unless maybe it thinks it cannot figure the device out at all and is refusing to mess with it. I haven't used it via VM's much, so...different issue?
    – goldilocks
    Commented Mar 17, 2015 at 14:27
  • WRT "EFI bootware" those answers on the Super User Q state pretty clearly the partition isn't actually used for firmware, just OS bootloaders -- if that's what you mean. I.e., if VMWare implements UEFI it should work without having seen the disk before (otherwise you have a chicken - egg problem). Another stupid thing that should be well documented somewhere obvious but perhaps is not. >_<
    – goldilocks
    Commented Mar 17, 2015 at 14:32
  • The VMWare 11 machine with legacy BIOS showed the full list of options. The real Supermicro X10-SAT with the same UBCD/partionMagic boot image was missing those two options at the least, and showed a warning.
    – JDługosz
    Commented Mar 17, 2015 at 18:09
1

In gparted, you have probably chosen "Device" in the menu bar and then you create a GPT partition - for the device, obviously. It is as far as I can see a device-wide assignment, and when you then create different partitions inside this device, any formats are possible, see for example an excerpt of a tutorial UEFI - Hybrid Install here (side-note: which I have used to successfully install Linux on a second SSD with Windows 10 on the main SSD):

From the Menu, select Device: Create Partition Table: gpt type (the UEFI format); Apply (note warning). From Menu, select Partition: New. Set up three partitions: #1: 2MiB (unformatted, at very bottom of drop down menu); #2: 200MiB (format fat32); #3: [remaining space] (format ext4). Apply. When complete, right-click #1 and set flag as bios-grub.. Close GParted.

As far as I remember, GPT is not mentioned again when you create these partitions inside the chosen device-wide gpt partition. The main step is just the start, to choose "Device" in the menu. After choosing GPT for the full device partition, your whole disk will be started from scratch, any sub-partitions that you had on it up to then will simply be deleted. That is a full cleaning so that everything on that device will have GPT partitioning scheme as the base.

Though that mentioned tutorial is just for an external drive (originally meant for a USB drive), in my case, this "UEFI - Hybrid Install" was the successful guide to install Linux Mint on my second SSD. I plug this SSD to the computer using an SSD-caddy that replaces the DVD drive so that I can take it out like a USB stick, at the speed of an internal SSD.

I do not see a reason why this tutorial (and also the next two GPT-only options of that same tutorial - UEFI - Unflag/Reflag Method and UEFI - rEFInd Method - should not work on a single internal SSD with no other main system installed as well. In my case, my current second SSD that has Linux is not in the least affected by the main Windows drive, it is fully separate, I can even take out the caddy and put it in another laptop or use a usb-sata3-cable to plug it in and use it as the booting drive.

Summing it up. In any case, at that point where you create a primary partition using the "Partition" menu button, the main GPT assignment has already been done. And if you want to create an EFI bootable GPT partitioned drive, the hybrid installation type that I have just done proves that this is not just achieved by a simple GPT assignment

In my hybrid case:

the BIOS boot partition is only needed for doing legacy boot on a GPT partitioned disk. If you boot with UEFI, it is not needed and will not be used.

Source: comment under the accepted answer of How do I convert my linux disk from MBR to GPT with UEFI? (a link to "Server Fault" Stack Exchange).

And that accepted answer shows in point 6 what is actually needed to "be EFI GPT": it is a rightly flagged

"EFI System" partition (ESP). Officially should be 100-500MB, but mine only used 130kB.

The first three links are just for installing Linux on an external drive. Please mind that I got to those tutorials searching for Mint on external SSD. Windows 10 on PC..

The fourth link from "Server Fault" is for converting MBR to GPT and add a BIOS boot. Also that guide is highly similar, just using gdisk instead.

Obivously, both guides give an understanding of what is needed for a propper EFI GPT configuration. I cannot guarantee that they are fully relevant for an installation on a single main drive, it just looks promising enough to link them here. Hope it helps someone!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .