Site Tools


Table of Contents

Overview: Having fun on Debian (or Ubuntu) will mean we are installing Testing Branch (or Ubuntu+1) so we get the latest most awesome software while using BTRFS. To accommodate security deficiencies in Testing we will be using a containerized version of Firefox as the default browser (and using chromium as a secondary browser for occasional emergency use). Snap security is very good, excellent even, and as the web is the main point of entry for malicious things for your install, this should be considered to prevent any issues (please dont complain you dont like snap, make your own arrangement in that case). By default Debian comes with the .deb version of Firefox ESR which is excellent but if there is a security bug in the testing branch there can be a delay before a patch arrives. In addition we will also secure a firewall on the local install (see later on in the guide). For Ubuntu we will change the current release of Firefox snap to the ESR version using the refresh command in snapd. Once web is secure and a firewall is on you should be good to go so long as you don't ever run commands you saw on the internet you didn't understand, or that came outside of the official repositories. Dont make the mistake of adding repositories from 3rd parties, these can be very risky and in most cases you can use a different method, like flatpak,snap build from source etc.

Should you choose Debian or Ubuntu? Its up to you, Debian will offer a more streamlined OS with minimal packages for expert users who don't mind doing everything manually when things don't work out the box. For example, no proprietary drivers will come with the install [a secret non free image does exist for Debian however], so if you have an Intel wifi card don't expect it to 'just work'. It will need to be fixed afterwards. This can be inconvenient if you have no way of connecting to the internet easily (eg: via a cable temporarily). Ubuntu however will come with most things working right out of the box. This is great but also means your OS is more generalized and contains extra services and daemons you might otherwise not use. Its kind of like buying a prebuilt PC vs custom making your own PC with all the individual parts. One works right away, the other can disappoint you when you bend all the pins on your CPU and don't know how to recover. But on the other hand you get something that is setup just for you in the end. No choice is wrong, but your expectation should align with your choice. In a perfect world one could remove bits of Ubuntu until it was exactly like Debian, or add bits to Debian until it was identical to Ubuntu, but as there are salient differences in the packages maintained in the repositories this is not 100% possible even if you can get very close, there will always be some differences between the installations. This should be born in mind when choosing as you may wish to do a specific task that is more suited to one or the other. Gaming on Ubuntu generally has less problems and is more bleeding edge with drivers if that is a priority. However as you will find, both can complete all tasks adequately regardless of the choice. You can play Apex legends just fine no matter what you choose, just not as out the box on Debian.


Because we are incredibly cool, we will not be writing an ISO to a USB stick every time we want to install a different OS using dd or some other old school option. That's inefficient. We are super efficient and super advanced. Instead we will be copying and pasting ISO images onto a premade Ventoy stick that lets you choose from a menu what to boot and install. Lets learn how to do this.

Instructions assume a Linux type OS is installing Ventoy. Windows users might have to google a guide or something. I did see some windows downloads on Ventoys page so probably you can do it somehow.

All data on the USB stick will obviously be lost so make sure you use one you have spare that does not contain files you need.

Step 1: Get a USB (big enough for several iso images) stick that can be formatted and delete all partitions on it. I use Gparted to do this (I make a GPT partition table under Device-Create Partition Table to blank it). Also note the device the USB stick is accessed by (in my example /dev/sdc):

gparted showing usb disk is blank and unformatted.

Step 2: Download ventoys linux.tar.gz file from here:

Step 3: Extract the files to a location and open a terminal to that location. Eg: I have extracted the files to ~/Downloads/ventoy-1.0.71/ at the time of writing this guide. I did this using a GUI app to extract the zipped tar.gz file I downloaded. Any modern distro will be able to open the downloaded file and extract it easily.

Step 4: Drop to terminal and cd to the directory with the extracted files.

 cd ~/Downloads/ventoy-1.0.71/ 

Next we will run the install script:

 sudo ./ -g -i /dev/xxx 

Note that the /dev/xxx matches the device we saw in gparted, as this device will be blanked and wiped. In my case I used “sudo ./ -g -i /dev/sdc” as the command which makes sense when you look at the gparted screenshot.

