This document belongs to Manual Full System Encryption (with Extras): Overview.

1. Determine what you need


If you do not understand partitioning, please first carefully read through the Partitioning topic.


You will be dealing with sizes measured in MB (megabytes) and GB (gigabytes). A GB is 1,000 times larger than a MB. So, 20GB = 20,000MB.

You'll also see the terms MiB and GiB instead of MB and GB. A GiB is 1,024 times as large as a MiB. For the purposes of this document, the difference between MB and MiB (or GB and GiB) is unimportant and so it doesn't matter which measurement you use.


Before having a look at the physical machine, you need to determine your minimum requirements for your Ubuntu system.

  • EFI System Partition (ESP): The recommended size is 550MiB (577MB), but Windows creates one only 99MB. That's OK, because we won't fill it up.

  • Boot: Ubuntu's default size is 466MiB (500MB), so we'll stick with this.
  • Root: Ubuntu recommends at least 5GB, but in practice that is far too small. At least 20GB makes a safer size, but I'd recommend at least 30Gb.
  • Swap: This is a bit more complicated. In theory, if you use hibernation, you could use up to twice your RAM. So, if you have 16GB RAM, you could use up to 32GB swap. In practice, this is unlikely. However, if you wish to use hibernation, and you might be working with huge files and systems (e.g. virtual machines, video editing and more all at the same time), be safe and choose twice your RAM.

    If you intend to never use hibernation or hybrid suspend, you can do away with swap altogether, because the latest Ubuntu versions use a swap file (explained in the Basics).

  • Data: How much data do you need for storage? This is entirely a personal choice. If you are going to store photos and videos, you will need sufficient space. If you will store only documents, you could probably get away with just a few gigabytes.

    If you don't have a separate data partition, you need to add your data requirements to your root size. So, if you need 30GB for root, and 100Gb for data, you'll need a total of 130GB for root.

Add all these figures together. If you have a separate drive for data, you can add up only the first four items and place your data on the separate drive.

In the examples that follow, data will go onto a second drive, and so we add up only the first four as follows.

ESP

99MB (because Windows made it that size)

Boot

500MB

Root

30GB = 30,000MB

Swap

8GB = 8,000MB

Total

