Preparing Fedora 26 laptop with ZFS and encryption — partitions (part 2)

Andrzej Rehmann
5 min readAug 2, 2017

--

Fedora 26 in all its beauty

On my Dell 3470 in order to boot from the bootable pendrive (with Fedora 26 ISO image) I have to press F12 when the laptop is booting up. Then when the boot menu shows up select the inserted pendrive.

Inserted bootable pendrive with Fedora 26
Press F12 (it depends on the laptop) when laptop is booting up and select the inserted pendrive (I’m using UEFI BOOT).
Click on the “Try Fedora” and the OS will be booted from RAM memory.
  • Try Fedora will load and boot the OS from RAM memory.
  • Install to Hard Drive will open an interactive wizard which can quickly format our disk and install Fedora.

We want to create our own partitions and use cgcrypt to encrypt them so select Try Fedora to boot OS from RAM which will leave the hard drive untouched.

When Fedora loads press the Win (super) key and open terminal by typing terminal.

By default Fedora comes with GNOME desktop environment, you can access the Activities view by hovering your mouse to the upper left corner of the screen or pressing Win key.

Press Win key to access the Activities view.

We want to create four partitions on our hard drive and for that we will need to have root permissions. Type su - to change to root user.

To change to root user you can type sudo -i or shorter su -.

Type lsblk to see what hard drives and pendrives your laptop sees.

We will use cgdisk which is a partition table manipulator. cgdisk /dev/sda needs as a parameter the name of the drive — my laptop has only one SSD drive and by default the primary drive is called sda (we explained that in part 1). I already have my drive partitioned but I will erase and create same partitions again.

I’m gonna remove my partitions now.

Removing partitions so we have a clean disk.
Clean disk with no partitions.

We will create new partitions based on this image (for 256GB SSD drive).

Partitions table for a 256G SSD drive.
Type size 256M for our first EFI partition
Use EF00 (E-F-zero-zero) as partition type which is a code for EFI.

Partition types (but not all of them) can be seen by typing l (that’s small L) instead of the partition code and hitting enter, you would see a list like the one below. EF00 is EFI System.

Table list of some of the partition types.

Leave the partition name blank (press enter) and we should have our first partitions created.

New EFI partition is created.

Now select the lowest free space to start creating new partition from there, after the previously created EFI System partition.

Type 1024 as partition size.
Type 8300 as partition code.
Linux 1024M partition created

Create the third partition with 20G size and 8304 partition code.

Create fourth partition which will end 9M from the end of the disk. So instead of providing a size (which would be about 217.1G in my case) we want the partition to end 9M from the end. To do that type -9M when asked for the partition size. Partition code is BF01 which stands for ZFS.

Instead of typing partition type use “-9M” to indicate that the partition should end 9M from the disk end.
BF01 stands for ZFS
ZFS partition is created
Last partition is created so we can now write all partitions to disk.

After you create ZFS partition select [ Write ] which will write all partitions to disk permanently. Then exit with [ Quit ].

Confirm partitions were created on /dev/sda disk by typing lsblk.

Four partitions were written to sda disk.

This concludes this episode. We have now four partition and can now encrypt two of them in part 3.

Special thanks to Marcin Skarbek for setting up my laptop and explaining all of this stuff to me with excruciating details.

--

--