After reviewing and confirming with Ventoy you wish to proceed by pressing 'y' you will have a Ventoy disk with no ISO images on it.

Example output:

We can now add any ISO images we want to boot from to the USB. Make sure you closed GParted and sometimes you have to unplug and replug the USB but if successful you should see a VENTOY location in your file browser that you can access (and is empty). See next screenshot where I have added 2 ISO's if unsure what you are looking for in step 5.

Step 5: Add some ISO's to the VENTOY usb partition. For todays example we will download AMD64 ubuntu+1 and Debian 11. Download daily for ubuntu here: (currently JammyJellyfish)

Download Small CD AMD64 ISO for Debian here:

The small cd installer for Debian is the best unless you have some other requirements. If you need the super secret proprietary driver cd its hidden here but dont tell anyone. Dont use that cringe version unless you need to because you have an annoying wifi driver and you are stuck without any internet or something.

Once we have downloaded the ISO images simply copy or cut and paste them onto the VENTOY usb partition. You will end up with something like this:

We can now boot from this UBS stick and choose out of the ISO images you copy on what to boot up from. So you can add as many ISO's that you can fit onto the USB stick and carry around with you all sorts of install CD's. Windows 11 ISO's/Debian/Ubuntu/Arch/Kali whatever you want. Just copy them on and you are good to boot. Dont forget to always pull out safely. You want to eject the USB from the OS first so you dont corrupt any of the ISO images.

Step 6: Testing the USB boot.

We are now ready to test the USB stick we just created works. On your Computer just ensure UEFI mode is enabled in the BIOS and the USB stick is selected as the boot device. We dont want to use legacy boot anymore when installing linux or any OS. This is an older method that is falling out of support.Its also super lame.

One note is secure boot: for windows or Ubuntu secure boot works well after the OS is installed. But Debian still has some trouble with secure boot and NVidia drivers. If you are using Debian you might want to turn off secure boot if you intend to use proprietary drivers such as Nvidia (or they dont work at the time of writing but might be subject to change if and when I get it working with auto signing the drivers but I havent yet got it going in an automatic way like Ubuntu). Either way when installing a new OS you need to turn off secure boot or the BIOS will not boot anything other than the signed bootloader it was expecting, which is the OS currently installed on it. So in the screenshots below to test Ventoy you note secure boot is off. (EDIT 16/05/2022 I managed to get secure boot working. Look at the front page for how I did it under the secure boot link - Pete).

EG a typical laptop bios showing secure boot disabled, UEFI enabled and the USB being the boot device. Then showing Ventoy lists all ISO's and that Ubuntu can boot. Tested from a physical laptop just to show the method:


The procedure for installing Debian Testing is to first install stable, then upgrade to testing. This is very easy to do. Lets see what we need to complete this. Instructions assume this will be your only OS (not dual boot).

Step 1: Follow Ventoy steps above and ensure UEFI is enabled and secure boot is off. As mentioned secure boot needs to temporarily be off to install, but afterwards can be turned on if you use Windows or Ubuntu. Debian has a little trouble still if you have proprietary drivers so your mileage may vary.

You will then get to the stage where you boot into the relevant ISO using Ventoy and Step 2 continues from this point. It should be easy but essentially all you are doing is getting Ventoy working and booting from the relevant ISO file you wish to install from.

Step 2: Boot the ISO and select Advanced options - expert install. NOTE V IMPORTANT - YOU DO NOT WANT TO SEE BIOS MODE AT THIS STEP!!!!!!!! Note Difference between both screenshots below. BIOS MODE WILL PREVENT CREATING AN EFI PARTITION.

Please note, expert Install is option we want. We do not want Graphical Install. Just the option that says install is right out. If you do not choose expert install you cannot complete all the steps required below. You will select advanced options then expert install. Please review the screen below showing expert install:

Above screenshot that shows the only option you will choose when installing Debian.

