How to Mount an Additional Hard drive in Linux

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everybody AJ rising here and got a quick little video tutorial for you I am going to show you how to add an additional hard drive to your system now we're not talking about the physically opening up the PC case and putting the hard drive in know what I'm talking about is mounting an additional hard drive to your Linux system and this is pretty much going to be generic so if you're on Ubuntu this is gonna work I'm running solos right here you know it what I'm gonna do here it can pretty much be used with with you know just about whatever distribution that you want to run so a couple things obviously you need to add that hard drive first if you're starting with a fresh hard drive you know unused and whatnot then in that case you're going to need to format it and that sort of thing I'm not going to go through the formatting of that drive in this video I've done that previously I did a video showing you how to how to format via the the command line on USBs if you're installing a a hard drive formatting the hard drive it's exactly the same so I'm not going to go into that but you are going to need to know the name of the hardware so and I'm going to show you a couple ways to get that information one and you can use the terminal and I'll show you that in just a second but you can also pull up gparted and the reason we need that information is we're going to do some editing of the fstab which is basically that tells the system which drives are where and all that sort of thing so we can look up the information on gparted another place that you can look is if you are on a known base system and you have Nome discs you can look that up or look it up from there so we're gonna pull that up there and since it does take gparted a little bit because it needs some time to go and scan all the drives but anyway now in in the case of this example I'm going to use I already know where the drive is but you know if you didn't you know you're on gparted this is going to show you all the individual drives and you just need to find the partition that you want to add so in this case I know that it is on this on SD D and the partition that I'm going to add is this one down here called data one it's roughly 720 gigabytes and it tells me right there that it is SD d4 now when we're setting up that fstab like I was talking about earlier you can use this identifier right here SD d4 however I'm going to use what is referred to as the UUID number and it is an individual unique ID number given to each partition by your Linux system and the reason you may want to go and use the UUID to identify as opposed to this SD d4 is I've run into situations where I've gone and added another hard drive to a system and then I had left say a USB plugged into the into the laptop or the desktop or whatever when the system boots up for whatever reason it decides to to reassign that that s in this case you know that s s or s DD for it may assign that number to the to that USB Drive that I had just installed and now everything is all screwed up so with the UUID you won't ever run into that situation granted I haven't had that pop up very up and I've had it happen once or twice to me boat once or twice is enough once that happens you never want to go through that again so anyway kind of backtracking a little bit gparted that's how you find that information on gparted here on gnome disc you basically the same thing you know i know it's a one terabyte hard drive yeah there and you can see all the different partitions partition right there there it is and lo and behold there is that you you or you UID number right there now if you want to find this information out from the command line you can do that and I got my my notes over here so you can do pseudo fdisk - l which is going to give you a list on from a password it's going to give you a list of all the discs on your system as well as their partitions so kind of going through you know the list they're come all the way down here to the bottom and once again SS RS DD for it's a Linux system so roughly 720 gigs now if you need if you want to get that you you you you I'm just I can't talk today that UUID number you can use the command let me copy it here su do BL k ID give it a second and there for you know SDA 1s da - blah blah blah all those coming on down the list and it gives you all of their you you there you you ID numbers so like I said a couple different ways that you can find out that information I get these out of the way cuz I really don't need them anymore okay so now that now that we know the the labeling of our of our partition and let me go and I'm gonna copy this right here just so I've got it for later I will need it okay so now we need to create our mount point where are we going to mount this at now in the case of this drive that I'm mounting it is additional I got music on it I've got some files on it it's all stuff that normally you'd keep in your home folder now in my case my my drive that I have both my home folder and my root drive on it's a small our SSD doesn't have a whole lot of space so I'm gonna go ahead and mount this mount this drive to home and once again let me go and copy and paste from my little text file over here so I'm gonna do sudo mkdir which basically make directory slash home slash Alex slash data 1 data 1 is what we are going to call that drive so we're gonna do that boom and yeah not a whole lot to see there but it's done okay so now that now that we've done that we need to get into the fstab file which like I said it easiest way to understand it in layman's terms is that file is what tells your system where where all the drives are and what they do ok so and I'm gonna do this with the file manager just so that you can see where it's at so on under your root Drive which if you're using if you're using the Nautilus or the Nautilus file manager which is now known as files all the names it's hard to keep track of what they're called anymore but anyway so under your root Drive you want to go to this et Cie and you're gonna look for fstab which is right there now since this is in your root filesystem you will need to edit it with admin privileges so now in my case I've got it set up on Nautilus so that I can I can open you know I'll do a right-click and see where it says edit as administrator I'll need to put in my password okay and let me drag that thing on over here so that I can work on it anyway so you'll be able to do that you know on Nautilus you can do that on cinnamon the Nemo file manager but there are some file managers that are not going to allow you to open things as as root so in that case probably your best option is going to be to use Nano which is the which is the terminal base file manager or I'm sorry terminal terminal base text editor or if you have VI M or some other terminal based text editor so anyway we got the fstab open let me pull it up here so you can get a little better view of it and we're just going to add a line here and I saved it in my my in my little text file notes over here so but I'll kind of walk you through so you do UUID and equals and then in parentheses the you you the UUID number that we just looked up for that particular hard drive or that particular partition and then after that we tell where where it's going to be located this is the slash home slash Alex slash data one the ext for is you know what it what that partition is formatted as and then we've got a few settings that I've added right here just so everything displays correctly and now that we've got this edit in we're gonna save it and now you can go and reboot your system so that you can once again read fstab but if you want to just reload really quick you can just do a mount - a into the terminal and it'll reload sorry about the pause I had to stop the video for a second my dogs were going ballistic because ups pulled up to the house anyway okay so we've we we edited our fstab and now let's reopen nautilus here and here in the home folder you can now see dataone is added and click on it and you can see all this files and all the stuff that i have saved on their videos and ebooks and movies and music and photos and all that kind of stuff anyway that's that's essentially it I will tell you when you are editing that that fstab I always do for like the UUID number I always do a copy and paste into a text file make sure that I've got it all written up correctly double check before I go and then paste it into the fstab because believe me you do not want to screw up the fstab basically when I have and I've done it I've screwed up my fstab by putting in something that wasn't correct and basically what I've ended up doing is using like a Ubuntu live session you know slide the slide the DVD or a USB in and run off of that so that I can use the file manager on there to open up the open up the fstab and erase that line that I put in that was wrong so believe me you absolutely want to get those those ID numbers correct or you could royally screw up your system but anyway that's how you get an additional hard drive edit and like you don't you don't have to add it to the home folder you know a lot of times people will go and you know where is it I forget which file I file I see people adding a lot but you know you can go and add the hard drive to route or mount that's the one I was trying to think of MNT a lot of people go and add additional drives there so you're not limited just adding them to adding them to home just remember that the drought when you add the drive it will take on the characteristics of if you add it to home it's going to have the home characteristics so you will be able to open it up without having to have admin privileges if you add it to something in the root file system then you will need admin privileges to be able to add it or you need to there's some settings that you can do so that you can automatically open it without admin if it is in the root filesystem but kind of a little bit beyond what what I'm showing you how to do here just the easiest way is if you don't want to have to put in you know your your admin credentials to access the drive mount it to home make make things easy for you anyway that's about it for this video I hope that helps you out got any questions comments all that kind of stuff leave it down below I'll try to get to it as soon as possible and if you're not a subscriber please subscribe and I hope to see you all on my next video thanks a lot [Music]
Info
Channel: AJ Reissig
Views: 50,862
Rating: 4.309804 out of 5
Keywords: auto mount hard drive, mount drive linux, ubuntu (operating system), external drive linux, auto mount external drive, gnu/linux (operating system), auto mount samba share linux, auto mount network drive linux mint, auto mount partitions ubuntu, auto mount ubuntu
Id: xwZfFfMTW9A
Channel Id: undefined
Length: 16min 23sec (983 seconds)
Published: Tue Apr 10 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.