Skip to content

hazelshantz/Linux-Mint-BTRFS-install-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Linux-Mint-BTRFS-install-tutorial

A tutorial explaining the process of installing Linux Mint 22.x/LMDE6/7 with BTRFS

This tutorial is hosted on https://github.com/orgs/linuxmint/discussions/549

I cloned it to have a backup of it on my account.

On this guide, I'll teach you how to clean install mint 22.x/LMDE6+ with BTRFS snapshots. that way, you can rollback in case anything goes wrong, and the best thing, is that snapshots can be accessed from GRUB.

Important Note (updated 2025/06): this tutorial was written with UEFI systems in mind. if you are using a legacy BIOS system, please reffer to the comments down below.

Disclaimer: I expect that at this point, you have created a bootable USB with Ventoy in GPT mode with secure boot support and placed mint 21.3 or 22 ISO on it. If you haven't, get Ventoy here: https://github.com/ventoy/Ventoy

For the case of installing without secure boot, disable secure boot (as some GPUs like nvidia, or some wifi cards have issues with it), fast boot, legacy CSM boot mode and TPM. If you're installing with secure boot enabled, skip to the right part of this guide.

In theory, this guide should also work with LMDE. further research is required. ======> Update: after further testing, this guide also works with LMDE, following the same steps.

you may like to enable the BTRFS daemon to auto-update grub after making snapshots with timeshift. here's the explanation: https://github.com/Antynea/grub-btrfs?tab=readme-ov-file#grub-btrfsd-systemd-instructions

Part 1: Installation.

Installation with secure boot disabled, single boot method:

I'll be using a VM for this guide.

To begin, boot into mint live session. I assume that you know your hardware, and the target drive where to install Mint. once on mint desktop, connect to the internet, then open gparted from mint menu, located on the bottom left of your screen.

with Gparted opened, you'll face this window. from there, choose the right drive to use for mint. on this case, /dev/nvmen0n1. Sometimes, it may show as /dev/sdX where X is any letter, like a b c etc. Just be sure to target the right drive for mint, like on the following shot.

VirtualBox_Linux Mint_27_07_2024_01_01_48

for this case, the drive is empty. I assume yours may be with data. regardless, we have to wipe and partition the drive.

Warning! Backup your data before proceeding! this will wipe and delete all your data! You've been warned. the Mint devs, team nor me, take responsibility for any data loss if you don't backup.

To initialize/partition the drive, go to the Device menu, and select create partition table like this:

VirtualBox_Linux Mint_27_07_2024_01_07_45

a new window will come up, asking for partition style. by default, it will select msdos (aka MBR). since we are using a modern system, we will use GPT. Do notice Gparted warning, if you haven't backed up your data!! VirtualBox_Linux Mint_27_07_2024_01_10_44

then, once you select GPT, hit Apply button, and Gparted will proceed to wipe/initialize the drive. it should take some seconds, depending of your hardware.

once done, gparted will show an empty drive. we begin to partition. VirtualBox_Linux Mint_27_07_2024_01_12_09

to create a partition, hit the + button, just like on the following shot: VirtualBox_Linux Mint_27_07_2024_01_12_57

it will show a dialog, on it, we proceed to create a new ESP (EFI system partition), required to boot mint. configure it as following: VirtualBox_Linux Mint_27_07_2024_01_16_28

once ready, hit add. it will look like this: VirtualBox_Linux Mint_27_07_2024_01_17_34

Now, we must create the BTRFS root partition, that will contain Mint and your userdata. create a new partition like before, with the following settings:

VirtualBox_Linux Mint_27_07_2024_01_18_46

Once again, hit Add. it will look like this: VirtualBox_Linux Mint_27_07_2024_01_19_22

if you're wondering, there's no need for a swap partition, as Mint installer takes care of that later. also, you can use a swap file to enable hibernation if needed + zram.

once ready, hit the checkmark button like this: VirtualBox_Linux Mint_27_07_2024_01_20_46

Gparted will ask if you're sure to proceed like this:

VirtualBox_Linux Mint_27_07_2024_01_21_28

confirm, and Gparted will begin to partition. it will take some time, depending on your specs.

once done, it will show this dialog. VirtualBox_Linux Mint_27_07_2024_01_22_21

close it, and you'll get this:

VirtualBox_Linux Mint_27_07_2024_01_23_04

now, we need to set the flags for the ESP. right click the ESP and add the boot flag like this:

VirtualBox_Linux Mint_27_07_2024_01_24_16 VirtualBox_Linux Mint_27_07_2024_01_24_34 VirtualBox_Linux Mint_27_07_2024_01_24_45

