How To Install BTRFS On Ubuntu Server, A Comprehensive Installation Tutorial.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
oh [Music] okay so i'm going to go ahead and go over with y'all on how to do a btrfs setup on ubuntu server uh first thing i'm going to do i'm going to give you a quick look at the hardware i'm using so okay we're going to be doing a raid one on these two 512 gigabyte drives and we're gonna go ahead and do a raid 10 on 10 2 terabyte drives that are 3.5 inch quick note too whenever you're doing a setup like this on our 720 xd make sure using a two 2.5 inch drives in the middle two bays right here uh if you populate all the base with 3.5 inch drives it will start overheating drastically okay so let's go ahead and move on here to the usb creation part if you go look right here this is the link you're going to want to go ahead and navigate down to it's also at the bottom of my banner once you get to this link you want to go ahead and scroll down to ubuntu 220.04.2 live server amd 64. iso you want to download this image so downloaded it save download it save it somewhere and after you do that part go ahead and open up your usb creation tool and navigate to that iso you downloaded and just go ahead and start i want to ask you iso or dd it doesn't really matter i prefer dd for linux stuff and then you're going to go ahead and wait for that to finish okay so now that our usb is done let's go ahead and move on to the usb insertion and the posting the server i'm going to go over here and plug in that usb real quick okay so let's go ahead and get my idrac pulled up here so we can go ahead and console into it for the beating process and i'm going to go ahead and launch my console here now now i always use i always recommend using the html based console it just seems to be a lot less buggy than the java one in general especially with linux okay so i'm gonna go ahead and push f11 for my boot manager now i'm going to go ahead and click on my biospace boot menu and to make this easier for all you all just you know follow me along as i'm doing the process i'm going to choose that usb we created with the rufus here uh an important note too uh just ignore the errors y'all have seen there that's just because i was playing around with the btrfs arrays before i actually made this tutorial so an important note here that's actually really important ubuntu server does a few operations oddly enough even the ntfs file system uh i'm not sure all the operations it does during boot but it does do some things i don't know exactly what it does if somebody had some more info on the situation i'd greatly appreciate it because i'd like to know myself but when you're booting to the usb uh i ha i was booting to a computer with a ntfs based drive in it that had windows 10 on it and it actually scanned the drive and repaired the ntfs file system because of an incorrect boot or just made some adjustments which i thought that was interesting because i didn't tell it to do that but the ubuntu server usb is doing some things while it's booting i'm not sure why uh i've anyway i found that really interesting uh so there is some operations they're doing i would personally like to know what else they're doing when it's booting like i said if you have any information on that please let me know but i can confirm that it is doing a few operations uh during post maybe even some that you may not want to be happening so just a fair warning for y'all okay as you can see here we are now to the ubuntu server setup installation gui or graphic user interface so now that we're here uh we're going to go ahead and press f2 to drop into the shell and i'm going to go ahead and get rid of that box down in the corner that i substituted for my face so check you off that way y'all can see the commands going on here so there's going to be a few things we got to do first so the first things first uh so first things first we need to go ahead and issue the ip adder command this is going to give us the ip address we need for the ssh login uh just take note of that ip that's the one we're obviously going to be using there i need to issue the passwd command and set a password for the ssh login i'll be doing that right now and then we're going to need to go ahead and navigate to etc ssh sshd and sshd config file now these are usually uh commented out so you're going to want to uncomment these four lines right here and then you want to uncomment the permit root login delete the prohibit password and type in yes right here and after you do that just go ahead and save your buffer and then next thing you want to go ahead and do is issue the system ctl command so system ctl restart sshd okay let's go ahead and get on our primary machine here or whatever i'll use to do most dl's computing and we're going to go ahead and ssh into the system we're setting up btrfs and ubuntu server on okay and we're in now we're going to go ahead and move on to the creation of the btrfs partitions so i will go ahead and explain this these commands i have over on the right hand side it's good to actually do this on a notepad or like a sublime text editor just whatever you want to use notepad plus plus so i will go ahead and go through the commands i set up and i did them in order here that way i just copy and paste them in the terminal so the first one here is we're creating a legacy based partition scheme layout and then we're creating the boot partition on that partition layout then we're creating a swap partition and then we're creating a root partition using the rest of the space left over on the drive and starting at the 10 gigabyte mark after that we're creating the swap file system on the swap partition we made and then we're activating that swap file system on the swap partition next we're creating the btrfs file system for the boot partition now grub is compatible with booting to btrfs as long as you're using a newer version of grub and it's not a partitionless setup and then we're making a btrfs file system for the root partition which is our main file system that's we're making that file system across those two 512 gig drives and same with that boot partition up here they're being done on the 512 gigabyte drives now right here we're doing a partitionless btrs setup so as you can see if you look up uh we're not doing any of the partition table creation steps we're just creating a straight btrfs file system for that entire data store which would be those 10 2 terabyte drives that you saw at the start of the video and then last but not least i like to set boot and i like that to be the last thing i do so just a preference so let's go ahead and start copying and pasting these commands here okay now we're making a red array for those 10 2 terabyte drives that you saw at the beginning of the video now it's different about this one right here is this is using a partitionist btrfs setup so we're not having to do any of the partition table setup or the partition creation we're just creating a btrfs file system right on top of the drive so it's technically partitionless and this is the perfect example of actually when to use that because the os is not going to be directly on this drive and we'll go ahead and set boot here just because i like to do that last and then let's go ahead and confirm that everything was created correctly so btr fs file system show there's our one terabyte blue partition there's the root partition with the remaining space and here's the ten two terabyte drives so just make sure that you look this over correctly because this is just one of the most important steps of setting up your server now on to mounting so we're going to do here is i'm going to go ahead and type in fdisk i'm gonna go ahead and locate those 512 gigabyte drives so sda and stc so i can use any one of those for the btrfs mount so what i'm gonna go ahead and do here is to go to type i'm going to go ahead and type in mkdir mnt and then type in os drive and i'm going to proceed to mount the hard drives and we are mounted now i need to go ahead and do is we need to go ahead and copy all the files that the installer puts on the hard drive automatically through the gui based installer but we're going to have to do this manually because of the btrf s creation steps we took so in order to do that what we're going to go ahead and do is going to go cd slash confirm we're in the root directory and type ls and you're going to see a folder called rofs which means read only file system so what you're going to go ahead and do is there so what you're going to go ahead and do is you're on a cd rofs now we're in that directory now type ls again now you're going to see there's some syn links but this is what we're going to use as the now this we're going to use for the base of the operating system are all these files right here so now to copy the file system base over the btrfs raid okay so we have everything copied over now we're going to go ahead and do a ch root into that directory so in order to do that we're going to go ahead and type cd mnt os drive i'm just going to do ls to confirm everything's in here i don't see the sim links everything looks good let me clear it out so i'm going to go ahead and type in mount type proc slash proc mnt os drive proc mounted our process folder now let's go ahead and type mount r bind sys mnt os drive sys not the syst folder arrow up change this to dev for mounting the device folders and the devices and then mount make our slave and then t ls drive dev and then sis okay so we did it here is uh we did the preparations for church so we mounted the processes uh the sys and the dev folders and then we made those our slaves so here's the commands i typed just so that tab out doesn't confuse y'all and where i did the tab out on this one it's this command here so skip those lines and this one mount make our save mnt os dry assist now see it so ch group mnt os drive and then slash bin slash bash and then we're gonna go ahead and source the profile so source etc profile some of this you don't have to do depending on what destroyers you're working with but this is the gentoo standardized way and this way you're not missing anything in my opinion it's the safer way make sure you're getting everything here like a lot of times you might have to source the profile you might have to type bin bash after you ch root that location but we're doing all those just in case okay so now all the commands i type are associated with the files we copied onto those 512 gigabyte drives that are btrfs raid array so now that we are in our ch root and i've cleared the screen i'm going to go ahead and mount the boot partition so i'm going to go ahead and type mount dev sdc one slash boot and we're mounted now you're going to want to make sure you issue that command after you're in ch root that way when you're installing the kernels or working with the init ram fs or the grub configuration it knows to work with the boot directory so now a lot of time when you're done this method and after the ch root a lot of times you have a problem with your dns or your internet so in order to fix that we're going to manually set the name servers here for the dns so we're going to go ahead and type in nano etc resolve tab it out conf enter and as long as you're connected to the internet you don't have any specific firewall settings the easiest way i think to do this is to go ahead and just type name server 8.8.8.8 which is the google's default and so if they change it from the time you see this video you're going to make sure your different name server or you just check your dns router and grab your isp ones usually using the closest isp dns for your provider is usually get you the best ping okay so now that we got all the files copied over and we have our dns name server set what we're going to go ahead and do is we're going to go ahead and do an app update to update the app repository list and now we're going gonna go ahead and do an app upgrade to ensure all the packages are upgraded okay so i've already done the app update and app upgrades as you can see it didn't find any updates for the repository list and it didn't find any package upgrades available so for y'all it will do uh if so for y'all it will find some upgrades it needs to do in the process may take five or ten minutes uh after that finishes what you're going to want to do is you're going to do app install aptitude and the reason you're going to want to go ahead and install aptitude is because we're going to use that to reinstall all the packages on the ubuntu server installation that we're ch rooted into that we ins that we copied over from the read-only file system to the btrfs raid and the reason we're doing that is a few of those sim links might not be copied over correctly because they use the cp-a command to copy all those files from the rofs folder onto the btrfs raid so i went i went ahead and cleared all that stuff on the screen so now we're going to go ahead and do since we have aptitude installed we're going to type in aptitude reinstall quote squiggly line i quote and then we're going to hit enter and what this is just going to do is this is going to go ahead and reinstall all the packages that are on the system to confirm that those sim links are correctly relinked and this is just a good good procedure to do after you copy over all those files onto the btrfs trade for the simple fact is we're not using the gui based installer we're actually copying over the base files from the read-only file system folder on the ubuntu server usb so this just ensure that everything is installed correctly now in our ch root environment and so because this process is going to take a while i'm just going to go ahead and pause it here and then we'll resume once this process is finished okay so now what we're going to do before we proceed to the fstab file setup we're going to go ahead and create the true root mount points for both the 512 gigabyte drives and the 10 two terabyte drives and we're also going to create just a general amount for general mount point for the 10 2 terabyte drives so to go ahead and do that we're going to type in mkdir mnt true root now we're going to create another directory mkdir mnt datastore and then mkdir mnt datastore true root so let me go ahead and explain what we just did here so the true root is for the uh to mount the sub volume id of zero for bt rfs and those 512 gigabyte drives we're going to be mounting that sub volume a zero under true root the data store is the mount point for the 10 two terabyte drives and the data store true root is the mount point for sub uh volume 0 for the 10 2 terabyte drives now the sub volume 0 is the lowest mount point it's the actual true route of the btrfs raids and you need this for when you're doing snapshots okay so i'm going to go ahead and proceed with the fstab set up right now this is a good trick to do especially if you're not doing a doing it through an ssh session to copy and paste commands so you can go ahead type in blk id and then forward it over to etc f-step and then we're going to issue that and and command that way whenever that command finishes successfully we're going to go ahead and open it with nano okay so let me go ahead and explain what i did here so i went ahead and used the blk id command to go ahead and collect all the eu ids from all my drives and partitions and then i sent i outputted that data over to my f-stab file and then i use nano to open up the fsab file and now i'm going to go ahead and clear out the data in here that i no longer need so i'm going to be keeping sda133 and i'm going to go ahead and be keeping the swap partition of sdj2 and the reason for that is because when you're mounting swap partitions you can mount more than one swap partition and it pulls that's those swap partitions into one swap space and so to keep everything unified we're using 10 gigabits 10 gigabytes of swap from one of my 512 gigabyte drives and another 10 gigabytes of swap from my other 512 gigabyte drive so we're going to do here is we're going to go ahead and comment some lines so for this line is going to be mount boot next line's going to be mount swaps third line is going to be mount root and then mount true route and then mount vt rfs data pool and the bt rfs data pole is going to be those 10 two terabyte drives and then mount btrfs data pull true and after uh we're done creating this file go ahead and explain everything to y'all so sda1 is going to be in my boot partition so control 6. we're going to go ahead and do here is ctrl k on dev sda1 because that's our boot partition and we'll go ahead and go to boot and get ctrl u and now we're gonna go ahead and put our two swap partitions under the mount swap comment lines so do that sda2 control k go to swaps and then ctrl u and we're gonna go ahead and go down again to sdj to control okay and go to the mount swaps comment line render sda2 ctrl u and now we're going to go to our primary root partition for the os control k and then ctrl u and for me dev sdi is already in the correct place and we're also going to need that uuid for the mount btrfs data pool so to do that i'm going to go ahead and do alt 6 on this line and then ctrl u all right we copied that on and i also need the uuid for the primary root partition and i need to copy that line and put it under the true root as well so all six six control u didn't do that one right so alt 6 control u and now let's go ahead and clear out the junk we don't need from these uuids so we finished cleaning up the f-style file and we only left the uids we're going to work with now we're going to go ahead and finish off adding the correct columns to those uuids so for the boot partition i'm going to go ahead and mount it at the boot mount point do a few spaces here and it is the btrfs file system type i'm going to be using defaults a few spaces here not going to be specifying any backup options here so zero here and it's not the root file system but we're just going to go ahead and enable the scan option just for the heck of it now let's go over to this swaps partitions a few spaces here the swaps don't have a mount point so we're going to put none a few spaces here file system type is swap options for that file system sw for swap no backup options and no file system scanning same thing for this line this one's going to have a root mount point so forward slash faucet sim type vtrfs same thing here defaults no backup options and for file system scanning we're gonna have a one here because it is the root partition so you have to have a one instead of a two now the btrfs true this is where things get a little bit tricky but i'll explain them to you as we go it's pretty much going to be the same thing except for the options we're going to add a sub volume id of 0 to specify hey that's the lowest mount point for the btrfs file system that is true root itself so for the mount point we're going to go ahead and do forward slash mnt and we're going to specify that true root folder we created under the mount directory so true root a few spaces here we're using the default options and we're also going to be using a sub volume option so sub volume id equals zero and we're doing that because we're saying that's true root for those two 512 gigabyte drives and we're gonna do a zero and a zero here now for the btrfs status store i accidentally put data pool here let's make that comment line match the amount points that way i'll don't get confused sorry about that so mnt data store these spaces defaults another options zero and zero and then t data store true root default options okay now we have our f-stat file ready to go let's go ahead and clean this up a little bit so we can actually see that the columns match and that they're aligned correctly then we'll go everything over everything to make sure it's all correct you okay so now we cleaned up the fstab file let's double check everything so we have the the so we have the boot uuid mounted on the boot directory under the root as a btrfs file system using the defaults options with a zero for the backup options backup options aren't used that often anymore so these are usually zero all the time and a two for a file system check now i don't know how bt rfs handles this column but in a lot of districts you still have to use the 2fs to to uh configure this uh with the file system scanning anyway so and and the newer btrfs versions might handle this so i don't know how btrfs handles this last column here on between new and older versions but we're going to go ahead and enable those file system scanning options anyway now on mount swaps data swaps down mount points we're using swap file system types for the options we're just telling it to use swap options zero and zero those two are correct mount root c uuid for the root partition which was dev sda3 for me that's at the root mount point pt rfs file system type using defaults options zero and a one that lines correct true root which is still going to be same uuid mnt at the true root map point defaults sub volume id equals zero that's correct zero and zero and mounted ptrfs datastore defaults zero okay so everything looks good in our f-stab file let's go ahead and save that modified buffer and clear it out okay so now that we've cleared that screen out we're going to go ahead and type in apt install grub 2 yes so now what we're going to go ahead and do is we're going to go ahead and issue the grub install command and we're going to go ahead and do that for both of the 512 gigabyte drives the reason why is because this is writing some data the first few sectors of the hard drive that are going to be independent from our btrfs partition this is also why whenever you're creating the partitions is imparted you want to two to like four megabytes or one to four megabytes of space unallocated on the very start of your drive so let's go ahead and issue that that command now for those two drives so we're going to do grub install dev sda installed correctly and now we're going to do grub install dev sdj and the reason why we installed it to both those 512 gigabyte drives instead of just one like i said is because those initial few sectors that grub is right into to let the motherboard know when you attempt to boot to that drive that hey grubs on here then boot to this partition this is a safety in case one of those drives dies so if one of those 512 gigabyte drives die and you had your motherboard set to boot to that drive via legacy slash dos then you're just going to be able to go back into your motherboard options and change the boot drive from your fail drive to the other drive this way you'll still be able to boot although you might have to enable a degraded mode to boot into the btrfs under a degraded ray array under a degraded rate array and let's go ahead and make sure we set a password for the root account also for the ubuntu server installation make sure when you're setting the password you type it in slowly you will get an error if you try to input both passwords too fast regardless if they match or not and now we're going to go ahead and proceed with the installation of the kernel and to do that we're going to type in apt install linux dash image dash generic and we're going to confirm that now as you can see it's installing the linux dash firmware package right here as a dependency and it's also installing the linux modules for the kernel as a dependency an important note is if you're installing a different kernel besides the generic kernel image there's a chance those modules and that firmware might not be installed as dependencies so you're going to want to do that as a separate process and as you can see here it is automatically generating an init ram fs and i believe it's also going to issue the update grub command as well and because of that uh as long as you're installing the linux image generic package installed those as dependencies and also issue those commands automatically so as long as you have your f stab file set up you should just be able to reboot and it will reboot directly into your operating system okay so we are booting into our ubuntu server installation that we finished here now keep in mind we didn't install a window manager and we'd install a desktop environment or anything so it's going to take a little while to load because this the systemd init is not properly configured so it's going to take a little longer to load and when it does load you're going to see a blinking cursor at the top and it's probably just going to sit like that all you got to go ahead and do to bring in the login prompt is change your tty by pressing ctrl alt and f2 or f3 etc okay here's that blinking cursor i was talking about go ahead and open up my keyboard here and do a ctrl alt f2 okay it's now it brought up the login screen sometimes it won't work right when the blinking cursor appears you're gonna have to wait a little longer i said first first boot especially when systemd is not configured correctly and your init system so like i said it takes a while so let's go ahead and log in here and i'm going to go ahead and configure my ssh and copy and paste my btrfs snapbit script i'm not going to have this in the tutorial because y'all obviously already know how to do that for the most part and if you don't i will have a tutorial later on explaining uh how to configure and install ssh on ubuntu or ubuntu server choose your distro i'm going to try to get the tutorials up as quickly as i can i usually try to do one to two videos a week and if time allows me in financials i will be doing a lot more of them so what you're going to want to go ahead and do after that's done is you're going to go to go ahead and go into your mount directory so cd mnt and type the ls command so you should have some directories here according to earlier on in my tutorial so for me the directors i have our datastore datastore root and true root so if your fstab file is set up correctly then your btrfs rate arrays are going to be mounted to these folders right here and you want to make sure they're mounted to these folders before you make any new directories in them so let's go ahead and make our snapshots directory so i'm going to go on with y'all on how to do a quick snapshot script that way you just type in snap it and it will go ahead and snapshot all your btrfs rate arrays and place a snapshot with the name of the date and time and what el whatever else you type in in the command line now if you notice we're doing snapshots without creating the sub volume directories first to install the os on instead we're just installing the os and the top level trigger directory and a lot of people want to know how to do this well this is how you do it this is actually how i do it by default so anyway enough small talk let's go ahead and go into the true root mkdr snapshots back out of that then we're gonna go cd true root mkdir snapshots okay now we're ready to create this snap it script up and snap it is the phrase i coined for it this is just a tiny little kitty script i made to just make snapshots really really easy and it makes them as a read-only snapshot that way if you're running as root and you do anything stupid like rm star force or anything like that enter it might wipe out your os but you'll still have your snapshots and you'll be able to boot to those snapshots if you wipe out your btrfs directory so we're going to go ahead and go to the bin folder so cd slash bin and then we're going to do nano and we're going to type in snap it and i'm going to paste my kitty script in here so if you look it will just stay timestamp equals date year month day and then hms for hours months seconds so whenever you type snap it it's going to create a btrfs sub volume snapshot of your route and of your mnt data store or whatever you named it or if you set up those desktop partitions or not this is for if you have more than one btrfs partition or just for a single btr best partition so usually by industry standard whenever you do the sub volumes you create one for your home or you can do one for your var etc etc this is just my way of doing it i think it's simpler i think it works better and i just it just seems to me it just seems overall like a much better way of doing things and i've been using btrfs for a while i've used on multiple computers i've used it in production environments um i've done a lot of testing with it i've purposely broken the btrfs raid probably like 30 times testing it and i've even had a shorter drive and completely crashed a raid array to see if i could recover it well it wasn't 100 on purpose and there are plenty of commands for cover btrfs raid arrays you have to do something really bad like shred half the array for you not be able to get back your files so yeah i love btrfs it to me it's great so best thing since sliced bread and it's just how i i've come up with doing things over the time that i've used it so i mean it's just simpler so yeah anyway i don't like to install the operating system to anything other than the top level trigger and back in 1104 natty there was some problems uh with btrfs if you installed the operating system to anything other than the top level trigger in fact it would break ubuntu's layout so now this is obviously not the case anymore but this is just one of the things i'm using to back up one of the points i'm saying is that it simplifies uh the process and i just personally think the os should be in the top level that's just me personally and it's nice because you don't have to create all the sub volume folders for home boot or you know whatever you want to do it just it just makes things easier if you set it up like this and you just create this little tiny script right here snap it one command it covers everything so it's just to me it's just a lot easier way of doing it so anyway just take note of this little script right here it will be in the video description down below so you all can just paste this into your snap it file under your bin so anyway i'm gonna exit here and save it and now as long as you created those two snapshot directories you can go ahead and take a snapshot like i said you want to make sure you're booting the os first before you create those directories and you want to make sure your btrfs file systems are correctly mounted on those directories you made your f-stop file before you create the snapshot directories otherwise they're not going to be able to mount because there's something in the full for you y'all know how it is i'm sure you have plenty of experience with linux if you're even looking at this video so anyway i'm going to go ahead and test that command but first ach mod oops chmod plus x snap it and let's go ahead and test it snap it and there we go we've created the snapshots all i did was type in snap it as you can see create read only snapshot of your route create read only snapshot of your mnt data store and you can see they they are created just fine okay so now that we created the snap it script and we've taken some snapshots okay so let's get to this let's go ahead and i'm going to go ahead and cd mnt and i'm going to go to my true root folder and i'm going to go ahead and do an ls right here so as you can see the true root folder is sub volume id 0 or sub volume id5 they're both the same thing the btrf s man pages says that zero can be used as an alias for sub volume id5 so zero and five are essentially the exact same thing you can type zero in your f-stab or five in your s-stab i like to do zero because i'm i guess i'm just paranoid so as you can see we took a snapshot it took a snapshot of the sub-volume id 0 or 5 and as you can see we have a snap snapshots directory in our root so whenever we take a snapshot it's going to snapshot our entire route but it's not going to snapshot that snapshot folder so you don't have to worry about that now what you are going to notice is when you go into the snapshots folder that's in the root of the snapshot you're gonna be going into that snapshots folder that's in another snapshots folder and it kind of mirrors itself but it's not doing that with your storage so don't worry about that and btrfs knows that there's snapshots here so when you're taking a snapshot don't worry you're safe and i'll give you an example of what i'm talking about cd snapshots okay and as you can see here's the snapshots we took right here and go ahead and cd into boot test in ls and as you can see we're in the snapshot of boot test and then there's another snapshot folder so if we go into snapshots again and do an ls you'll see hey the other snapshots are there but the boot test snapshot is not there so that's a that's just kind of something i was showing you all that they're they're not mirroring each other but in a way they are and so i was just showing you that because the snapshot i'm in is missing that shot but the snapshot anyway you all get the point i'm not gonna ramble on too much about this you all understand now though i was just showing you that folder's not there okay anyway so now that you all know how that works whenever you take the snapshots even though you installed the os to the sub volume 5 you can do it like this and you can take snapshots and it works just fine and you have nothing to worry about and the reason i do like this because it makes things a lot simpler with scripts and when you want to use that little snap it kitty script thing i made it just makes things easier this is the way i prefer to do it so now that we've gone over that and you see the snapshots are working everything's fine we're gonna go into one of the great reasons i like btrfs and why this is absolutely golden especially when you're using it for devwork it's just great because you can absolutely destroy your entire operating system on purpose and you have absolutely nothing to worry about and you can boot right into a snapshot really really easy and you can even simplify this more by making your own script so i'm going to go ahead and show you how to do that right now and i will be making a video later on on how to recover a broken btrfs rate arrays so what we're going to do is i'm going to go ahead and type in btrfs tap it out sub volume tab it out and i'm going to type in set default now when you type in the set default command what that's doing is that is telling the operating system that you want to use that sub volume or that snapshot to be your primary one so next time you post or boot you're going to be booting to the one you set as default and you're going to be in there so if i want to boot into the boot test snapshot it's a snapshot that i made for showing you all this before so if i want to boot into that it's type set default and what i'm go to do is i just want to type the directory location of that snapshot so boot test set default blue test and as you can see it's done so when i issue a reboot command it's going to go ahead and boot into this folder this boot test folder or the snapshot and now to confirm that that is set as default what we can do is we can type in btrfs sub volume get default and now you're going to have to type in a forward slash for your root directory as you can see id260 okay so your top level sub volume is id 0 or id level 5 but btrfs is always going to show you id sub volume level 5 for the top of the tree root so in order to set back to your primary tree root or your the the very root of your root of your btrfs where you've installed the os on the tree root the top level the creme de la creme whatever you want to call it it's a little different because you don't have actual location to point to because that's your tree root so you actually have to specify the id level so now when you want to go revert back what you're going to do is you're going to type in btrfs set default 5 and then a forward slash oops hello i messed it up i forgot the sub volume okay btrx sub volume set default five and then forward slash and then hit enter as you can see it took it and now i'm going to go ahead and type ptrfs sub volume get default forward slash now you can see it's back to saying id5 fs3 your top level your creme de la creme so i hope that helps y'all to understand how great btrfs is and some of the advantages of using of installing the os to your tree root and how you can still take snapshots and a lot of people are posting on google and forums and reddit how do you use btrfs without creating the sub volume folders and this is how you do it and this is how you take the snapshots it just confuses people a lot because the snapshots are in the same area that you're taking the snapshot in it's mirroring it but it's not marrying it because you saw when i went to the snapshots folder all the snapshots are in the snapshots are in the snapshots but the snapshot you're in is not in the snapshot in snapshot so don't go too far on that one because you might go down the hole but you you get the idea yeah and it's great so you can boot in your os and then you can create a script where like you know if you're uh let's see you're doing developer work and you want to play around with uh the core of the operating system you can create a script so it takes a snapshot and then it boots in that snapshot you just took right away uh i this is and this is the method for how i do it i do this on gentoo i do it on ubuntu server and a few other distros and this is the way that works for me and it works great and it's simplified and it helps you wrap your head around the snapshots and get more experience the btrfs and you don't have to download their extra software packages to take or manage the snapshots because you made that simple snap it script so as you can see it makes things a lot easier it's real easy most guides will tell you to go ahead and create the snapshot directories i just like to snapshot the whole thing and i like my os to be in the top level directory with the snapshots right there and this is how i do it it just simplifies things for me whenever i set people up whenever i'm setting up a server for somebody in a production environment this is how i do it so anyway that's it um anyway i hope you all liked the video if y'all do like and subscribe [Music] you
Info
Channel: FIX A PC
Views: 204
Rating: undefined out of 5
Keywords: How To Install BTRFS, BTRFS On Ubuntu Server
Id: lR7qvhMXK3c
Channel Id: undefined
Length: 65min 46sec (3946 seconds)
Published: Wed Sep 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.