Linux Talk | Working with Drives and Filesystems

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
greetings and salutations and thank you for clicking on the video today we're going to talk about working with drives and file systems on your Linux computer and this is a video for more advanced Linux users however if you're just starting out with Linux this might be some information that you might want to tuck into the backyard brain it might come in handy later on usually on this channel I do videos that are talking about stuff that you need to know to get started but every now and again I like to deep dive into the system and show you some interesting things that you can do to tweak things up or work with different things within the system in ways that you might not be aware of so that's what this video is all about a couple of things to get straight before we get started first of all and we're going to be talking about file systems in this video and I am not referring to file structure at this point the word file system actually has two meanings in the world of computers the first one is how the system organizes files so that would be like you're used to looking at the structure of files in the Linux system everything is mounted at slash and everything is under that so that's one way to think of a file system and the other way to think of it is a file system that is used on a hard drive so it's the actual format that is used on the drive and we're going to be talking about ext4 today because that's kind of the de-facto file system for most desktop linux if you're running a boom - if you're running debian or linux mint or arch and then you're probably using the ext4 file system red hat fedora and cent OS these days want to set things up with X FS and openSUSE offers butter FS and install so if you're using one of those distributions you might not have the ext4 file system on every partition and so therefore I would encourage you to go off and find out more about x FS butter FS whatever it is that you're working with but those are more advanced files it was usually designed for enterprise and servers home desktops and small businesses things like that get along just fine with the xt4 and it takes care of itself most of the time but it's kind of neat to be able to get into it and look around so we're gonna do that right now and I have my notes down here these are my notes and it's not going to be every command that I have in the video today it's just a few of them that I have written down so I can keep track of what I'm doing I'm gonna share this in the description to the video you can do with it as you will it's not a definitive guide just keep that in mind it's just my notes alright so the first thing that we need to do is talk a little bit about block devices which is what all of the drives that are hooked up to your computer are a block device or a block storage device is something that the Linux kernel uses as a way to just store data it's permanent storage that's what it looks at it doesn't care what kind of device it is it doesn't care how it writes it it doesn't care whether it's a scuzzy type device a SATA device or whether it's IDE none of that stuff matters to the kernel that is handled elsewhere as far as its concerned it's just sending data to a file so it's represented as a file now if you're at a GUI desktop and you have that nice little computer icon activated then you can click on that and it'll pretty much show you all of the block devices on your system and most desktops these days don't have that or if they don't have that what happens if you're working in a terminal and you just need to find out very quickly so the first command I'm actually going to show you is this one which is LS BLK that's LS block and it shows us all of the block devices on this particular computer and today we are looking at the Dell laptop machine hooked up to it through SSH because it's easier to work on it through SSH then try and record video and do some of the stuff we're going to do with a machine that's recording video ok so when you run LS block gives you this output and over here it shows us da and then a little tree here s da 1 s da 2 SD a 3 and then we have s DB and s da our s DB 1 and this tells us a couple of things first of all this tells us that these are scuzzy devices or SATA devices and that's how the system is dealing with them if you have a really old computer that has like an old IDE drive on it then you may see this represented as HD for hard drive that's just the older system really doesn't matter that's just how it represents drives and then down here you see SR and this is drive oh that would be the DVD drive these two columns are just internal information for folks who would be like debugging a kernel this is the exact address that the kernel uses to speak to this device directly and then we get over here to size and that is very useful to know because it will help you identify exactly what drive you're looking at so if you know for instance that you have a 250 gigabyte Drive and a 1 terabyte drive in your system for instance this is going to tell you which one of these it is and then over here it shows us what it is it's a disk or a partition and then there's the mount point now if you see something at the mount point that means that this is mounted to the filesystem it is actually part of that Linux UNIX file structure at this point and we that's good thing to keep in mind because that means that we have access to it and in this case on this machine we have the root partition we have a swap space which is not technically mounted in the file system but it's active that's what it's showing us and then here we have home which is the home directory that is living on a separate partition on that drive for SD be nothing is mounted which means that that drive is not mounted and we're not going to worry about working with CDs or DVDs at a command prompt today so that's something that you would very very rarely ever have to - and I'm not going to get into that so those are the devices that are on this system so these names over here s das da 1 what are these exactly what does this mean well what it means is that in the dev directory which is a system directory that lives on your system there are files in there that represent these drives and so that gives you the user and programs the ability to interact with them by just calling up these file names remember Linux and UNIX everything is represented by a file your drive your mouse everything's a file doesn't matter it's a file so that makes it real easy for people who are interacting with those to be able to do that in a real logical way so the only thing we don't get here is the file system it's not showing us what the file systems are on these drives and to get that we're going to use a different command and we're going to have to do this as route so we have to have elevated privileges because this gives us some privileged information and if I run this command give it my password takes it a couple seconds to get through this sometimes cause it has to kind of scan the system actually I know what it's doing it's waking up that external hard drive spinning it up so in what it gave us on output here it shows us the exact dev here where where it is in the dev directory SD a 1 SD a 2 SD a 3 and you notice we're not seeing the devices here we're not seeing the disks we're just seeing the partitions because we're really interested in file systems if there's a label it'll show it to us there's only one drive here that has a label and then it'll also show us the UUID what is a UUID it is a universal unique identifier that a partition on a drive gets when it is created and this helps the system keep up with what goes where because up here where it says dev SD a 1 SD a 2 and all this stuff if I swap the cables on these two drives let's say that there are 2 internal drives then what's going to happen is that what was SDA becomes SD B and so therefore this can get confusing and the system like if you move drives it might not be able to boot if it uses you you IDs to find where the drives are when it boots up then it can actually find the right drive even if you move it around and it changes to s DB or whatever the deal is that's what that's all about but what we're really interested in is right here where it says system type and it's got ext for this is swap ext4 so all of these drives are ext4 so we know that so there you go this is the first two commands that you need to know is LS block and block ID they're very useful to have around ok so now then we've kind of figured all that stuff out we can start diving into some other things and look at some useful stuff that you'll need to know when you plug in an external drive on your system usually on the desktop a little icon pops up and if you right-click on that icon you will see that you can safely remove the drive or you can eject the drive either one of those issues this command and what it does is it just tells the system that any data that it has sitting in memory that needs to be written to a drive go ahead and take care of that now and before you start messing around with your system as far as like looking at file systems and stuff might be a good idea to go ahead and do this just in case and if you're troubleshooting a problem and you know that your system just may crash or freeze up you might want to do this as well so that command to sync and it just goes and it doesn't you're not gonna get any output on the screen it's just going to make sure that all of the data is written from the cache - the drives so that's a good thing to know usually the unmount command if you're doing things that a terminal will take care of that first but if you want to be double double sure there you go so the first really useful thing I'm going to show you here is fsck and this is how you can check the filesystem on a drive now fsck is an internal command to linux that when your computer boots up what it does basically is if the DR does not mount cleanly if it comes back and says there's a problem here then your system will trigger fsck and fsck will go through and check the file system and attempt to repair it if you are somebody who's used ms-dos or Windows for years then you're probably familiar with check disk that utility same deal here this is just in linux fsck like I said is automatically called up when the computer boots if it thinks anything funny is going on but you might want to use this for an external drive that is not going to work with that process something that's not automatically mounted when it boots up so to do that you would issue the fsck command so I'm going to show you how to do that first you have to do it as root and on this system I am going to fsck and I'm going to do dev s db1 which we know from what we looked at before is the file system it's an ext4 file system on the second hard drive that's plugged into this machine now it is very important that you do not try to fsck a drive which is currently mounted to the system okay you do not want this filesystem to be mounted fsck should stop you it should say you can't do this it's mounted to the system but if that doesn't catch it and it actually runs for some reason it will most likely trash the filesystem so we we know this isn't mounted so it's okay so we're going to issue that command and it goes out and checks that Drive and all you're looking for is this right here we have the label for that file system which is WD backup and it says guess what that is clean and it gives us some information here about what it did if it had any problems it would attempt to repair it and you'd get lots of output on the screen so we know that drive is nice and clean no problem there we are good to go now what about fsck like on your home partition or your root partition there's a couple of ways to do that you can boot the system off of a live DVD and then you can run LS block and it'll show you what devices those are and then you can run fsck that way but what most people are probably going to end up doing is just forcing the system to do it at boot time and you would do this if you thought something funky was going on let's say that your system crashed it locked up you had to use the power button hold it down to get it to shut down and you just want to be double sure that everything is okay so you can force the fsck command to run at startup and that's pretty easy to do what we need to do is create what is called a flag file which will tell the system when it boots up to go ahead and run fsck and to do that sudo touch and we're gonna put this in the root directory and the name of the file is force FS CK just that simple make sure I type that correctly yes I did and now it's done it you don't get in the output on the screen so what we're going to do now is let's just go ahead and switch to the root directory and then we'll list the storage there and you see that we have that file so the next time the system boots up it's going to run fsck on all of the partitions on the drives that are automatically mounted and I'm going to talk a little bit more about how that does that a little bit later on when we get to another part of the video but just keep that in mind I'll show you how what order that does that and how you set that okay so we are here in the root partition which is actually where we want to be because the next thing I want to show you is lost and found and I want to show you how to get to it most of the time it's going to be completely empty but this is a little folder directory that is created by fsck and it is a place where it sticks anything in the file system that doesn't have a home if it is what's known as a lost I node and it it's just kind of like data that's not connected up anywhere then it'll stick it in here and you can look in there to see if anything is in that folder and the way you would do that is you'd have to do it as route ok pseudo is not going to work so I'll give you a for instance here let's do sudo CD and then lost just type in lost in Auto fill it finds it ok can't do it it's not it doesn't understand what are you trying to do there so how do you get to this you can't do it as a regular user you can't do it as sudo you have to actually become the root user and in most systems these days the root user account is actually locked you can't log in and be root user so if you are using Ubuntu or any system that locks that account by default I think Manjaro does that as well Arch Linux can be configured that way then what you will need to do is to fool the system to make it think that you're the root user and you're not actually the root user so we'll do sudo /s ok and now you see my prompt change color so I'm technically root and be very careful when running in this in this particular mode because anything that you type the system will take literally and it will just do you could blow you can delete your home folder right now you could do all kinds of damage so do be careful but all we want to do is look in this stupid folder and I'm gonna list the storage in there and you're gonna see that it's empty there it really is any any isn't anything in here ok and when I do all all you see is dot and dot dot which represents the current directory and the directory above it there's nothing there and that's good that means that we don't have any loose files or bad inodes got stuck in there and the system didn't know what to do with it so that's just all good you probably will never have to do this because ext4 is a journaling file system which means that it keeps a running log of everything that it does as far as writing files are concerned so if the system has a hard crash and you have a bunch of files open it will revert to the journal the next time that it boots up and it say what was i doing oh I did that I wrote this and it'll just pick up where it's left off if you have an on journaling file system like the old ext2 or fat32 in the windows world those old systems those systems could get really screwed up if this if the computer just stopped working and the cache didn't get written out and the files weren't closed out properly well the journal kind of protects you from that so that's why you don't even have to really worry about that so we can go ahead and just exit to get out of sudo s mode and let's see just CD will take us back to the home folder so we can talk about more interesting stuff here so that's pretty much all you really need to know about fsck you can fsck any file system on your computer the ext4 file system that is and it will check it out and make sure that it's ok you cannot do a mounted file system so you will have to boot from a live DVD or USB stick if you want to check the drives that are mounted at startup on your machine and then everyone you know if you think something goofy happened you might want to look in lost and found but you don't have to you will find a lost and found folder on every directory for your system ok so let me go ahead and move on to the next part here I want to talk about SSDs and trim in Linux because this is a subject that people get very confused about they don't know what trim is and they don't know whether they need to use it on their computers so ok let's talk about a little bit about what trim is if you have a computer that has a solid-state drive then you want to have some sort of trim support happening somewhere years ago in Windows 7 you used to have to get into the command prompt there and type in a command to activate this and it would run all the time and Linux had a similar way of doing that what you would do is you install your system you would add an option to the file system table the FS tab file called dis card and that would activate this every time that a file was deleted off your system then the SSD would go into trim mode and it would move the data around to clear the block see what happens is that as you use an F as you use an SSD you write to it and you delete from it when the filesystem deletes the SSD doesn't necessarily actually remove the data because of the way it writes it it writes it in these big blocks C so if you just remove a little bit of data that only takes up part of the block the SSD is not going to go to all the trouble to move everything else and reorganize all that and so what it does is it just marks that block is in use even though that files not there anymore or some of the files stored in the block aren't there and after a while this starts to slow down performance for an SSD so what it needs to do is it needs to talk to the file system on and it needs to figure out exactly what it can just go ahead and wipe the block and how it can move that data around think of it as sort of like a defrag for SSDs well in Linux you can at any time use the FS trim command to do that so on this particular machine that we're looking at for an example we don't have SSDs this is a this machine actually has a hybrid drive which is part SSD and part spinning drive so we don't use the trim command on that but if it was then you could do FS trim and then you pick the mount point so we're really just going to do the filesystem and let's say that the SSD in question would be the one that contained your operating system then all you would do is fire that off and it would take off and do that and you do it as root by the way and what that's going to do is it's going to put the SSD into trim mode and it's going to go through and it's going to clear out its box blocks and it's going to move the data around not not box but blocks it's gonna go nuts for there for a little while about five or ten minutes as I said originally what you would do to do this is that you would add this let me go ahead and open that up this open this up in an editor so I want nano ITC and then we want FS tab I got it wrong oh that's what I did wrong duh no and that's cool where'd that come from I was trying to tighten nano try that again okay here is our file system table file and this is what this the computer uses to mount up file systems when it starts up so over here we have options and that you can add and here is what you would do is you would add to here just this like this they let's say that this first partition was an SSD drive so what I would do to activate trim all the time is to come over here and then add discard with a comma and if I wanted it to work I would spell it correctly okay no space there and if I did that what that would do is that every time that a file was deleted from that drive then the drive would go into trim mode and it would clear the block well that hits performance as well so we have a situation you can either manually run FS trim every now and again or you can put discard in the FS tab file and that will have trim activated all the time now how this is handled is different depending on which distribution you're running so the last time I looked in Arch Linux it will automatically kick discard on with the certain installers will turn that on automatically so that if it detects that it's an SSD it'll turn it on well that's not a good idea so if you're running something that doesn't have the function that I'm about to show you that a boon to has then you might want to just do it manually I mean like you can do that like depends on how much you use your system once a month or whatever but in the event to world we don't have to worry about all that so I'm gonna go ahead and exit this no I don't want to type that out thank you okay because what they have done is we have a compromise as of a boon to 1404 we now have automatic trim that kicks in about once a week takes care of this completely automatically and we won't have to deal with it a boon to for this started with a boon to 1404 so it's in Linux Mint 17 series anything but based on a boom to 1404 or and it also works in 1604 this isn't a boon to feature I'm about to show you however there's a kind of a tricky thing that happens in a boon to 1404 that I'm going to show you right now since this machine that we're using for an example is running a boom to 1404 is a base its linux mint 17.3 then it qualifies for what I'm about to show you so what we want to do is we're going to go back to the Etsy directory okay I'm gonna go to Etsy alright and then I'm going to switch to another directory and this directory is cron dot weekly okay list the storage there and now you see that we have some scripts in there these are commands that the system runs once a week just to kind of fix things up so what it's doing here is it's doing some things with app to make sure that the index is correct over here we got the man DB command that goes through and make sure that all the manual pages are there and hooked up right and then we also have FS trim and this is the one that we're going to be looking at so let me go ahead and clear the screen and then I am going to once again use Nano to look at this file and the name of the file is FS trim let that autofill alright so this is what's in this file and it's just this one command right here it says to execute this command which is FS trim all and what this does is once a week it just goes out all the SSDs and it fixes them however since this is a boon to 1404 you will notice that we have this message here that's telling us that it's only going to do this automatically for Intel and Samsung SSDs by default because back in those days when 2014 when this was first introduced in a boon to some of the SSDs would kind of get goofy when you put him in trim mode and if there was a lot of stuff being written to them at that time it might lose that data so what they did was they made it so that you had to come in here and add something to the end of the line here in order to skip the model check function this does not count in a boon to 1604 or a linux mint 18 gang this is not there at all the boom to dropped that later on because those drives got their stuff in order and they figured that they could go ahead and safely do that so that's exactly what we have going on here ok so let me get my cursor to the right place and what you would do is if you're running like linux mint 17.3 and you want it to trim your SSD then you just have to add this part right here where it says no model check so I'm just going to cut and paste that to make it like super easy I didn't want to do that go ahead and paste that there putting something else in there hold on let's do that again copy and now paste there we go so you would add that to the end of that and then you would save this script and what it would do is if you were running something other than an Intel or a Samsung it would check that out by the way this if you're also if you're using an OC Z brand you don't need the no model check thing at the end there to get that to work and also keep in mind once again this is just for a boon to 1404 so what does this do basically once a week it goes out and it runs the trim command and on all of your SSDs it takes care of it for you so there's what you need to know about FS trim and even though I have I have one machine that has a pure SSD in it and what I do is is about once every couple of months I'll go in there and run the FS trim command on that drive manually so that it will just may I make sure that it gets done just in case the weekly cron job doesn't run so there you go just a little bit of information about that for your SSD I'm sure that there's a lot of folks out there who are running linux mint 17.3 that didn't even know that was going on or a boon to 1604 so you might want to check into that and also like I said in Manjaro you could set up that weekly cron job yourself if you wanted to or arch and you could just do exactly the same thing I just gave you all the information that you could use to create that script and then you could put it in cron weekly and it would take off and do that assuming that that's how those systems are set up I think they are so it should work ok moving on now to another thing to talk about now I've shown this in videos before and this is actually kind of a really cool thing about the ext4 file system that I like is that ext4 is very very good about not fragmenting itself as it stores files and as it you know do you delete files and then add files to the system so those of you who have worked with windows for years may remember that you know once a week or once a month you have to defrag the system I think starting with Windows 7 they have that set up as a weekly job that runs in the task manager they're a sip of coffee but in Linux you really don't have to worry about that if you're running ext for the average desktop users should never have to defrag their system but you can and I'm going to show you how to do that today so to do that you do it as a root user and the command is e or defrag okay and then you need to give it a place to defragment you're just giving it a directory so on this computer if I would just give it the root directory then it would defragment the first partition on the drive which is where the operating system is stored and let's see if it needs defragmenting first so you can execute the command and then give it that little dash C at the end and now it's just gonna go out and do it it's doing to check it shouldn't take too long for it to do this let's see what it does so it's now going out and it's checking everything out on that root partition and it's going to come back and it's going to tell us if the partition needs defragmenting I can guarantee that it won't simply because that partition is nowhere near full so if your drives are not really full or if your drives are not containing a whole bunch of really large files like videos and virtual machine files and things like that then you probably will never ever have to use efore defrag and as you can see on that particular drive right there the fragmentation score is zero so you do not have to do that alright so let me show you a couple of other things about it efore defrag will do any directory on the system so if i want to for some reason just defragment a particular directory i can do that as well so let's go to type that correctly this time yes you did that's good ok so I'm going to tell it specifically where to go this time I'm gonna say go to home ok and then I'm gonna have it do my son's director he's got a lot of games in there so he's got a lot of files and I'm just going to turn this thing loose and now it went through and it says that everything is not there's no defragmentation whatsoever good to go or whatever it found it couldn't defragment so let's see failure 566 out of 566 I guess there's some files in there where that could mean that it just didn't do anything but either way if there was something that it could be fragment then it would do it let's do something where we might find some fragmentation so let's do Joe and then let's have it go through Google Chrome just the yeah well that's not gonna work hold on well that's okay no I know where that is I'll just do config alright so we're going to go through that particular directory and now it scanned all through those files and just get that above there so we can see that's how that works pretty cool huh clear the screen so that would be kind of useful if you had a directory that had a bunch of video files in it virtual machines and you just wanted to get things straight you could do that but like I said for the average desktop user you will never ever have to use efore defrag and you can check to see the fragmentation level but I would bet that it would come back zero on your system and the reason why is because the ext4 file system when it writes data to the drive it does it in such a way that it leaves room it doesn't try and cram everything toward the front of the file system it actually spreads things out in a logical way it gives a plenty of room to grow so like I said as long as there's plenty of free space on your system you should not have any fragmentation problems speaking of free spaces last thing I want to show you in this particular video and this is kind of cool so when you set up your ext4 file systems or when the Staller does it you will notice that the drives do not come up with the reported amount of space available that you might think that they should have so in this case we just ran the DF command which is disk free and this shows us exactly what's going on with all of the mounted file systems on your computer now some of these are not actually hard drives so look for dev calls here to see what we're looking at so there's dev SD a1 and SD a3 right there these are the currently mounted file systems and how much space is being used in them so let's look at SDA one here you'll notice that we've got used six point three or six point two gigabytes got 16 gigs available and then it tells me that 29% of that space is used and tells me where it's mounted same thing with the home folder down here ok if you do this and you look up like for instance when I created this root partition that root partition is 25 gigabytes but it's only showing 23 available and the reason why it's doing that is because ext4 sets aside 5 percent of the available blocks on the disk for the root user when it installs that's the default why does it do that well if those crazy regular users out there somehow managed to completely fill up a hard drive where there is no space available and they're getting messages that says not enough space on the drive the root user is ensured to have some place to work so he can fix the problem it also helps the filesystem to keep things less defragmented because it can like I said keeps that space and reserve and it can move things around to lower the fragmentation chances and that's how that works now that might not be cool with you you might have a situation where you're using a smaller Drive and this thing's taking 5% away from it and your going up at it and going whoa what's up you know that's not cool well you can change that if the drive is over 50 gigabytes in size the partition that we're talking about then you can use the sec this command safely and it won't hurt anything I would recommend not using it on your root partition just your home partition but if you have everything in one big partition that's how your system is set up you could probably use it and be alright and what we're going to do is we're going to tell ext4 not to reserve so much space and we're going to use this command down here tune to FS so it's pretty it's pretty simple what we will do is let me go ahead and I'm gonna run LSB okay so I have that information in front of me okay and then the command that we're going to run is pseudo tune to FS all right and we're gonna use - em and we're gonna make it 1% of the drive that is set aside for the root user now since we're doing this on such a big drive 1% plenty of space probably so let's do dev and in this case the one that we want to do at 2 is the home folder on this right here just to reclaim a little bit of that space so that would be SD a 3 ok and my notes are getting in the way so I'm gonna go ahead and close that because we won't need to go back to that anyway don't say the change is alright so let's see what it does ok so it did that now that is a permanent setting change and I don't know whether you can raise it back up which we're gonna find out here so if I want to make that 5 long as there's 5 person available it should do it yes so just making sure there I was a loose end I didn't check out before so you can lower that and now if we run DF so remember the numbers up here take a look at that on this file system it says available on this particular sd-3 is a hundred and four hundred and thirty two gigs so let's see what we did to fix that so let's do DF just free H let's see here the available space is what should go up so let's look at available so now we have 282 gigs available and we had before 264 so we've actually gained 20 gigabytes of space by doing that so that's a cool command to know and it is reversible as long as the drive has the free space that it can reserved for the root user so if you want to get a little bit more out of the drive you can do that you can also set that to 0 but the danger there when you set it to 0 when you use this command and instead of putting a 1 there you put a 0 what that will do is nothing is reserved so if that drive does ever happen to fill up completely the system might just crash just can't access it it can't do anything with it because it can't write to it or something like that so I would avoid that 1 percent set it low there you go so thank you for watching the video gang like I said every now and again I like to take a deep dive into this stuff and show you guys around and might learn something there's one more thing I want to show you before I wrap up the video just for those of you who are new to Linux and maybe you don't know how this works ok what if you take an external hard drive and you plug it into the system and you're working at a terminal or you do not have a GUI available how do you work with that drive and it's the same thing with DVDs they're not automatically going to mount so how do you do that I'm going to show you how to mount and unmount drives from the system so that you can do things with them we're gonna use some of the stuff here that we are we've learned on this drive so let's just do the OS block again - so we're familiar with it nothing wrong with typing that command over again and the one that we want to mount is SB D you know s DB 1 right there that partition because it's not mounted anywhere in the filesystem and that represents my external backup drive ok so the command to do that would be mount sudo you have to do it as a root user mount okay now we got to figure out where we're gonna put it well we can just go ahead and put in dev SD SD b1 make sure we got that correct okay now where we gonna put this thing well there are two folders in the filesystem that stuff is normally mounted into when you mount an external drive there's media and if you do it in media that means that probably show up on your desktop that's how the desktop does it uses that media drive for things like CD ROMs flash drives SD cards anything that mounts that way you plug it in and the desktop automatically mounts it as you as you the user and then it creates the icon on the desktop but there's an older school way of doing this and that is to use the MNT directory which you may have noticed sitting there and this is a directory that's normally empty and it's used for temporarily mounting things that you want to mess around with so let's go ahead and do that didn't get in the output on the screen how do I know it's mounted well let's go to that directory so we'll go to CD MNT into thank you alright what's that storage and now you see the stuff that's on my drive so we have a lost-and-found folder there because we ran fsck on there it's it's there and then we have access to let's see here if we go to CD home auto fill list the storage there's my backup now this lost-and-found here is there because i backed up the home folder on another machine that had a lost-and-found this is actually a copy of the lost-and-found folder from the other one it shouldn't be there but that's just the way the backup software is set to work it just takes everything in the home directory there and dumps it over and since that particular home directory is on a separate partition that's why you see lost in so you can go in here and you can work with the file system you know and you can do whatever you need to do because this is now mounted to the file system on the computer so there's my backed up file system right there okay so now when you're done with it how do you get rid of it well here's what you would want to do first of all you will need to get out of where you are because if you are logged in to the directory and then you try and unmount this device what it's going to do is it's gonna say uh-oh you can't do it so let's just do CD which will take us to the home directory and now to unmount that device we do that command like this so it'd be sudo you mount okay and then just tell it what device we're doing that with it's dev SD b1 like that and now it should unmount this device yep so if we CD into MNT was the storage you see it's now empty the unmount command will run the sync to make sure that everything gets written and then it will unmount it from the file system on the computer you're on so if you have to work in a file system this is where you can mount it that's why you see the MNT directory is in here so let's just list the storage here it's right there it's usually empty unless you absolutely need it so there you go a little bit of information you can go off and play with and do with what you will thank you for watching the video love to hear your comments and feedback so send those in also check out easy Linux on the web check out easy Linux on facebook and check out freedom penguin for lots of great stories about Linux you will find links to those different websites in the description to this video along with my notes for what we talked about here today so go off and make use of it and have fun
Info
Channel: Joe Collins
Views: 15,329
Rating: 4.9411764 out of 5
Keywords: Linux, Bash, Command Line, Block Device, FIlesystem, COmputer, Desktop, Laptop
Id: JBRFEvsvQPQ
Channel Id: undefined
Length: 46min 58sec (2818 seconds)
Published: Fri Nov 04 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.