then you'll be back on Gparted. now you can exit it as we are done with this part. now we proceed to install Mint. open the installer from the desktop and do the following, adapting it to your needs: VirtualBox_Linux Mint_27_07_2024_01_28_14 VirtualBox_Linux Mint_27_07_2024_01_28_53

Once you reach this part of the installer, select "Something else" to setup the partitions. VirtualBox_Linux Mint_27_07_2024_01_30_00

you will find yourself with this screen.

VirtualBox_Linux Mint_27_07_2024_01_32_06

select the ESP partition, hit the change button and setup it like this: VirtualBox_Linux Mint_27_07_2024_01_33_40

then, select the BTRFS partition, and configure it like this:

VirtualBox_Linux Mint_27_07_2024_01_34_00 VirtualBox_Linux Mint_27_07_2024_01_34_09 VirtualBox_Linux Mint_27_07_2024_01_34_18

once done, install the bootloader to the ESP partition, like on this shot:

VirtualBox_Linux Mint_27_07_2024_01_34_51

we are done partitioning, once you hit install now button, Mint will warn about the changes, and if you're sure to proceed. confirm the changes by pressing continue.

VirtualBox_Linux Mint_27_07_2024_01_39_58

then, select your timezone:

VirtualBox_Linux Mint_27_07_2024_01_41_22

then, setup an user to your needs. you can choose here if you want to auto login, or, to be asked for your password at boot. personally, I recommend "ask for my password at boot" for security reasons, unless you have reasons to auto login.

VirtualBox_Linux Mint_27_07_2024_01_42_52

for more security, you can encrypt your home folder. for the sake of simplicity on this guide, I won't do it. you can research deeper later on your own, or, research then encrypt it now on this step.

once ready, hit continue, the installer will proceed to install Mint.

VirtualBox_Linux Mint_27_07_2024_01_49_29

Depending of your hardware, the time it will take to install. meanwhile, go for some snacks and mint tea :) once it's done, the installer will show this:

VirtualBox_Linux Mint_27_07_2024_02_33_37

we reboot to the new installed system. remove your flash drive when asked.

Part 2: setting up Timeshift and GRUB snapshots.

once booted into the fresh installed mint, we have to setup Timeshift. select BTRFS:

VirtualBox_Linux Mint_27_07_2024_02_42_29

then select the drive where mint is installed.

VirtualBox_Linux Mint_27_07_2024_02_42_38

now select the frequency of snapshots, I recommend monthly automatic snapshots, but you can also do weekly ones.

VirtualBox_Linux Mint_27_07_2024_02_42_48

optionally, you can include your home subvolume/home folder on the snapshots.

VirtualBox_Linux Mint_27_07_2024_02_43_01

once done, hit finish.

VirtualBox_Linux Mint_27_07_2024_02_43_10

now hit create, to create a snapshot. it will take a second.

VirtualBox_Linux Mint_27_07_2024_02_43_26

it will look like this. you can exit Timeshift now.

VirtualBox_Linux Mint_27_07_2024_03_04_00

Part 3: Setting up snapshots to show up on GRUB.

To make grub show the snapshots, we need an extra package from a github repo, as it's not available on mint repos with APT. for such, we browse to this repo:

https://github.com/Antynea/grub-btrfs

then, we get the latest package from the releases.

image

we download the tar.gz code.

image

Once downloaded, we extract it to a folder and open it. it will look like this:

VirtualBox_Linux Mint_27_07_2024_03_12_34

then, right click on an empty area of the folder, and open a terminal like this:

VirtualBox_Linux Mint_27_07_2024_03_12_44

VirtualBox_Linux Mint_27_07_2024_03_13_12

then, run ls to show the files of the folder in terminal.

VirtualBox_Linux Mint_27_07_2024_03_13_19

Now, we proceed to install it. for that, we run:

sudo apt install gawk && sudo make install Enter your sudo password to proceed. it will pull the dependencies then begin to build and install like this:

VirtualBox_Linux Mint_27_07_2024_03_18_14 VirtualBox_Linux Mint_27_07_2024_03_18_32

it will automatically detect your snapshots and add them to GRUB. once done, run sudo update-grub. after that, you can exit terminal. now, time to check GRUB.

VirtualBox_Linux Mint_27_07_2024_03_21_48

when booting, you'll be greeted by grub. your snapshots should show up like this:

VirtualBox_Linux Mint_27_07_2024_03_24_52

you can notice the snapshots menu entry.

VirtualBox_Linux Mint_27_07_2024_03_31_03

Congratulations! You finished setting up BTRFS.

Now, just make as many snapshots you need, then update grub with sudo update-grub and they will show at boot. to rollback, just hit enter on the snapshot on your GRUB menu and it will rollback.

If your system updates, or you update the kernel, it may trigger sudo update-grub, and therefore, add your newer snapshots to GRUB.

