This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
start:howtoinstall [2023/08/28 18:07] – peter | start:howtoinstall [2024/01/24 19:45] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | DATE CHECKED THIS PAGE WAS VALID: 28/08/2023 | ||
+ | |||
Overview: Having fun on Debian will mean we are installing Testing Branch 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 don't complain you don't 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). 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. Don't 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, | Overview: Having fun on Debian will mean we are installing Testing Branch 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 don't complain you don't 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). 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. Don't 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, | ||
+ | |||
+ | Note: Two video guides from YT creators showing a differing perspective / alternate view on how to do this is shown here: https:// | ||
+ | |||
+ | Note 2: This guide purposefully leaves @home broken so this can be show, how to fix afterwards. This is crucial if you are not versed in btrfs and snapshots so you can develop an understanding how these subvolumes work, and can be manipulated. If you do understand you should be able to resolve during the setup, the creation of @home yourself. However if you cant complete the steps on your own, then following Step2, then Step3 will bring you into the understanding you need and resolve the @home missing. Its split purposefully over 2 Steps so you can learn and gain a better understanding. | ||
==== Ventoy ==== | ==== Ventoy ==== | ||
Line 86: | Line 92: | ||
{{: | {{: | ||
+ | |||
//Above screenshot that shows the only option you will choose when installing Debian.// | //Above screenshot that shows the only option you will choose when installing Debian.// | ||
Note: Installer for Debian 12 is the same but has a lighter blue background. Have checked the steps are the same at this point. Dont worry if the screenshots show Debian 11, it is the same process. | Note: Installer for Debian 12 is the same but has a lighter blue background. Have checked the steps are the same at this point. Dont worry if the screenshots show Debian 11, it is the same process. | ||
- | 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 ' | + | 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. You 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 ' |
- | 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. | + | The next part is setting users and passwords. Say yes to shadow passwords |
Next Major section: | Next Major section: | ||
Line 195: | Line 202: | ||
< | < | ||
btrfs subvol list . | btrfs subvol list . | ||
- | mount -o defaults, | + | Old Debian 11 command: |
+ | mount -o defaults, | ||
+ | New Debian 12 command: | ||
+ | mount -o defaults, | ||
</ | </ | ||
+ | |||
+ | More Notes on this in late 2023: | ||
+ | space_cache=v2 is not actually required to be specified. space_cache is enough as newer kernels use v2 by default. So 100% you can just use space_cache | ||
+ | discard=async is not required if defaults are set, so this can be removed from fstab. | ||
Apologies for some errors in my command, I was tired and it was late. | Apologies for some errors in my command, I was tired and it was late. | ||
Line 220: | Line 234: | ||
So lets enter in out mount performance improvements after the ' | So lets enter in out mount performance improvements after the ' | ||
- | I cant easily show you the edits as it spans more than the screen but all I did was add "compress=lzo, | + | I cant easily show you the edits as it spans more than the screen but all I did was edit the fstab options to: |
- | Dont forget if you opted to use space_cache=v2 you must continue to use that or it wont mount. | + | |
+ | defaults, | ||
+ | |||
+ | Note: Dont forget if you opted to use space_cache=v2 you must continue to use that or it wont mount (space_cache=v2 is newer and better, suggest Debian12 users use this). | ||
+ | |||
+ | Repeating of More Notes on this in late 2023: | ||
+ | space_cache=v2 is not actually required to be specified. space_cache is enough as newer kernels use v2 by default. So 100% you can just use space_cache | ||
+ | discard=async is not required if defaults are set, so this can be removed from fstab. | ||
Here is an example: | Here is an example: | ||
{{: | {{: | ||
{{: | {{: | ||
+ | |||
+ | **EXAMPLE LINE: | ||
+ | UUID=383732b1-5e87-4b68-a15a-f044bc559877 / | ||
+ | ** | ||
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: | 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: | ||
Line 239: | Line 265: | ||
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. | 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. | + | 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. You can use non-free firmware though. |
- | 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. | + | 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). Some people choose not to but I always do add the src lines. 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 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: | Next we choose most likely the following, but you can choose some other ones if you want: | ||
- | Debian desktop environment, | + | Debian desktop environment, |
- | 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. | + | 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. You can update NVRAM variables though. If you have another OS you can also probe for it or not if you don't.. |
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. | 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. | ||
Line 256: | Line 282: | ||
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): | 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): | ||
[[Start: | [[Start: | ||
- | ==== Ubuntu ==== | ||
- | |||
- | 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' | ||
- | |||
- | 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 ' | ||
- | |||
- | 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 ' | ||
- | |||
- | {{: | ||
- | |||
- | 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 ' | ||
- | |||
- | {{: | ||
- | |||
- | 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 ' | ||
- | |||