ubuntu luks2 install with f2fs using the live install media

Hello everybody, I thought I might share a trick I used to install ubuntu 20.04.1 to a luks2 partition that uses the f2fs filesystem that isn’t available on the installer media, also using a separate boot partition on a thumbdrive at /boot/efi using fat32 and ext2. (I did not use a keyfile or encrypt boot to keep things simple for myself)

I borrowed heavily from this page: https://howtos.davidsebek.com/debian-f2fs.html
and also a little from this page: https://help.ubuntu.com/community/Fu…ion_Howto_2019

The difference is that I did this while fresh installing, and installed the /root partition to a spare usb drive before copying the the entire /root partition to my luks2 partition using the f2fs filesystem on nvme0np1

The reason why I did this was because I wanted to use the f2fs filesystem and the installer doesn’t have that option. I also wanted to use LUKS2 with –allow-discards and –persistent as options (I wanted to enable TRIM for my nvme drive). Plus, I wanted only one /root partition the entire size of my nvme drive so wasn’t really needing lvm (no home or swap). And I wanted a usb thumbdrive that has my /boot and /boot/efi partitions on it. (I might try to add a keyfile there to skip having to enter a passphrase every time)

The only thing that doesn’t work properly is that I have to select the ubuntu usb drive on my bios boot menu using F10 every time I boot. (which I think is more about me not doing secure boot correctly? Plus, after selecting ubuntu it skips grub and goes right to the ubuntu luks passphrase page so I’m not sure what I did there?)

The ubuntu live-instasller is sda, the usb thumbdrive that I want to install my boot partition to is sdb, and the spare usb drive that I’m going to install ubuntu to is sdc, and then I copy the sdc ubuntu root install to my nvme0n1 partiton that will be a luks2 f2fs partition. I use “sudo -i” for root.

I added universe to the ubuntu repositories and installed f2fs-tools

gparted to make usb thumbdrive with 2 partitions, one is /boot/efi using FAT32 and esp boot flags, and the other is /boot using ext2 for the remaining space of the usb thumbdrive.

gparted to format the second usb thunmbdrive (sdc) to use ext4

I used the installer now to install ubuntu to both of my usb thumbdrives.

Once the installer was done I chose “Continue Testing” button.

gparted to make an unformatted partition on nvme0n1 that will be formatted and then opened up with crytsetup and then given the f2fs filesystem using mkfs.f2fs command.

(part 2 next)


Leave a Comment