Step 3: Once into Debians setup we will choose the usual settings like language, location, keyboard etc. This is very easy, you hit enter and select an appropriate option then hit enter and it moves you to the next step. Yo do not need to select additional locales. Just leave them deselected (unless you want some). Basically just select whats relevant until you get to detect and mount installation media and ensure that your USB storage has a * in it. On Load installer components from installation media you do not need to select anything normally. You will likely be an expert already and know if you needs to select something, but pretty much that is rare. So leave them all deselected and move on. You can detect network hardware, and configure the network automatically in most cases (ie you use dhcp). It should succeed and move onto setting a hostname. Here you can put in anything cool you like so make sure you choose a cool name like 'batman' or something. Domain name will be if you are on an enterprise network. If its a home PC just use workgroup.local or something boring like that.

The next part is setting users and passwords. Say yes to shadow passwords and NO to login as root. Instead we will add a user who will then use the sudo command. Setup your user (ie name like Peter or Pauline) and give it a strong password you wont forget like YourMomIs100%Sexy or anything you want. You will then do the part where you make yourself a username. I'm not doing screenshots for this because its boring and easy. Configure your clock and detect the disks.

Next Major section:

When you get to the disk partitioning part we need to choose something logical. If it asks about forcing UEFI mode you must choose yes. You 100% want UEFI mode. For home, you don't need LVM, that is an enterprise solution and will be covered in the servers section of a guide. For home you will want a simpler setup as you don't have many disks in your home PC in a failsafe setup like RAID, generally.

So go ahead and choose 'Manual' for the disk partitioning because its cool to do it manually and we want to setup the install to accommodate BTRFS snapshots later on which is cool. After choosing manual you will see and be able to select the disk you want to install on. In my case its a 40GB disk. Here are the screenshots of choosing Manual, then the relevant disk that will be wiped:

You will note that in my example it has a filesystem on it already. That is fine we are selecting the entire disk in red and will be making all new partitions. When you select it it will tell you that you selected the entire device and as if you want a new part table. Choose gpt as the table type. It now appears as such:

Now we are ready to setup our disk in an awesome way. As you can see in the screenshot above the disk FREE SPACE can be selected. We want to create some partitions on that. With FREE SPACE selected hit enter and on the next screen choose 'Create a new partition'. We don't want to use all the size. Later we will setup something special (zramswap) so we need to keep some disk space for a disk swap that is double the amount of RAM in the computer. In this test VM I have 2GB so I will keep behind some space so I can make a 4GB SWAP. We need a large swap because this large disk swap can accommodate ram that needs to move out of zramswap when we overcommit memory to things like VM's. If we dont do this then spinning up several VM's is not possible as you run out of memory. Later I will show you a VM where it only has 4GB of Ram but can still run several nested VM's that take up more actual memory allocated and yet the system can easily handle the load. This is great if you need to run test labs etc but have a lower end PC with only 16GB or ram or something but need to actually test 6 or 7 virtual machines joined together in a network. But end of the day you want double swap so if you have 16GB ram then make a 32gb ram partition on the disk and so on and so on. The swap seems large but remember if you hibernate or something then everything consumed has to fit into the swap part, so that could be difficult if the uncompressed zram does not fit along with what was in normal RAM.

So to summarize: There will be at least 3 partitions. A boot, a swap, and a root / . I also suggest a 4th partition to hold special kinds of files that btrfs is not ideal for such as VM images that will be ext4. For example on my 2TB SSD I have a 1gb efi, a 64GB swap, a 512GB root for my normal stuff (like the C: on windows) and a 1.3TB partition at the end for a bunch of VM disks in ext4. Back to this example, the first partition I will make 1GB primary - beginning - and on the screen where it lists use as Ext4 I will select the 'Use as: ' section to change it to EFI system Partition. This is to allow your system to boot even if you encrypt your disk and other things along those lines later on. Make sure the bootable flag is on and then choose done:

