Modernize your Linux Storage with btrfs!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
it's time to check out butter fs better fs b3fs wait what was i supposed to call this one again [Music] hello again everyone and welcome back to learn linux tv it's finally time to check out butter fs and this is actually something that i've been wanting to check out for quite some time now butter fs is a file system but not just any file system at least not in the usual sense in addition to being a file system butterfest actually adds some really exciting new features on top of its file system component that are very exciting so in today's video what we're going to do is first define what butterfs even is in the first place i mean yes we know it's a file system but i mentioned that it's a lot more than that so we'll first define what makes butterfest stand apart from other file systems out there after we do that we'll talk about some of the controversy and history around butterfs that way you could have a better understanding of where butterfs actually stands at this current point in time and then after we do that i'll show you some examples of fs and action but before we get into all of that i want to take a moment to mention the sponsor for today's video lenode the node is a linux-focused cloud server provider and using their platform you could actually set up your very own cloud linux server in minutes you could use linux platform to set up your own blog perhaps a next cloud server a minecraft server but if you're not feeling particularly creative today then you can actually use their platform to spin up a linux instance that you can use while going through the tutorials in this series in fact they have all kinds of distributions available so if it's covered on learn linux tv then you could probably find it on lenode and best of all cloud servers on the node's platform are very inexpensive you can get started with a linux instance for just five dollars a month but it's even more affordable because if you use the url that's on the screen right now then you'll be able to set up your brand new lenod account with 100 in credit and you can fit quite a few linux servers within that credit the credit is actually good for 60 days and i highly recommend you check out lynette's platform because they are awesome so thank you yet again to lenode for sponsoring today's video i really appreciate it and with all that out of the way let's go ahead and get started with butter fs [Music] all right so in this section what we're going to do is go over what butter fs actually is as well as some of its history now the first thing that i'd like to get out of the way is how you pronounce it i've actually heard of it pronounced as b3fs as well as better fs and the thing is these pronunciations are pretty much valid but considering that i've most often heard of it being pronounced as butter fs that's how i pronounce it on my end but anyway what exactly is butter fs well i've already mentioned that it's a file system so you already know at least that so far however it's not a simple file system at least not in the common sense historically file systems have existed as a means to define how data is stored on storage volumes and many file systems actually stop right there and do nothing more than that butterfs is more of a modern take on the concept of a file system like others it controls how data is being written to your storage devices but with butterfs that's only just the beginning in addition to defining how data is stored it also includes additional features that are intended to protect your data against things like bitrot give you access to create snapshots and can even go as far as to manage multiple disks as if they were all on a single volume another important aspect of butterfest that i need to mention is that it's a copy and write file system that's an important distinction now a full explanation of what a copy and write file system actually is would be a video in and of itself but a quick summary of what that means is that such a file system copies data anytime there's a modification rather than immediately overwriting it this actually helps ensure data integrity for example in a situation where power is lost to the entire device in the middle of the right if this were to happen on a storage volume that utilized butter fs the original data would be safe during such an event and the reason for that is because new or unmodified data would be copied and written somewhere else first which increases stability in fact my friend tom lawrence has an entire video regarding copy on write on his channel which i highly recommend that you check out anyway even though butterfs is a copy on write file system you can actually disable the copy on write functionality if you have a reason to do so and this makes butterfs a file system that adopts copy on write rather than one that requires it today butterfs is actually the most advanced file system that's built into the linux kernel in fact if you currently run a linux workstation or server there's a very good chance that you already have access to butter fs and some distributions of linux actually go as far as to set it as the default with suse and fedora being two examples of that so already you might be thinking that if butter fs is trusted by those distributions then that can only mean that it's ready for prime time and it's time to switch to it but not so fast in the next section what we're going to do is discuss the pros and cons of butter fs it's definitely important that we understand what makes butterfest great and also what its shortcomings are [Music] now let's talk about the pros and cons of butterfs in this section i mean butterfs actually sounds great so far i've mentioned some of its many features that set it apart from other file systems but should you use it that's actually the question that i'm going to try to help answer in this section and i'll do so by going over its pros and cons since storage needs are different from one user to the next and one use case to the next understanding the pros and cons will help you make a determination as far as whether or not butter fs is something that you might want to consider so to get this section started let's go over some of the pros and i'm going to do so in no particular order first snapshots as an administrator myself i love snapshots regardless of where it's implemented taking a snapshot allows you to preserve the state of something at a particular point in time and then revert back to it later if you need to a good example of this is installing updates imagine taking a snapshot before you install updates and then later finding out that unfortunately one of the updates that you've installed is causing a problem if you just so happen to have taken a snapshot before updating you can actually revert your entire installation back to the state your device was in before the updates were even installed and this lets you test things out before making anything final now the ability to take a snapshot isn't new in fact it's very common when it comes to technologies like virtualization but if you're an administrator like i am i'm sure you'll appreciate any ability to freeze something or have a reference to a certain state and then be able to return exactly to that state if you need to do so with butter fs you have the ability to take snapshots of your storage volumes which gives you added protection just like you're able to do with virtual machines you could take a snapshot of your file system or even just a sub volume and then later revert back to that snapshot in the future if you need to do so since butterfs snapshots are implemented at the storage level you won't be able to take a snapshot of the entire state of the virtual machine but having the ability to take a snapshot of a storage volume is definitely a nice feature to have another feature of butterfest that's really exciting is the ability to create sub sub-volumes sub-volumes can be thought of as partitions but that's actually an over-simplification of what they actually are we'll talk more about that later sub-volumes themselves actually keep track of size differently than you know partitions might and that means you get additional features with butter fs sub volumes when compared to partitions if you were to actually compare butterfest sub volumes to partitions the overall implementation is actually different even if the purpose is the same so i guess you could think of sub-volumes as partitions in the normal sense but implemented a bit differently and they have additional features as well we'll talk more about sub-volumes later in the video but i just wanted to call them out right here because it is actually a feature of butter fs something that i think is definitely noteworthy and we're going to cover it and i'll show you exactly how they differ from normal partitions but just keep in mind that sub volumes are actually similar to partitions but they're implemented quite differently continuing checksums are another feature when it comes to butterfs and checksums help us ensure that data integrity is maintained generally speaking when we save information on a storage device we generally want that information to be safe from things like bitrot or anything else that might constitute a potential issue with data integrity checksums in butterfs help us address that now those are just some of the benefits of butterfs there's quite a few features but already the features that i've mentioned are quite exciting well at least they are in my opinion when i was reading about the feature set of butterfest i well couldn't wait to check it out but as with pretty much everything where there's pros there's also cons and one of the difficulties that you might run into when it comes to butter fs is how it implements raid butterfs like zfs has a built-in implementation of raid that's separate from you know something like md raid that you might use on linux manually however the implementation of raid and butter fs does actually take some liberties when it comes to raid as you are normally aware of it so if you are looking at i don't know raid 1 when it comes to standard raid versus raid 1 and butter fs well there's going to be some differences in things that sets one apart from the other so if you're planning on using raid and butterfest then you should at least understand how it differs but i'm not actually going to go over raid when it comes to this particular video because raid is in a very weird state in butterfs you actually shouldn't use it butterfs is being highly developed right now there's all kinds of people working on this but as of the time i'm recording this video raid is just not something you should consider if you're using butter fs it doesn't mean you can't use it that doesn't mean you won't have a good experience but there's enough instability when it comes to raid and butter fs to where i need to recommend to you to just pretty much avoid it for now but raid isn't the only difficulty that you might run into when it comes to butter fs it's actually a good idea to consult the official documentation because in the documentation there's actually a status page that outlines which features are considered stable and which features might need a bit more work to get them stabilized normally what i would do is outline the state of those features in this video to give you a full understanding however since butterfs is being readily developed this information will constantly change so make sure you check the list by visiting the page yourself to see if anything has changed since this video was recorded in the description down below i'll have a link to the status page in the butterfs documentation and on that status page you'll find a list of the available features and whether or not they're considered stable if you're planning on implementing butter fs then i urge you to read that document first before you proceed another con regarding butterfs is that it has somewhat of a reputation of being unstable to the point where some people actually accuse it of eating their data and that certainly sounds horrible doesn't it the main job of a file system is to keep your data safe and if it's not going to do at least that then you could argue that represents a potential huge issue but then again keep in mind that fedora and susa seem to think that it's safe enough to implement as the default file system so it really depends on how you use butter fs and that makes all the difference so already at this point in the video you could probably argue that i'm not really doing a great job of selling you into butter fs i mean one minute i'm praising it for the features that it has but then the next minute i'm talking to you guys about the reputation that it might eat your data and i don't know about you but as soon as somebody mentions that something might eat my data i'm you know really not interested anymore and using it at the end of the day whether or not you lose data depends solely on your disaster prevention plan and if you do lose data well it's time to dust off your data recovery plan it is not the job of your hard drive to stop you from losing data it's not the job of your raid card or software raid or your file system to keep you from losing data that's solely on you and you alone we can't blame our storage devices we can't blame our hardware there's a reason why we have backups we have snapshots we have you know load balancers and redundancy and clusters we have those things because storage is not predictable regardless of what the technology happens to be so in this case yes there are some actual concerns about some of the features and the stability of some of those features in butterfs well that's why we have these other technologies that i've mentioned we have backups we have warm sites cold sites we have all these different things at our disposal that we can use to get ourselves out of a jam if we end up in one but all things considered as long as you pay attention to the status of butterfs you should be fine [Music] so at this point let's go ahead and take a look at butterfs in action what you see right here is a fresh installation of fedora 36. now you can certainly check out the recent review that i've done for fedora 36 but the reason why i'm actually showing you fedora in this particular video is because it's a great way to get started with butter fs and the reason why that's the case is because fedora actually defaults to butterfs so if you do a standard installation of fedora on your desktop or laptop then congratulations you are already using butter fs so i figured that showing you guys butter fs as it is here in fedora would be a great way to get started so first of all what i'm going to do is open up gnome disks and here we can start to get a look at how the butterfs implementation is actually set up so in my case i have a 512 gigabyte ssd here on my studio pc and if i click on that you can see right here that we have three different partitions we have a fat partition we also have an ext4 partition and these are actually for the boot process so we're going to ignore those but the largest partition right here this is actually as it shows a butter fs partition and in my case i didn't do anything special when i set up this distribution again fedora defaults to butter fs so unless you tell it otherwise then butterfs that's what you're going to get now if i open up a terminal we can actually explore this a little bit deeper anyway i'm going to show you guys some commands right now that are going to help us explore butter fs and i suppose that i don't need this anymore and then i can enlarge the terminal anyway what i'm going to do right now is use a few commands to show you the implementation of butterfs so for example i can use the fdisk command with sudo in front of it followed by dash l and what this will do is give me a listing of the storage devices on my computer i only have one anyway so if i press enter and then type in my password it's going to show me some information about my main hard drive and as you can see right here like i mentioned i have a 512 gigabyte ssd and then we have three partitions so essentially the information that you're seeing right here is the same information as we saw in gnome gnomedis now if i take a look at the fstab file we begin to have a look at how exactly this is implemented so right here we see butterfs listed twice right here we have the root file system so of course that's where our fedora installation actually is and we can see right here that the type of file system that is showing right here in the fstab file it's of course a butterfs volume we also have a partition right here for slash home and that's also a butterfs volume so this is the default fedora partition layout right here unchanged where i've just simply accepted all the defaults while i installed this distribution now i mentioned that we have a home partition and then a partition for our root file system but those aren't actually partitions i mean yes they're treated like partitions they have separate mount points as you see here but actually what these are are sub volumes and we can see that here because for the root file system the name of the sub volume is root and then of course for the home directory the name of the sub volume is home so that's pretty simple but what exactly is a sub volume let's go ahead and explore that next because well that's a very important aspect of butter fs and it's definitely something that we'll need to define so that way we could better understand the remaining concepts that i'll be going over in this video now i actually mentioned partition several times and i also mentioned that sub volumes are not partitioned so what exactly are they now they are treated as partitions especially when it comes to being mounted i mean right here the home directory as well as the root file system they're considered independent mounts so if you didn't know any better you would probably consider these right here to be partitions in every sense of the word but actually look closer right here we have the universally unique identifier for this particular partition and yes i called it a partition i'll define the difference in a moment i'm just simplifying it but anyway the uuid is this right here and if you didn't already know the uuid is actually an identifier for a storage device like a partition and the uuid doesn't actually change at all so regardless of if you i don't know pull out the hard drive and put it in a different slot on your computer then it's always going to have the same uuid the uuid follows the partition or storage device regardless of where you put it that's why we use uuids because it just helps us make better sense or better target the very specific storage volume that we want to but if you look at the identifier for the home folder right here at the bottom you'll see that it has the same universally unique identifier okay that doesn't sound very unique does it i mean we have two different devices and they have the same uuid is that even possible well it must be possible because of coincidence like this i mean you'd probably have a better chance of winning the lottery than having two devices share the same uuid if they're different devices so what we have right here is the same device listed twice so slash home right here and the root file system they're on the same device that's very important to understand they are sub volumes so right here we have sub volume root and of course we have sub volume home but both of these sub volumes are on the same butter fs partition so to take a look even closer i'll run lsblk and we do have three partitions right here and if i pull the uuid which i can do by running this command right here that i'm about to give you sudo blk id and then the name of the device notice right here that the uuid that i grabbed from that third partition is the same as the home directory as well as the root file system so what that tells us that the device slash dev slash nvme 0 and 1 p3 basically the third partition of the first nvme drive that partition right here is the one that's being used for both of these right here and it's right here that we actually get to the first difference between sub volumes and partitions partitions are in and of themselves considered different devices on a linux system and technically that's still the case here because we have partition 1 partition 2 and partition 3. these are indeed different partitions in every sense of the word these are actual partitions and not sub volumes but this last partition right here contains the entirety of our butterfs implementation but anyway we understand we have three partitions and that instead of you know actual partitions for the home folder in the root file system those are both sub volumes on the same partition and this might actually be confusing you more so what i'm going to do right now is show you guys some visuals that are going to help you better understand the actual difference between sub volumes and standard partitions so here's the first visual for this example let's say you have i don't know a 200 gigabyte hard disk and then you set up 30 gigabytes for your linux distribution essentially your operating system and then you give the rest to your home partition this is actually a very common partition layout and one of the benefits of this layout is that by having the root pile system on a different partition you could reinstall your entire linux distribution and not lose any data at least so long as you don't accidentally also wipe out your home partition as well this is standard partitioning if you've ever partitioned a disk before then what you're seeing right here is actually that same thing a standard partition layout and with standard partitioning like you're seeing here each partition on your disk represents an actual boundary for example let's just say you downloaded a bunch of things and your home partition is completely full you have no more room to save so much as a single file you're full it's at its limit you can't save any more now that's very unfortunate for your home partition but it doesn't impact the operating system or the distribution at all because the distribution is on its own partition so as long as you don't actually fill up your root file system then the fact that your home directory is full is not really going to negatively impact you other than maybe desktop shenanigans your operating system your distribution that's going to continue running just fine and that's one of the reasons why we use different partitions we want different boundaries now let's change to a different visual and this one is going to show the same concept more or less but with sub volumes instead of partitions and here we have essentially the same disk layout as the previous one but in this example we have sub volumes instead of partitions we have a sub volume dedicated for the root file system and another dedicated for the home directory but we can also see the first big difference between standard partitions and butterfs sub volumes take a look at the size it's the same for both but how could that be well the reason for this is that butterfs sub volumes don't actually have a fixed size like partitions do here either sub volume can use up the entirety of the size of the butterfs implementation itself now when you compare that to partitions it's nice to know that if a partition becomes full the other partitions won't be full themselves and that's because they're treated as completely separate entities however a butterfs sub volume can use up to the full size of the butterfest volume so you don't exactly benefit from that same protection anymore so you know if your home directory actually fills up in this case then the entirety of your entire butterfs implementation is now full the fact that you filled up your home directory is not going to contain it there since both of the sub volumes can use up the entirety of the disk so let's go ahead and see our first butterfs command for all of these i'm going to need to use sudo so i'll start the command with that and then our user space utility for managing butterfs or even just checking the status of our butterfs implementation is the butterfs command like you see here and then after that we type filesystem and then usage and then the path to the sub volume so if i check the root file system for example i'll type a single forward slash just like that and here we get all kinds of information about the usage of our buttrfs implementation specifically the root file system you can see how much space is free so we have quite a bit of space free as you can see over 469 gigabytes are free at this time which makes sense i actually just created this particular installation today and i haven't even had a chance to save anything on it just yet now let's see what happens if i do the same thing but this time i'm going to actually target the home folder if i scroll up we have the same amount of space free as you can see right here and no we don't actually have a one terabyte disk that's split into two 469 gb partitions the butterfs implementation is only one partition and it actually has 469 gigabytes free so regardless of which one we take a look at the free space is the same because they share the free space whereas you know partitions have their own free space each but rfs sub volumes share their free space however that doesn't mean that you can't have a limit imposed on how much space can be used within a sub volume for that we have quotas and that's what i'm doing in this graphic right here i'm imposing a quota and i'm hypothetically doing that to you know impose a limit i'd rather not have a sub volume have the capability of completely filling up the disk so by using quotas i'm hypothetically working around the fact that sub volumes don't have the same boundary that partitions have but it's here that we come to a very important aspect of butterfest that we need to keep in mind and i did mention this earlier but again not all available features are stable and ready for normal use on the official status page which you're seeing right now it lists the quota feature as mostly okay now i don't know about you when a feature is listed as mostly okay when it comes to storage i'm probably going to ignore that yes there is a way to use quotas and not have a problem people have done it and as long as you stay away from certain you know combinations of features you could probably be okay with quotas but if it's listed as mostly okay and you know not fully stable then i think the best butterfest experience can only be had if you take that into account and you go along with that and make sure not to use something that's not considered fully stable now in this case the reason why i'm letting you know that quotas exist is not to tell you to you know go ahead and use that feature but to use it instead as an example of the fact that some features in butterfest just aren't ready yet now let's go ahead and move on and talk about snapshots a snapshot allows you to create a pointer to the state of your disk at a very specific point in time you can use a snapshot to test a configuration change perhaps a new piece of software and then you could roll back the snapshot then the state of your sub volume the one that you actually took a snapshot of will be restored exactly to the way it was when you first took the snapshot and you know what the ability to create a snapshot has been largely specific to virtual machine solutions but we can utilize snapshots with butterfs regardless of whether our machine or instance is a vm or if it's on actual hardware let's go ahead and see it in action so what i'm going to do right now is create a snapshot of the home folder if you recall the home folder on this machine here is actually a butterfs sub volume so what i'll do is run sudo butter fs and then i'll type sub volume because that's what i want to work with more specifically what i'd like to do is create a snapshot of a sub volume and the sub volume that i want to create a snapshot of is slash home and then we need to give the snapshot a name but not just a name we need to tell butterfs where to mount that snapshot so what i'll do is underneath slash home i'll just call it home hyphen snapshot hyphen one i guess that's good enough and if this works then i should have a snapshot so i'll press enter and it tells me that it's created the snapshot or says create a snapshot but it didn't give me an error so i think that means that it's actually working and to verify that i run sudo butter fs sub volume and we're typing sub volume because even though we've created a snapshot that snapshot itself is also a sub volume and i want to list the sub volumes and i want to list the sub volumes underneath slash home and check this out right here we have home snapshot one so we have taken a snapshot of our home folder just like that that was super easy and the syntax is straightforward as you can see and in no time at all i was able to create a snapshot now what i'm actually going to do is make a change i want to show you guys some sort of change otherwise you won't be able to see this in action so what i'll do is go over here to a different workspace and i'll just change the background because that's a very visual change you'll see that right away i'm just going to randomly choose a different wallpaper altogether so at first we had the default fedora wallpaper now we have this one so i have indeed made a change underneath slash home because well that's where my user settings are actually saved so we should be good there now on your end you could just pretend like i've done something drastic maybe made a huge change or something like that i mean obviously you wouldn't want to use snapshots just to roll back a wallpaper change but the wallpaper change here is just symbolic and it's very visual which is why i chose it but on your end you could probably think of a better alternative than changing the wallpaper anyway how do we go ahead and revert our changes how do we go back to the state our sub volume was in when we took the snapshot originally well the first thing that we're going to do is grab the sub volume id which is actually right here and sub volume id 261 that's the id that corresponds to the snapshot so we just have to remember 261. now what i'm going to do is edit the slash etsy slash fstab file and before we do that we really should make a backup of it so what i'll do is just type sudo cp take a copy of this i'll just save it right there as fstab.bak should be simple enough and i'm doing that because anytime we're messing with our fstab file well that's a bit risky because our system might not boot if we make a change here that isn't actually accurate or if we have a syntax error now of course we want to be very careful when it comes to modifying the fstab file if we make a single error inside this file then our machine will not boot so on your end only follow along with me if you're working on a test system and not a production system because i don't want anyone to host their production system you know messing around with snapshots and things like that so you definitely want to make sure that you get some practice within a virtual machine before you implement this so anyway we made a backup of our fstab file so let's go ahead and make some changes and see this in action so i'll just use nano to edit the fstab file and then we're going to go all the way down here to where we see the home folder and then i'm going to go all the way to the right and we're going to change this right here now what we could do is change the name right here and also to the left as well but i don't recommend that at all it's a lot easier to work with sub volume ids than some volume names so that's why i recommended that we grab the sub volume id before we go any further so i will just change this to subvall id and then i'll give it the id number which was 261 now we just need to be careful if you did decide to follow along with me just take your time don't rush through this but anyway i changed subvall to subvall id i set it equal to the actual id of the snapshot that we've just created now remember this is what the wallpaper looks like right here i changed it away from the default and what i'm going to do is save this file i'll exit out and let's go ahead and reboot all right so moment of truth we're booting up right now and hopefully we'll see what the actual snapshot has done for us so as long as this actually boots we should be in good shape all right so here we have the login screen so i guess this must be a good sign if i made a mistake in the fstab file then i wouldn't be seeing a login screen at all so so far so good i'll go ahead and type in my super secret password right here now wait a minute that's the previous wallpaper so if i didn't know any better i would say our butterfs snapshot actually worked but let's actually take another look at this so we can understand fully what exactly just happened so if i open up a terminal and let's run sudo butter fs sub volume list and then again we want to list the sub volumes underneath home now again we have these sub volumes right here so this home sub volume that's the one that we started with and this right here is actually the one that i created and the one that i highlighted is actually a snapshot and that snapshot was taken before i changed the wallpaper so then what i did was i grabbed the sub volume id which in this case is 261 i changed subvall to subvall id in the fstab file i pointed it to this particular snapshot and then i rebooted the system and we have as you can see the default fedora wallpaper you saw me change the wallpaper to something else but the thing is i created the snapshot before i changed the wallpaper so by pointing the fstab file to the snapshot i'm effectively pointing it to how things were before i made that change [Music] all right so in this section what i'm going to do is show you guys the process of creating your own implementation of now i'm still using the same fedora installation that i was using in the previous section however right here i have an ssh connection to a lenod instance that's also running fedora in this case i created an instance of fedora 35 and i created this before fedora 36 was actually released but it shouldn't really matter that this lenode instance right here is one version behind because well for our purposes today it's just not going to make a difference now one thing to note about bps or cloud instances of fedora is that often they will not be using butter fs so if we take a look at the fstab file we can see that we're actually using extended four right here so we are not using butter fs at least not on this particular instance but you know what that's okay because we can still set up butter fs we can still implement butterfs it doesn't really make a difference that the root file system is or is not consisting of butter fs we can go ahead and just add another volume so what i'm going to do is switch over here to the leno dashboard and here i have my test instance so i'll click on that and i'll go to the storage tab right here and what i'll do is create a new volume so i'll just call mine fedora butter fs i'll go ahead and create the volume and we get all the commands right here that we can use to set up the volume but i'm going to ignore this for now because i want to do something fun i mean yeah these commands would absolutely get this volume mounted and set up and ready to go but what i want to do again is set up a butterfest implementation so i'm going to handle this manually so here on the fedora instance that i'm already connected to let's type lsblk and as you can see we have sdc at the very end so that's our new storage device so we have a disk and now what we're going to do is create our butterfs implementation but in order to do that we will need the user space utilities installed first because without those even though butterfs itself is built into the linux kernel we can't actually work with it unless we have the user space utilities installed so what we'll do is just type which butterfs and in my case i show output here for that command so butterfs the utilities at least are installed and are available so we should be good to continue so anyway we have slash dev sdc our new volume right here so to get butterfest going and actually use that device with butterfs what i'll do is i'll type mkfs and then butterfs so makefs.butterfs and then the actual device is going to be slashdev sdc just like that so i'll press enter and let's see what happens and there we go we should actually have our very own volume right here of butter fs and all we had to do was run that one command right there which isn't all that different from other commands you know like other commands that format devices for example if we wanted to do extended four then the command would have looked like that but we wanted butterfs so what we did is we actually ran makefs.butterfs we gave it a device and now we should be good to go now just like with any other file system we will need to actually create a directory where we will be mounting that device to so we'll run make dur and randomly i'll just say mnt that's always a good place to put these kinds of things anyway and underneath that i'll just call it butterfs hyphen data so now that directory does indeed exist and what we should be able to do is mount that device let's see what happens so i'll type mount slash dev sdc and i'll mount it to the directory that we've just created and as you can see it's right there at the end it tells me that we have 20 gigabytes available and it's mounted at slash mnt butterfs hyphen data now as an aside even though i use the df-h command that's not really something that you want to make a habit of when it comes to butter fs because that can be unreliable the df command is not always going to take everything into consideration that butterfs might be using you know like snapshots and everything that's related to that i only used df-h here out of habit just to see that it was mounted and as you can see it is i could have simply just ran the mount command like this and we see the butterfest device there at the end either way we know it's mounted so so far so good next what i'm going to do is walk through the process of creating a sub volume now earlier we did this already but that was a snapshot what i want to do right now is just create a standard sub volume and to do that what i'll run is of course butter fs and then sub volume we want to create a sub volume and we'll type the path to the device that we've just created and mounted rfs data but what we want to do is give the sub volume its own name so what i'll do i'll just call it myvaul hyphen one i think that's good enough so i'll press enter and it says create sub volume there's no errors here i know for sure there's no errors because i've just checked the exit code so if i didn't know any better i would be under the assumption that it did in fact create that sub volume so if we check a list of sub volumes here we can see that we have my vol 1 listed as a sub volume so we were actually able to create a sub volume right here with our test implementation of butterfs now before we go any further i just want to underscore the fact that you really shouldn't make it a habit to use df-h to understand fully how much space you have left when it comes to your butterfs device in this case i would argue that it probably is accurate but then again i haven't even saved anything on that device yet so it really doesn't matter again the df command as well as du and possibly others are going to be a bit inaccurate when it comes to figuring out the storage or available storage space of your butterfs implementation so what i would do instead is make sure that you're using the butterfs user space utilities to determine the amount of free space that you might have so for example we could run butter fs and as an aside i was using sudo at the beginning of the video but now i'm logged in as root i don't need to do that anymore so i just start with butter fs at this point we'll type file system df and then we type the path that points to the sub volume in our case slash mnt slash butterfs data and here we actually see how the storage breaks down so i recommend that you use the user space utilities when it comes to figuring out how much space you might have available so at this point let's play around with snapshots again snapshots are awesome and i would definitely welcome another opportunity to play around with that so let's do it what i'm going to do is just create a simple text file and i'll create the file underneath the sub volume that we've just created i'll name it example underscore file.txt some random text i think that's good enough let's save the file and there we have the text file now what i'm going to do is create that snapshot so again butter fs sub volume and then snapshot so we have my ball one that's our sub volume and what i want to do is create the snapshot at slash mnt put our fs hyphen data and i'll call it myval1snap and it looks like we have a snapshot and as you can see we have it listed right there myvault1 snap that's our snapshot so we have a snapshot that's pretty cool so at this point we have our original sub volume as well as the snapshot and to show that underneath the slash m t directory and then butterfs data we have my vol 1 as well as my vol 1 snap if we take a look at the original sub volume we have example file.txt and if we take a look at the snapshot we also have examplefile.txt so both of these actually are mounted independent of each other but these are sub volumes so i could reference two completely different versions right here now of course if i had a bunch of changes that i've created to the original that might not be in the second or vice versa i can copy files between the two of them to sync them up there's also additional tools that we can use that go beyond the scope of this video for example we have time shift that's a popular utility to use with butterfs we also have snapper as well that's a susa technology but you can also use that in fedora in addition so we definitely have additional tools that we can go over but right here i just showed you the very basics of butterfs especially when it comes to creating sub volumes as snapshots and there's definitely additional features that we might go over in an additional video but for right now the whole point was to show you guys the basics and that's exactly what i just did so now that we have the basics out of the way the foundation is all set and if you guys would like me to do so i can always come back to butterfs and explore more advanced concepts going forward if that's something you'd like me to do then let me know in the comments down below [Music] alright so hopefully this video was helpful when it comes to the basics of butter fs butter fs is a huge topic i mean there's all kinds of features that we haven't even had a chance to go over yet so if butterfest actually interests you then let me know in the comments below if you'd like to see me do additional content around butterfs and if you click that like button if you did happen to like this video then the more likes this video gets the more i'll understand that you guys would like to see additional butter fs videos on this channel anyway thank you guys so much for watching this was a lot of fun butter fs is awesome i really enjoyed checking this out and i hope to do additional videos around this subject if you guys would like me to do so but in the meantime thank you so much for watching this video i really appreciate it [Music] you
Info
Channel: Learn Linux TV
Views: 79,769
Rating: undefined out of 5
Keywords: Linux, gnu/linux, LearnLinuxTV, Learn Linux TV, LearnLinux.TV, Learn Linux, Linux Training, Linux Tutorials, btrfs, filesystem, file system, storage, linux storage, btrfs file system, linux operating system, linux commands, btrfs filesystem, btrfs filesystem show, linux help, linux distro, linux file systems, btrfs filesystem full, mkfs, disk format, linux server, suse, fedora, btrfs disk, btrfs volume, storage volume, storage array, tech tips, how to install
Id: RPO-fS6HQbY
Channel Id: undefined
Length: 46min 34sec (2794 seconds)
Published: Tue Jun 14 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.