Ubuntu: BTRFS & Snapshots

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi everyone welcome back to the channel and to a new video so we looked already on the channel how we can install arch linux with the bada fs file system time shift or snapper we installed recently fedora 34 with its bandwidth file system and snapper and taking snapshots and in this video we are going to do fairly the same thing using ubuntu so we are going to install ubuntu here with the battery fs file system we are going to install time shift and we are going to make sure that we can take snapshots of the system and that those snapshots are available also on the grub boot loader so without further ado let's jump here into the machine and here i am on a virtual machine it's already booted up so i can start here the installer and it's going to take a moment here to boot up there is always a file system check here on the ubuntu iso and the check is finished so we should boot up now into the live iso where we have the choice whether to install the system or to use the live installation and we're going to use the live install because we need to go into the terminal so there you go now the machine is booting up and here we are in the ubuntu 2010 iso so i'm going to click here try ubuntu and it's going to close the ubiquiti installer here and go full screen on the live iso it's going to take a moment to do this there you go so what we need to do here we need to go into the terminal because before starting the installer we need to actually partition the disk manually set some things in the partitioner and also in the installer and then we can finish the installation using the ubiquiti installer so it is a little bit of work and this is just one way on how you can do that but if you want to use timeshift with a butterfest file system you can definitely follow along so i would say let's go ahead and open up here our terminal and let me actually also first open up the settings because i need to set here my keyboard layout so let me go here to regional language and i'm going to add here the swiss keyboard so i'm just going to type in here switzerland and i'm going to select this one here with knowledge keys and click add there you go so i can select the keyboard from here and now i can go full screen and increase the font sizes okay so let me type in here lsblk now you can see here we have our iso here and we have also our disk this is the virtual machine disk vda which is 60 gigabytes now this is a uefi machine and i'm going to show you how you can do this on a ufi machine on mbr of course the partitioning is going to be a little different because you don't need to have actually an efi partition you can just create if you wish a swap partition a home partition and a root partition which is mandatory and then you can install the bootloader on the disk which i'm going to show you later when we start the ubiquiti installer however if you have a ufo machine like in this case you need to create also an efi partition so i'm going to use gdisk to do this because it's going to create automatically gpt labels so i'm going to switch to the root user first by typing in sudo and then dash i and clean up the terminal and now i can type in gdisk slash tab vda so you can see here creating new gpt entries so let's create the first partition which is gonna be the efi partition so n for new partition number one is fine first sector is also fine the last sector defines the size so for the efi partition i'm gonna go here with 500 megabytes or maybe bytes better set and the code for this partition is ef 0 0 so efi system partition and next i'm going to create a swap partition so n for new partition number two is fine first sector is fine and for the last sector i'm going to go with this partition with 2 gb bytes and the code is 8 2 0 0 for the swap and you can see there is change the partition type to linux swap now i'm going to create the last partition the root partition i'm not going to create a home partition because later in the butterfest file system we're going to have anyway a home sub volume so let's do this by typing in for new and i'm going to accept here all the defaults as well also for the code and then w to write the changes to the disks and then y to confirm so it's going to take a moment to do that and the operation has completed successfully so lsprk again and you can see we have their vda1 vda2 and vda3 now the only thing what we need to do here we need to format vda1 with the fat file system because if we don't then we are not going to be able to mount this partition in the ubiquiti installer so let me format vda1 by typing in mkfs.fit dash f32 so we're going to use the fat file system of course because it's a efi partition and then the partition path is dev slash vda1 and hit enter now before we proceed using the installer we need to make sure that the installer is going to set the correct mount options for the battery file system and that also the fstab file is going to properly be configured when we reboot the machine so to do this we need to edit two files which are going to make sure that the ubiquiti installer is going to do that now let me clean up the terminal here and let's type in nano slash user slash lib slash part man slash mount dot d and then 70 butter fs and then hit enter now this is basically the file which is going to take care of the mount options for the rfs file system when we reboot the machine and we need to change some of these to make sure that we have the ones that we want to have so the first one is if we go down here to this line you can see here we have the options parameter and this is going to set the options for the roots of volume which is going to be created in ubuntu automatically now to this option sample equal add mark which is the roots of volume i want to add also some other options now the battery fs file system should recognize actually if you have an ssd and should be able to add this option automatically as it does on arch so i'm not gonna add it here anyway because this is a virtual machine and if you have an ssd probably it's gonna be automatically added anyway but i want to add some other options here first is the no a time option and again the no a time option just makes sure that there are not too many read and write operations especially if you're accessing file very often so it's good to have this option because it's gonna improve performance and the next option is the space cache and here i'm gonna use just the version one because it's a very small drive i'm gonna use of course also the compression option and i'm gonna use that std for this one and if you have an ssd what you can add also is the discard equal async which is going to improve also the performance of your ssd so this is for the roots of volume now i want to do the same also for the home sub volume which is normally going to be created in ubuntu which is down here in the second paragraph where you can see here we have the roots subvolume options and the homes of volume options so i'm going to do exactly the same here so i'm going to add here no a time and i'm going to add also space cache and i'm going to add also compress equal z std and also discard equal async now again this is a virtual machine so i could not put actually this option here but as a demo i'll just add it and if you have an ssd you can add it as well so this is it for this file so can we can save and exit here we control or enter and control x to exit now the second file we need to edit is the one that makes sure that we have the mount points also set with the correct options in the fstab file so we need to edit that file so let's type in nano slash user slash lib slash partman slash fstab dot d slash butterfest and then hit enter so the first thing i'm gonna search here for home underscore options and hit enter and you can see them right there so the first thing i want to do here is to change the path to zero and then i'm going to change the options here exactly the same way we did with the other file so i'm going to add here no a time and then space cache and then compress equals that std and i'm going to add also this card equal async and let me make actually the fonts a little smaller so that it stays in one line there you go now we are going to repeat also the same thing here for the roots of volume which is just one line under so i'm just going to go here and add the same thing so no a time comma space cache compress equals that std and we have also this card equal async there you go now we're going to do the same here for the mount point home so i'm gonna go here and change this path also to zero and for the options i'm gonna do exactly the same so comma no a time and then space cache and then compress equal z std and then also discard equal async then we need to change also this path option here to zero and then i'm gonna search for the last thing here with the echo so echo double quote dollar sign home and hit enter and as you can see there we have this command so this is gonna set also the file system checks for the battery fs file system which should be zero so we're gonna change this to to zero and then we can save the file and exit the nano editor so control or enter and control x there you go so now we are ready to start the ubiquiti installer so we'll just type in here ubiquity and then hit enter now it's going to take a moment here to start the installer and there you go so we can select the language here this is okay it's english so we can continue and the keyboard layout here again i'm going to select the same keyboard i'm using here which is the swiss keyboard and i'm going to select this one with no that keys and then i'm going to select here the normal installation and i'm not going to download third-party software this is just a demo but if you need to do that go ahead and do that of course so i'm just going to click continue here and next we should be greeted by the partitioning of the disk so there you go so here we need to select something else and click continue now here you can see we have already our partitions so vda1 is our efi system partition which has already been formatted we have vda2 which we need to define actually as a swap so we can click this and click here swap area and then click ok now we can select vda3 click change and then we can select here the buttonfs file system and format the partition as a mount point here we are going to select the root file system and then click ok and the last thing i need to do here is to check the device for the bootloader installation now if you have a legacy system the device is actually vda it's the whole disk but if you have an ufi machine you need to select here the vda1 partition because that's the efi partition and the bootloader needs to be installed there so we can select in our case the vda1 partition here and then click install now now this is a summary and we can just click continue so now the installer will install the system and we can go through here the rest of the things we need to do so we can just select the other time zone which is fine in my case so i'm just going to click continue here and i'm going to create a user i'm going to type in my name here i'm going to close the computer here ubuntu butterfs the username is fine i'm just going to give it a password and retype it and i require the password to login so that's fine and i can click continue so basically now we just have to wait until the installation is done so i will pause the video here guys and i'll be back with you when it's finished so here we go the installation is now finished so we can click restart now to reboot our machine and then we will check if everything is in place so i need to remove here the iso and the machine is now booting up you can see there we have our installation so i can just hit enter here and we should be able to boot just fine so you can see here this is my username so i can enter my password here and hit enter we should be greeted now by the ubuntu desktop there you go so i'm just going to skip this steps here i'm just going to click next and done there you go so let's open up the terminal and check if everything is okay so let me actually increase the font size here and let me type in sudo bada fs sub volume and then list on the root file system i need of course to authenticate and as you can see there we have our tools of volume so the roots of volume and the homestop volume now if i type in cat slash etc and fstab and let me make this a little smaller you can see here we have our sub volumes with the mount points in the options that we defined before so everything looks good here so the first thing i want to do is to update the system this is very important just to have the latest packages available so sudo apt update and hit enter it's going to take a moment first to check for the updates in the repositories and i'm pretty sure that we have quite a lot of these as you can see there are 247 packages so we can run our suru apt dist upgrade and let's install all of these packages these are important because i want to make just sure that the packages are all up to date and then i'm gonna reboot one last time the machine and then we can install all the packages we need for our battery fence file system so i'm gonna pause the video here guys because this is gonna take a minute or two and i'll be back with you when it's done so there you go guys the system is now up to date so what i'm going to do here i'm going to reboot one time just to make sure that the system is up and running with the latest packages so it's going to take a moment here to boot up again and here it's starting up so let's select ubuntu here and let's wait for a second here until we see the login screen there you go so i can enter my password and now we should be back in the desktop there you go so let's open up again our terminal and again i'll go full screen here and increase the font size so let's install time shift so let's type in sudo apt install time shift and then hit enter i need to of course authenticate and as you can see time shift is now installing so this is going to take actually a moment is not a big package there you go and time shift is installed so let me actually close the terminal and let's open up time shift just to make sure that we configure it the first time so i need to authenticate here and i'm going to select here butterfs and click next and i'm going to select the disk here and click next again the schedule is going to be fine for me of course you can change this to your liking i'm going to click next here i'm going to enable the queue groups and i'm not going to include the homes of volume so i'm going to click next here and click finish and there you go we have here our time shift up and running we can take a snapshot here and here we have our snapshots we can also choose here to browse it or we can also delete it let me just delete this anyway and there you go so let's close this and open up firefox so what we need to do now we need to install two packages that are going to be used for one taking snapshots when we update the system and two making sure that we see those snapshots when we boot the machine from the graphite loader so let's search for those packages so the first one is time shift dash auto snap slash apt and hit enter and let me just here select the language and i will click on the first link here this is the gita project of the package so i'm just going to keep it open here and the second one is of course grab batterfs which is also here on the first link and i'm going to keep this both open just gonna make the window a little larger so what we are going to do here we need to install first some packages so that we can download these repositories so let me open up shortly the terminal here and let me increase the font size and let's type in sudo apt install and i'm going to install bada fs prox if it's not already installed i'm going to install also git and also make and then hit enter i need to of course authenticate and i need to install the packages so this is not going to take too long i can see now it's installing git so this is going to take maybe a couple of seconds i'm just going to skip this through and be back with you guys in a second and there you go so the packages are installed so let's actually go back to the browser and i'm gonna go here to the first package which is the time shift auto snapped app so you can see already from the name this is basically going to make sure that a snapshot is going to be taken every time you make an update to the system so i'm gonna go here to code and copy the address here go back to the terminal clean it up and maybe make it a little smaller and go full screen and type in here git clone and then i'm gonna paste in the link with ctrl shift v and hit enter now i'm going to move into the repository here with cd and then time shift auto snap apt and now i can type in sudo make install and then hit enter now let's do the same also for the other repository while we are added so let me get out here of the terminal go back to firefox here and copy the same way i copied the first package here i'm going to copy grab butterfs i'm going to go back to the terminal here make full screen and type in git clone and copy and paste in the content and hit enter and again i want to move in there so cd and then grab battery fs and again i'm going to run sudo make install exactly the same way and this is also done so let's go back here and clean up the terminal now there is a small change that i want to do in the grab badafs configuration file so to do this i'm going to type in sudo nano slash etc slash default slash grub butterfs and then config and hit enter and the change i'm going to make here because by default it's going to say arch linux snapshots i'm just going to uncomment this line and replace this with you guessed it ubuntu snapshots and then i can save this file and exit nano now we can check once if the configuration is working so we can type in sudo time shift dash autosnap apt and hit enter and as you can see there it's searching for everything everything looks good here we have a snapshot already taken so what we can try now we can try to update our system or to install a package so for example let's try to install neofetch so sudo apt install neofetch and hit enter so let's install it by hitting y here as you can see it's creating already a snapshot before the installation and then it should create also another one after the installation so let's wait for neo-fetch here to finish installing which is not gonna take too long and there you go and let's open up actually time shift so let me minimize here the browser because i don't need it for now so time shift and need to authenticate and as you can see we we have the two snapshots one before the installation and one after the installation now let's close this and reboot once our machine to see if these snapshots are also showing up on the graphite loader so let's go here to the menu and click restart and restart our machine so it's going to take a moment here to start up and if everything went well we should see another menu you can see that we have ubuntu snapshots so if we go in here you can see we have our snapshots here available but anyway this is all there is to it for this video here we installed ubuntu with the battery file system as i said it requires a little bit more work because we need to install it from the terminal and then we can run the installer mount the options and then configure the system so if you try this out let me know in the comments below how it's working for you or if you have any question about the video let me also know in the comments below as you know i answer you as soon as i can and if you want to support my work you can always do so by becoming a patron as you probably already know i'm doing on patreon also a live webinar every month with my patreons and we are focusing on a topic about linux or if you want you can also donate via paypal through my website as well thank you so much for watching the video guys i really appreciate that and i'll see you very soon in the next one
Info
Channel: EF - Linux Made Simple
Views: 7,971
Rating: undefined out of 5
Keywords: Linux, Arch Linux, Software, Training, how to install, install arch linux, install linux, tech tips, it tips, linux tips, UEFI, linux help, timeshift, snapshots, ubuntu
Id: _sLSiL3oynk
Channel Id: undefined
Length: 21min 43sec (1303 seconds)
Published: Thu Apr 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.