I then select the remaining free space (ignore the 1MB free space in the beginning of the disk) and hit enter. Create a new primary partition again and make it the size of double your RAM in GB. My test VM has 2GB so I will choose 4GB but you will choose whats relevant to you. 'Use as' will be 'swap area' and its not bootable. Repeat again for the last partition which is the size of the rest of the disk (or a size like 512GB if you intend to have another partition for vm images or files that dont suite btrfs well. Making the 4th partition is not covered but you can easily do it yourself.) and you will choose 'btrfs journaling file system' as the file system type. The mount point is / and the defaults mount options are fine on this step. bootable is off. Once you are done setting up you will have a layout similar to this screenshot below. 3 (or 4) Partitions - 1 ESP, then a SWAP equal to your PC RAM and then a / btrfs for the rest of the disk. This is an excellent layout that will allow us to make your computer super fast in the coming instructions when we enable zramswap and also accomodate cool things like timeshift.

Here is the layout in a screenshot:

your layout will be similar not identical.

As noted you may have 4 partitions if you opted to do that, one of which is ext4 so that vm disk files or other kinds of files that dont snapshot well on btrfs or run efficiently are placed onto this better suited partition. Im sure you will be able to figure it out. Its overall pretty easy. Just partitioning a disk really. Or maybe you are lucky enough to have another entire separate disk. Thats ok too.

Select finish to write changes to the disk. It is now on this screen:

We dont want to install the base system yet. We want a shell. Choose execute a shell:

Click continue to drop to a shell. Now we need to execute some specific commands. Lets start with df to get some info on the disks.

Type in:


We need to take note of the mountpoints like /target and /target/boot/efi. On my system they are /dev/vda3 and /dev/vda1 respectively. They might be different on your system so don't just copy and paste commands. Instead understand why we are typing them and type what is applicable for you. You will need to remember the disk identification for later on. Right now we need to unmount them though. I then need to move the mountpoint to /mnt for /target In my case I do this:

umount /target/boot/efi
umount /target
mount /dev/vda3 /mnt

I can then cd to /mnt and do an ls:

cd /mnt

Note that we see a subvolume called @rootfs. This is very irritating because other OS's have adopted a more logical subvolume structure of @ and @home. This is very cool and we want to do the same thing. Here I will show you how to migrate to an @ subvolume. I can also (or we could also) make the @home subvolume during the install, but I would prefer to do this once the system is installed and it will give you a greater understanding on how to fix things when they are not setup correctly. In Debian we dont just format and start all over again because someone forgot to configure something correctly. We figure out how to correct it after the fact so lets pretend I forget to make the @home subvolume and in the Timeshif section of the guide I will show you how to fix this mistake. This will 100% help you to understand the power of btrfs and subvolumes better as well so its a win all round. (To make an @home during setup its just making another subvolume with that name and editing the fstab after so you dont miss out on anything hard I promise, learning how to fix it when its wrong is better if you want to learn this stuff).

So lets make our subvolume @.

btrfs subvol create @

Now lets move everything from @rootfs to @. These different subvolumes are what we can snapshot and revert back at anytime but we want the standard @ and @home so that programs written for that convention understand what we are doing. There is nothing technically wrong with @rootfs other than its not following a convention used by timeshift, so the program doesn't work correctly. A convention is a good thing, it means we have a standard logical way that everyone understands that we all follow, so lets make our subvolumes nice and logical. You wont always be the only person administering a system.

cd @rootfs/
mv boot /mnt/@/
mv etc /mnt/@/
mv media /mnt/@/
cd ..
cd @
btrfs subvol list .
btrfs subvol delete /mnt/@rootfs

Dont forget your . on some of the commands. Here is my screenshot including where I managed to forget how to delete the subvolume momentarily and get an error on my command until I remembered:

So now we need to put back the mount where the installer expects it to be since we are done our modifications. We also need to fix our fstab with the change we just made. Lets do that now. Dont use the 'ssd' mount option if you dont have an ssd. (EDIT: the btrfs 'ssd' option is no longer used. This is depreciated and can be left out of fstab - I removed it from the code below. It used to be in there.) Note I got the /vdaX from the df command earlier and the ID 258 from the list command. You will not just copy my numbers and disk identifiers. You will substitute your own values here (they might be the same or might not).

