28

My computer has UEFI based BIOS and I want to start over from scratch.

The PC came with Windows installed - I later installed Ubuntu alongside.

I want to completely re-build my whole disk and install only Ubuntu on it.

So it is not about how to install Ubuntu, it is about how to prepare a disk.

What is the most professional way and which tasks will I have to perform?

6
  • I assume you have gone through askubuntu.com/q/221835/158442? I'd say the simplest way is: enable legacy (BIOS) booting in UEFI, then install Ubuntu choosing the use entire disk option.
    – muru
    Mar 7, 2016 at 15:06
  • You should have added an answer to that Q then. This has already been asked: askubuntu.com/questions/420272/…
    – muru
    Mar 7, 2016 at 15:12
  • 7
    Muru, if you want to boot in EFI/UEFI mode, enabling the Compatibility Support Module (CSM; aka "legacy boot support" or a similar phrase) is something you should almost certainly NOT do. See here for details on why this is the case. Two or three times a week, I answer questions from people who've bungled their installations because they've activated their CSMs.
    – Rod Smith
    Mar 7, 2016 at 17:24
  • @RodSmith see the original question. If I were wiping Windows and starting from scratch and looking for the simplest way, I wouldn't bother with UEFI at all. In fact, using CSM is exactly what I do when I don't want to bother about anything else. No need for this special partitioning and ESP and whatnot.
    – muru
    Mar 7, 2016 at 21:02
  • 3
    Muru, modern computers use EFI (or UEFI, which is EFI 2.x), so you can't avoid it. At best, you add complexity by enabling the CSM. Granted, the native EFI method of booting is different and unfamiliar to long-time BIOS users, but it's no harder once you understand it. If you understand neither BIOS nor EFI, you might as well learn EFI, since BIOS is a dead-end technology.
    – Rod Smith
    Mar 8, 2016 at 14:13

2 Answers 2

22

The most convenient and reliable way to prepare a disk is using the GNOME partition editor. GParted is included in the Ubuntu installation media, but in some cases it is better to use the original. When you boot from the Ubuntu install media and you already have a swap partition,
the partition is mounted. Partition swapoff and unmount unfortunately does not always work.


Use GParted from the Ubuntu installation media ... in case it does not work you can
download GParted from the project website and create a bootable DVD/USB media.

Boot from GParted Live media, once on the desktop GParted opens automatically.
Choose the disk you want to work on from the application menu on the top right.

Click on DeviceCreate Partition Table → Select gpt → Click Apply

Click on PartitionCreate new Partition:
New size: about 500 MB - File system: fat32

Click on PartitionCreate new Partition:
New size: amount of RAM - File system: linux-swap

Click on PartitionCreate new Partition:
New size: minimum 20 GB - File system: ext4

Optionally create more partitions:

Click on PartitionCreate new Partition:
New size: arbitrary - File system: arbitrary

These partitions can be used to store the personal data that are separated from the system. Use ext4 when Ubuntu or other Unix/Linux based systems are the only systems that need to access them. When you want to make the data accessible to Windows as well, choose ntfs or fat32.

Click on Apply after checking that everything is correct, wait until GParted completed the tasks.

Right-click the fat32 partition → Manage flags → Select boot and esp.

Now close GParted, shut down the computer, remove the GParted Live media.

Boot from Ubuntu installation media and select Try Ubuntu without installing.
On the desktop click Install Ubuntu and when asked, choose 'Something else'.

Select the ext4 partition you have created with GParted for Ubuntu before.
Select / as mount point and ext4 as file system ... start the installation.


Presentation : How to set up a disk and create new partitions with GParted

Example : Prepare the disk for the installation using an Ubuntu Live media

Additional information concerning swap : Community Help Wiki SwapFAQ


Note:

Doing it this way has one big advantage: You decide yourself about the whole partition layout and can prepare everything for eventual changes being made in the future. The partition sizes are suggestions, users of course shall choose them fitting to their needs. What first looks a bit complicated, is, once you have understood the systematic behind it and done it one time, easy.

3
  • 3
    To summarise this overly-long answer: UEFI requires a FAT32-formatted partition with the boot flag activated.
    – muru
    Mar 7, 2016 at 16:20
  • This is way over-complicated. The installer can do it all automatically.
    – nobody
    Mar 8, 2016 at 3:13
  • 2
    I think the complexity of this answer is spot on, as this whole Grub EFI package bug is a PITA (as it helps to have details). For learning about how these things work, this level of complicated-ness is helpful. However, all that said, this answer might be a bit slim after the formatting steps. I found myself wondering whether I should reformat the ext4 partition when installing the OS (eg, whether to check the box when setting the mount point). If you don't (which is the right answer), the startup disk warns/asks questions about existing file systems, overwriting data. Sep 19, 2018 at 19:55
8

You can do everything from inside the Ubuntu installer. The minimum effort option is to select one of the "Use whole disk" variants, which should already do the right thing.

If you want to customize the partition layout, you can use the partition editor inside the installation tool as well, the only important bit is that you need to keep one FAT partition for the EFI binaries. This can be fairly small, since all that really needs to fit is three kernels (backup and running, and enough space to install updates), but unless space is really tight, 256 to 512 MB is a good value.

Last but not least: Ubuntu can only install an EFI bootloader if the system was booted in EFI mode, because the BIOS compatibility layer does not allow access to the boot menu, so the bootloader cannot be registered.

You must log in to answer this question.

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