39GB approximately; it doesn't have to be exact; but better round up than round down

  • If the EFI partition already exists, leave it alone and don't include it in the final total. If it doesn't already exist, ideally set it to 577MB (550MiB).
  • In our example, data will go on the separate drive. If you don't have a separate drive, you must add its requirements to the total.
  • If you decided not to use a swap partition (because you'll never hibernate), you can omit that part.

2. Find out what you already have

This chapter will guide you through discovering what space you already have. You will look at your system drive, which might be your only drive, and any other drives that you might have.

2.1. Windows

Press Start and type "computer management". Open the Computer Management application.

Select Storage > Disk Management. You'll see something like this (it may take several seconds to display):ComputerManagement.png

What you see in this example is the primary system disk "Disk 0", which contains four partitions and one unallocated area (i.e. without a partition). In the screenshot, it looks like only three partitions and an unallocated area, because Windows completely hides one of them, partition 3.

'Number

Size

Name

Purpose

1

450MB

Recovery

Windows uses this for recovery

2

99MB

EFI System (ESP)

Required to boot a computer with UEFI

3

16MB

MS reserved

This is hidden! You can't see it from Windows

4

23.86GB

Windows 10 (C:)

The C: drive. The name of the file system is "Windows 10"

35.59GB

An unallocated area (there is no partition here)

You can also see an unused disk, "Disk 1", which is 5GB, and the DVD drive, "CD-ROM 0".

The important bits here are partition 4 (the C: drive), size 23.86GB, and the unallocated area, size 35.59GB.

Of course, this is an example. Your actual figures will be different.

2.2. Linux

Open the Dash and type "gparted"1. Select the icon to open GPartEd (Gnome Partition Editor).

You will see something like this. gparted-Windows-only.png

What you see in this example is the primary system disk /dev/sda, which contains four partitions and one unallocated area.

'Number

Size

Name

Purpose

1

450MB

Basic data

Windows uses this for recovery

2

99MB

EFI System (ESP)

Required to boot a computer with UEFI

3

16MB

MS reserved

For Windows only to use

4

23.86GB

Basic data

The C: drive. The name of the file system is "Windows 10"

35.59GB

(No name)

An unformatted partition (i.e. it has no file system)

The important bits here are partition 4, size 23.86GB, and the unallocated area, size 35.59GB.

If you select the drop-down menu at the top right, where it says /dev/sda, you can see /dev/sdb if one exists.

Of course, this is an example. Your actual figures will be different. Your naming conventions also could be different, e.g. /dev/nvme0n1 instead of /dev/sda.

3. Decide how to partition the drive

In my example, I want to use 25GB. Fortunately for me, there is already a spare unused area of 35.59GB available on the drive, which is unused, so I'll use that.

But, your situation is almost certainly different. For example:

  • You might have a spare partition (often called the D: drive in Windows) that you haven't used. If so, you can use that partition — but check that it doesn't contain data or you will lose that data!

  • Your C: drive might fill all available space on the disk so that you have no spare space on the drive.

You will need to release space on your main drive for the system as calculated in the initial determination.

Where will the space come from:

  • Shrink your existing C: drive?
  • Shrink an existing spare partition?
  • Delete an existing spare partition?
  • A combination?

Part of your decision will be to decide if the data goes in the same partition as the system, or in a separate partition altogether. If you have sufficient space, it is entirely a personal decision.

3.1. Contiguous system space

contiguous

Space on the drive is said to be contiguous if it is unbroken. If it is split into two or more separate parts, it is not contiguous.

  • The EFI System Partition (ESP) does not have to be in any specific location.
    • If the ESP already exists, just leave it where it is.
    • If you want paranoid mode, prepare a USB stick, put the ESP on there and once installation is complete, be sure to make a clone of the USB stick (because you will be unable to boot if the original USB stick fails). This is an advanced topic, which these instructions do not support.
      Mentally-Deranged-Smiley-Face-Silhouette.png

  • The spare space for your system partition (Boot, Root and Swap) must be contiguous on your system drive.
    • If the system partition will also contain the data, it still needs to be contiguous.
  • If the data goes in a separate partition from the system, the data partition doesn't need to be contiguous with the system.
  • If you have sufficient space for the system, but it's not contiguous, refer to Support in Troubleshooting for how to ask for help. Although it is possible to move partitions using gparted, doing so can cause problems with a Windows system.

    3.2. The decision

    Before you proceed, decide where you want the following to go.

    • Your EFI partition (if it's not already there)
    • Your system partition (Boot, Root and swap)
    • Your data partition (if not included with the system)

    If you are unsure how to decide, refer to Support in Troubleshooting for how to ask for help.

    4. Release space

    If you are lucky enough to have a spare partition, you need to check that it is already empty, because any data on it will be lost! Then delete the partition.

    However, if you aren't that lucky, you will need to shrink the size of your existing partition in order to make space. If you have a data partition, you can consider shrinking it instead of the system partition.

    • Remember: if you are unsure, refer to Support in Troubleshooting for how to ask for help.

    What follows is a basic guide to shrinking and deleting partitions. If you need further detail, look up how to shrink, delete and move partitions on your favourite search engine, YouTube, or wherever else you might prefer. Beware: moving partitions can mess up your system.

    4.1. Partitioning in Windows

    You will need to have opened the Computer Management application.

    • To shrink a partition:
      • Calculate the space in MB. For example, if you need to shrink the volume by 25GB, you will shrink it by 25,000MB.
      • Right-click the selected partition and select Shrink Volume…

      • You will be given a maximum amount (in MB) by which you can shrink. If it's the C: drive partition, don't shrink it by that much, otherwise your Windows system won't have enough space to function! Leave at least 10,000MB (10GB) spare (if you can). Shrink it only by as much as you actually need to release the required system space.
    • To delete a partition:
      • Check that the partition contains no data, otherwise you will lose all data on it!

      • Check that you are selecting the correct partition, otherwise you will delete the wrong one!

      • Once you have checked, double-checked and triple-checked, right-click the partition and select Delete Volume…

    4.2. Partitioning in Linux

    You will need to have opened gparted.

    • To shrink a partition:
      • If it is a Windows partition (e.g. the C: drive), it is generally safer to use Windows itself to shrink the volume, as described in Partitioning in Windows above.

      • Calculate the space in MB. For example, if you need to shrink the volume by 25GB, you will shrink it by 25,000MB. (Gparted uses MiB instead of MB, but the difference is small enough that you needn't worry about the difference.)
      • Right-click the selected partition and select Resize/Move.

      • Adjust the sizes as required. The easiest way is to place the required size in the box Free space following (MiB) and press Tab. It will calculate the other boxes for you.

      • Check that the value is correct, and press Resize/Move.

      • Either press the green tick or choose the menu item Edit > Apply All Operations.

    • To delete a partition:
      • Check that the partition contains no data, otherwise you will lose all data on it!

      • Check that you are selecting the correct partition, otherwise you will delete the wrong one!

      • Once you have checked, double-checked and triple-checked:
        • Right-click the partition and select Delete.

        • Either press the green tick or choose the menu item Edit > Apply All Operations.

    5. Next

    Now that you have decided what space you need, and cleared it from your system drive and (if appropriate) your second drive, you are ready for installation. Return to the Overview and continue.


    1. If you are familiar with Ubuntu, you might wonder why we are using gparted instead of Disks (gnome-disks). This is because Disks doesn't have the functionality that we require later. (1)

    ManualFullSystemEncryption/OverviewPartitionPreparation (last edited 2018-08-23 17:52:26 by paddy-landau)