Note on newer kernels you can use space_cache=v2 instead, when i did this the kernel was not new enough at the time. If you are following this guide in 2023 space_cache=v2 is fine and better than the old v1 version.

btrfs subvol list .
mount -o defaults,compress=lzo,autodefrag,space_cache,subvolid=258 /dev/vda3 /target

Apologies for some errors in my command, I was tired and it was late.

I then checked to ensure I did not need to make /target/boot/efi. It already existed for me. So I just need to mount to that path:

mount /dev/vda1 /target/boot/efi

Last thing is to fix the fstab:

nano /target/etc/fstab

now all we need to do is make the performance improvements and edit @rootfs to be @. So lets enter in out mount performance improvements after the 'defaults' section on / mount and edit @rootfs to be @ like this:

I cant easily show you the edits as it spans more than the screen but all I did was add “compress=lzo,autodefrag,space_cache” and edit the @ at the end. Dont forget if you opted to use space_cache=v2 you must continue to use that or it wont mount. Here is an example:

Hopefully its obvious here how to edit the btrfs / with just those edits. Now we are done so just type exit to leave the shell:


Hooray! We are almost there now. Everything is looking really fast and neat and we get to use BTRFS. This is fantastic. Things are getting pretty awesome right now so lets carry on installing.

Select install the base system. The install will run along and get installing. When it asks about what kernel you want just select linux-image-amd64 (it it decides the latest as opposed to selecting a specific one). Then choose generic, all available drivers. We dont need to strip drivers out of Debian unless its going to be installed on a fridge or something with very little disk space. You should check your fridge to see if you can install linux on it later when you go up to make some tea just BTW.

Next it finishes all that and moves onto another basic step, configure the package manager. It asks about scanning for extra install media. Just say NO kids. Say Yes to network mirror and choose an appropriate mirror near you and http is fine. https is not needed. I dont need a proxy but if you do, you will already know so leave proxy empty unless you need one.

On the non free software option say yes. We like non free stuff like nvidia drivers. Also say yes to source repositories (ie you can get the source code). On the next screen you can just leave security updates and release updates ticked. We dont need backports because we use testing so there are none, basically. Also we are too cool for that stuff. So just the top 2 basically.

Next we select and install software. We choose to install security updates automatically because we like that kind of thing. I normally participate in the package survey but up to you. If you choose no it just reflects badly on your entire persona and life choices, and in everything you do, thats all.

Next we choose most likely the following, but you can choose some other ones if you want: Debian desktop environment, GNOME, SSH server, standard system utils. Then continue when those 4 things are selected.

Then the installer just runs along and does its thing. Really basic to be honest. Once its done, it moves onto installing the GRUB boot loader. Select that option. It will sometimes moan about efi or some rubbish about not booting just ignore it and say no when it wants to install to removable media paths. That's for losers, and we are winners who don't do that.

Next is finish the installation. Select that. It asks about setting the clock so do that, and we are done. It wants to reboot so make sure you remove the install media and reboot like it tells you.

Once it reboots you should be into your new and exciting Debian install, ready to move onto the next parts of the guide where we configure timeshift and fix @home etc so you can learn about snapshots and wotnot. Its going to be fun so lets do it! However we are also only on Debian stable and not testing, so we still need to upgrade. However as its preferable to first make a snapshot and roll back in case of problems, we will first do the timeshift part before upgrading to testing. It also provides an opportunity for you to check and see if you like Stable or want the newer software at this point.

Next section in the guide here (or go back to the start page by clicking on the logo on this page at the top left): How To Install Timeshift And Snapshot The Disk And Then Revert Any Problems Really Fast(And Be Cool)


The procedure for installing Ubuntu Testing is directly from the ISO on cdimage. This is very easy to do. Lets see what we need to complete this. Instructions assume this will be your only OS (not dual boot).