Installation with secure boot disabled, dual boot method, single drive:

Most of this method is similar to the last one, but with some tweaks. I recommend shrinking your Windows main partition from within Windows with either disk management or a 3rd party tool for Windows, then leave unallocated space after it. it should look like this:

VirtualBox_LSW_28_07_2024_03_06_38

then, just like on the previous method, we make the ESP and BTRFS partitions for mint like this:

VirtualBox_LSW_28_07_2024_03_07_08 VirtualBox_LSW_28_07_2024_03_07_19 VirtualBox_LSW_28_07_2024_03_07_43 VirtualBox_LSW_28_07_2024_03_09_35 VirtualBox_LSW_28_07_2024_03_08_51 VirtualBox_LSW_28_07_2024_03_09_51 VirtualBox_LSW_28_07_2024_03_09_01 VirtualBox_LSW_28_07_2024_03_10_07 VirtualBox_LSW_28_07_2024_03_54_31 VirtualBox_LSW_28_07_2024_03_54_36 VirtualBox_LSW_28_07_2024_03_54_45

Then, we proceed to prepare the partitions with Mint Installer like on the previous method:

VirtualBox_LSW_28_07_2024_04_04_44 VirtualBox_LSW_28_07_2024_04_06_34 VirtualBox_LSW_28_07_2024_04_06_48 VirtualBox_LSW_28_07_2024_04_06_53 VirtualBox_LSW_28_07_2024_04_07_25 VirtualBox_LSW_28_07_2024_04_07_12 VirtualBox_LSW_28_07_2024_04_07_37 VirtualBox_LSW_28_07_2024_04_07_17 VirtualBox_LSW_28_07_2024_04_08_20 VirtualBox_LSW_28_07_2024_04_10_18

From here, the installation process is the same as before

Once mint is installed, reboot like on the previous method and proceed to setup Timeshift and GRUB snapshots the same way. the only difference is that GRUB will detect your Windows partition and add it to the list.

Important note: by making a separated ESP, you avoid Windows from nuking it after an update.

for best results, install a dual boot on dedicated drives.

For some reason, Mint will use your Windows ESP for itself, even if you make a dedicated one. I'm still researching why it does that, but it's the big reason to use a dedicated drive for mint to dual boot.

Installation with secure boot disabled, dual boot method, dedicated drives:

Same as last method, but instead of shrinking and partitioning on same drive, you target a dedicated drive, and use 1st installation method as reference, then repeat the setup.

Installation with secure boot enabled, single boot:

Same method as with secure boot disabled and single boot, but at some point you'll encounter this:

VirtualBox_Mint_28_07_2024_22_46_28

where you'll need to enter a password for secure boot.

The rest of the process is the same as before, regarding partitioning:

VirtualBox_Mint_28_07_2024_22_49_15

Then you just complete the setup and installation of the GRUB btrfs snapshots and timeshift after a reboot.

Installation with secure boot enabled, dual boot method, dedicated drives:

It should be same as with single boot, but this time, you target the drive that will contain Mint, while keeping your Windows drive attached. Mint GRUB should add Windows to it's menu at reboot. Then you proceed to setup Timeshift and GRUB snapshots.


this guide will be updated constantly to cover most users use case.

Note: If I forget an user case, lemme know in the comments.

Footnotes:

- Why I'm writing this guide?

On my time on the Linux Mint community, I came across countless broken Mint installs because the users installed another desktop like GNOME or KDE Plasma which are not supported, then wanted to remove it, and that lead to a broken system, frankenmint, dependency hell or TTY-only systems, some times, unable to recover even with rsync timeshift. So, I began to research the posibility of using BTRFS with mint, as I've already experimented with it on Arch Linux, and so far, it has worked like a charm. now considering the nature of mint as a stable distro, this should come handy for several users, so they can recover easily, due to the snapshots features of BTRFS.

  • How you can contribute? By testing and giving feedback, so this guide can be updated and improved.

- Important Note:

Your GRUB will not look the same as mine, but a black screen with white text by default. if you're curious, I used a GRUB theme on the VM, for the sake of making it more legible and pleasant to the eyes.

- Personal Opinion.

For the future, I would like Mint team to consider using BTRFS as default, or like how EndeavourOS team does, asking the user if they want the classic and traditional ext4, or BTRFS for their installation.


Aknowledgements:

Mint team, for creating such a wonderful distro, making Linux easier to use.

Linux Mint Community, for being wholesome and main inspiration for writing this.

Antynea, for making grub-btrfs, without it, this would be incomplete.

Coopydood, for making the awesome Hyperfluent GRUB theme: https://github.com/Coopydood/HyperFluent-GRUB-Theme

Releases

No releases published

Packages

No packages published