Step 1: Follow Ventoy steps above and ensure UEFI is enabled and secure boot is off. As mentioned secure boot needs to temporarily be off to install, but afterwards can be turned on if you use Windows or Ubuntu. Debian has a little trouble still if you have proprietary drivers so your mileage may vary.

You will then get to the stage where you boot into the relevant ISO using Ventoy and Step 2 continues from this point. It should be easy but essentially all you are doing is getting Ventoy working and booting from the relevant ISO file you wish to install from.

Step 2: Boot the ISO and select Ubuntu.

Note how we see 2 different installers. It is important you see the UEFI settings option or you are booting into legacy mode. We dont use legacy mode around here, so fix it if you have not done so. Do not install in legacy mode. Install in UEFI mode.

Step 3: Once into Ubuntus' setup (takes a while to boot) we will choose Install Ubuntu and then the usual settings like language etc. For simple stuff I wont bother with a screenshot. Just make sure you do a normal install and tick the install 3rd party software option. If you use Ubuntu, Secure boot works great. You can tick the secure boot option and set a password. This password is used by your BIOS when rebooting. If you didn't enable secure boot you can enable it later on its no big deal.

On the Partition settings where it suggests erase disk and install Ubuntu just choose something else so we can manage our own partition sizes.

My disk is called /dev/vda so I will click “new partition table” and then in the free space do the following: 1GB (1024MB) EFI partition first. A swap partition equal to double the amount of RAM in the system (8GB - 8192MB in my case for this VM). The rest a btrfs for / OR if you have a nice big disk you can make 512GB for / and the rest an ext4 filesystem for VM disk images etc as BTRFS is not the best for those kind of files.

Either way it will look something like this:

Next you will need to select the correct location for the bootloader or the system will not boot. From the screenshot you see I chose /dev/vda in my case. You will select the appropriate location for your setup (likely different). Click Install now and then continue, choose your timezone then type your Account info. Don't forget to call your PC name something cool, like Nightwing or something.

Once it is installed you can reboot and remove the USB/ISO and move on to the next thing in the guide. Ubuntu has a very easy install to be honest. It truly is a testament to how much time the Ubuntu developers have put into making Ubuntu for everyone. Very nice!

To add the same performance improvements for BTRFS as we did in Debian just edit the fstab and add them:

sudo nano /etc/fstab

Here you see that on line 9 and 13 I have added 'compress=lzo,autodefrag,space_cache' to the options. Don't add ssd option anymore for btrfs - it is depreciated.

Addendum: Please note - btrfs space_cache is now replaced by a newer version space_cache=v2. If you see “space_cache” it can be replaced with “space_cache=v2” instead. Once its upgraded to v2 you cant mount the fs with just space_cache anymore so be aware and consistent in what you use or it will appear like you broke it (but actually just mounted with the wrong one).

Once you reboot they will take effect.

If the system does not boot (I got this with Ubuntu for some reason), then it didn't like space_cache being v1. Its not a big deal, just choose 'advanced options for ubuntu' during grub boot and move the highlight to a kernel with (recovery mode) next to it. Once one is highlighted press 'e' and change the 'ro' to 'rw' (read only to read write). Also remain consistant in using space_cache=v2 if you use that.

Then press f10 after making that single change to boot. Then drop to the root shell prompt on the purple screen (press enter after it tells you), and type:

nano /etc/fstab

Now where you had previously just 'space_cache' change it to 'space_cache=v2' (ie add =v2 on there):

ctrl -x and enter to save.

Type reboot to reboot. System should reboot fine. If not you can revert all the edits you made in fstab to try find what is breaking the system.

When a system breaks, you can fix it as you can see. So a broken system is just a challenge, not something to stress you out! Fixing Linux is fun! There is actually a way to clear the space cache in BTRFS. See if you can clear it and mount the filesystem with just 'space_cache' in the fstab and get it booting. Its a fun little project for you to do if you want to learn. Or come back to it when you feel more confident in Linux. Thats ok too. Note: space_cache=v2 is the newer option and should be used when possible.

start/howtoinstall.txt · Last modified: 2023/01/16 13:56 by allebone