DIY NAS on a BUDGET! with TrueNAS Scale

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everybody welcome back to Jim's Garage if you've clicked on this video then you're most likely in the position where you're considering getting a Nas you're either thinking of buying one or you're thinking of doing it yourself well in this video I'm going to show you how you can build your own Nas how to install one how to configure it and in future videos it's going to play a pivotal part in the rest of our home lab Journey as we will be mounting files directly from our Network shares so let's roll that back and talk a bit about what a Nas is and why you should consider getting one so and that's quite simply is network attached storage it's some storage that's available on your network I.E it's not in the system that's running an application it's somewhere else on the network and that's really useful because you may have smaller devices things like a Raspberry Pi for example you may have a budget machine that simply doesn't have the storage requirements that you need the beauty therefore is that you can have access to said storage over the network that allows you to centralize your storage and that will often give you benefits in terms of density cooling server racks all those sorts of things so why would you want to NAS well a Nas plays a pivotal role in your three two one backup strategy what's a three two one backup strategy well it says that you need three copies of your data you need two of those to be remote and you need one of those to be off-site so what does that mean it means two copies on your local network that could be a USB stick an external hard drive as well as your Nas You could argue that if you are running your data in a raid configuration you would have a couple of copies of your data but remember raid isn't a backup rate is full redundancy let's just get that right and then you would want to back that up off-site now I'll be doing a video later on about how you can backup your home lab and restore it seamlessly Etc but obviously in terms of backups you want something off-site in case an active God or something cataclysmic happened I don't know your Nas was stolen your house is broken into your house burnt down your house flooded all of those sorts of things we want to have at least one copy that's off-site to mitigate all of those risks so what are some of the options well you can do the DIY and that's the route that I chose after I'd purchased off the shelf so there are lots of off-the-shelf products Synology are one of the big brands qnap or another and those are really good devices but this is home loving right so we probably want to do a DIY approach do go and check those out though if you don't feel comfortable with a DIY approach they are good you pay a premium for the convenience but you do get some performance from that just bear in mind that upgrade ability is going to be limited certainly in terms of the number of drives and you're basically fixed with the CPU you might be able to upgrade the RAM some of the more advanced ones may even have a PCI slot but we're getting too far into that let's go down the DIY route so how much are we talking here well you'll be surprised you could build a compelling Nas for a small setup that isn't going to have crazy amounts of redundancy let's say a couple of drives maybe with a couple of terabytes you could probably do that for less than two hundred dollars about 250 pounds over here we pay a bit of a premium so what am I talking about there well any old sort of workstation um on eBay for example or any parts you might want to acquire online anything you have lying around in the house all of those are probably going to be pretty good options now bear in mind a Nas typically will want to be on 24 7. so efficiency is a concern as well as the age of the device I.E the older it is the more likely it is to fail and let's be honest we don't want something that's going to be housing our sensitive data to crash on us so in terms of horsepower what are we looking at well I used to run mine as with a cheap dual core CPU and that's what I'll be using in this video I teamed that with two four gig sticks of ram giving me a total of eight which is spoiler alert that is the minimum that true does requires it was a cheap old commonly available motherboard just a consumer um Sixth Gen Intel motherboard and I put that in the cheapest case that I could find and I paired that with two one terabyte hard disk drives and the whole thing came well under 200 pounds and that was great it didn't give me masses of storage don't expect to be backing up the whole archives or Movie collections Etc but it did give me the space to back up all of the containers all of my personal documents all of my family's personal documents except all the things if I sat down and considered it were really important to me and that's kind of where I want to get you to so I gave the game away earlier we're going to be using trunas there are other Solutions things like unrage spring to mind but the reason I like true nuts is it's free and it's scalable and I've never had a problem with it and I know a lot of people in the home lab Community swear by it now we're going to use specifically true now scale I'm not going to get into that too much but that is effectively a hypervisor as well we're not going to use it for that we're not even going to build it so that you could do that I.E it's not going to be powerful enough because we're working on a really tight budget here but just know that through this config and installation you're going to have a Nas that is going to be for most Parts more than what you will need and importantly is something that you can upgrade in the future the beauty is you can download your config files and simply upgrade your Hardware and then import the backup I've done that a number of times there is an option to run trunas virtually people do do that people do say it's fine but I don't recommend it if you're a beginner or you're using consumer grade kit so I'm not going to support any questions that come in on that the reason being that the more you put on your proxmox host the more likelihood something could go wrong and as I said before anaz is our backup we don't want it to go wrong so let's get on to the build so I'm joined here by my lovely assistant who's going to demonstrate some of the parts that we're going to use so this is an old case I demonstrated this in my first prologue video it's just a cheap Cooler Master case the drives that I'm using this was rescued from a virgin TV box I have a couple of those lying around you could use any spare drives that you've got or pick up some cheap ones that I showed earlier online you could use ssds if you want these aren't great ssds because they don't have any dram I did show the mx-500s previously which are a decent SSD decent performance the CPU just a really cheap uh dual core CPU from a few years ago um you can pick these up for dirt cheap online it's not going to give you masses of performance but we're just keeping this as a Bare Bones now the ram I'm using is pretty Speedy it's 3200 megahertz Ram is Corsair Vengeance and again you can pick this up pretty cheaply and last but not least a notable mention you could probably fit one of these 10 gig Nicks into your budget if you're looking to get around the 200 pound Mark you can regularly find those for about 20 to 30 pounds online do bear in mind that you will need a 10 gig switch to take advantage of that so perhaps something for the back burner and later on in your home lab Journey so for a physical installation we're going to have to download the iso we're going to have to burn that using our good old friend Rufus to a USB stick and install it using the wizard so with your ISO burnt to your USB stick do note that you can also install true Nas to another hard drive so you could have three hard drives one which would use for your true Nas install and then two which you would put into a raid configuration so with that burned go ahead insert that into your machine boot up and select your USB stick as your boot option I'm going to do something which I said I don't recommend you do but it's going to give you who wish to do it as a VM the option to go and do that and also it's easier for me because I can spin this up and the main thing is the installation process is exactly the same no matter whether you're doing it physical or virtually So within proxmox I've created a virtual machine it's pretty straightforward same as what we've done for other virtual machines I've simply given it two cores and eight gigs of RAM I've created three hard drives one where I'm going to install true Nas and then two additional drives which will be creating a raid that will be used then as the main storage and part of my Samba share it's attached to my default Bridge so it has network connectivity and that's it so let's go ahead and start it up and let's get on with the installation process so the installation steps are pretty simple we simply want to hit number one install upgrade we want to choose where we're going to install true Nas so this will likely be your USB stick or another drive that you have available so in this case I'm just going to use this 32 gig Drive so I hit spacebar to select that and then hit return to click ok this just states that it's going to format it do note that trunas recommends you use a SATA or an nvme flash drive USB sticks used to be the go-to but they're now discouraged just because they don't have the read and write capability now I would say fortruders if you're just using this purely for a Nas there isn't that much that's going to be written to the device so you're probably going to be okay tune our scale on the other hand is meant to be sort of more of a hypervisor container platform so you can understand why USB stick wouldn't be best suited for that but just go ahead and continue with the installation we want to create an administrative user create a password once you've done that it's going to continue to install and once you've completed the installation steps you just need to remove the installation media and reboot don't worry when you see this you have installed it correctly it's going to Auto boot into tuners within 10 seconds and once the first boot has completed it's going to run an update so it might take a while but it should be given a DHCP IP address or if you haven't yet connected to your network go ahead and do that and it should pick up an IP address you'll want to find the IP address so that you can then jump into the web GUI which is the bit we'll be covering next so once that's done you can see the IP address of your true Nas host if you have it connected to your network during installation so let's go ahead and log into the web portal so here we are we've successfully installed and we're able to reach the web GUI so let's go and log in using the admin credentials and the password we specified during the installation and when you log in you're greeted with the dashboard now get used to this dashboard it is configurable but it gives you some really handy information about the state of your true Nas installation so you can see here we've got the CPU usage and it's good to see that it's idling because we're not actually doing anything on here you can see that I've given it the minimum of eight gigs of RAM and again because we're not really doing anything most of that Ram is free and we'll go into the ZFS cache once we create that so let's go ahead and create our first data set to do that we're going to have to understand a few things about how truenas works so at the bottom level you have your physical disks you join these discs together to make a virtual device a v-dev now you can have multiple V devs joined together and you join those together within a pool as I mentioned before we can scale up our true Nas installation so even though you're only using two disks now you could add more V devs with a greater number of drives into the same pool at a later date or moreover you could create new V devs and new Z pools now data sets come out of pools as well as Z volumes so try and think of it that the data set that you're going to consume I.E the file share that you're going to be mounting on your systems is part of a pool and that pool is made up of lots of disks that are all joined together within various V devs so let's go ahead and create a pool so when you click create a pool it stays on the left here that I've got two drives available and that makes sense because I created my proxmox VM with two drives and that should be the same for you if you're using two drives or however many drives you have left available that aren't in use by the root file system I.E those drives where true Nas isn't installed so let's select those two drives and create a v Dev so we click this Arrow here we can now choose what type of V Dev we're going to use so on the drop down we've got a stripe so a stripe is going to extend those devices so it will be additive so you will have a single device that is 40 gigs but I don't recommend that because if any one of those two drives fails you're going to lose all of your data now that's a little bit different in a virtual setup because like in mine I've already got four drives in a mirror so the likelihood of that failing is pretty low but in your physical setup if one of your hard drives were to fail you would lose all of your data so I recommend we're going to go with the mirror we're going to select both of those drives we're going to give it a name and then we're going to hit create you can choose to encrypt the drive as well if you wish you can also do this at a later date it's up to you I'm not going to cover that in this video just because we're not going to need it and there's a few more additional steps plus you'll have to make sure that you keep your encryption key safe and all of that and I'll save that for another video so let's go ahead and click create you want to confirm that you're happy with that because it's going to wipe those drives should be pretty quick to create the pool and once it's created that we should be able to see that pool created so here we have an overview of all of the storage on our tuners and as you can see the one we've created is a mirror it's too wide it means it has two discs with a total capacity of 20 gigs that's because we're using a mirror so both drives are exactly the same that means we don't get 40 we get the capacity of a single Drive however we get the performance of two drives so that's really good and that's another reason why You may wish to go down the 10 gig route because even a single hard drive is going to saturate a one gig ethernet port I.E that's going to give you 100 Megs per second it's going to cap out at but your drives can probably do at least 200 on a read each and if you're adding them together you're likely going to be hitting more like 400 Megs per second so you can see that after true Nas has done its magic a bit like when you format a normal Drive you've lost a bit of storage so out of a potential 20 gigs we've ended up with 17. is showing us that the health of the drives is good that's one thing you'll want to double check if you've got secondhand drives for example or you've had drives that have been lying around for a while make sure that those health checks are good otherwise you're going to want to replace that drive you don't want to be putting data on damaged drives so now that we have the pool created with the V devs we want to go and create a data set so that's really simple we simply go to data sets on the left and we click add data set now if you had more pools available on the left hand side you would see all of your different pools we only have one so this is dead simple so we click add a data set we're going to give it a name you call it whatever makes sense for you I'm just going to call it my first data set I'm leaving the default options for the compression level um lz4 gives you a good level of compression and is also very performant and then I'm going to click save so now on the left hand side you'll see within that true Nas root folder we've got my first data set so this is great this is a data set now ontrunas that we can go and save files to and from you'll notice on the right hand side we can set up all the permissions that we want I'm not going to get into that on this video but it's very similar to how any Linux permissions work you create a user and you tell it what you want it to be able to do so you can tell it to give it read write or execute and you can say whether you want the user the group or world to be able to do that the next thing we want to do is if you're going to want to use this more broadly on your network you want to create a share now that's the next option down handily so we'll click that on the left and you're going to have a few options you can create a Windows SMB that's a Samba share which you're probably quite familiar with you can create an NFS share which is typically seen in Linux or you can even create a scuzzy share which if you're going to proxmox I mentioned in the video earlier as well you might want to boot devices from your trunas so iSCSI is a bit different as in it's not a file share it uses Block Level storage so a machine will see that as a physical device effectively as opposed to a file share so for this video and because SMB is easier to work with and has more granular control around permissions I'm going to create an SMB share even though I'm going to be using that on Linux so we want to click add on the SMB share and we want to choose what we're going to share so we're going to share that first data set that we created we're just going to give it the default share permissions and we're just going to hit save it's going to ask you if you want to start the SMB service obviously we do otherwise we won't be able to access it this is where it's going to give you the granular access to the permissions list and what you want to do I'm going to leave that at default for now but it's pretty straightforward you create users and you assign permissions so let's save the access control list and perfect we've got the SMB symbol there next to our data set and it says that it's got the SMB role enabled so that means now we can access our true Nas SMB share from any of our devices on our Network provided that we give the right credentials so let's go ahead and do that so in order to access our SMB share on Windows or Linux or any other machine that can access assambershare we're going to go and create a non-root or admin user and we're going to assign read write and execute permissions to that user on ad share to do that we want to click on the credentials tab on the left and we simply want to add a new user so name your user give them a password you can leave everything else the same or configure it as you require we don't need to change anything for the sake of this tutorial so we just go down and we hit save so now we can see that that user's been created it's got a uid of 3000 and we can verify the name we can see that it requires a password and it's used for Samba authentication which is the share we created so let's go back to our data set click on that and then let's edit the permissions now we want to add an item we want to click on the mask we want to drop down or we want to select that this is a user because that's what we've just created we want to look for the user we just created in my case I called it user1 you put in here whatever you called your user and for the sake of this I want my user to be able to read write and execute files on that share and then I need to save that access control list again so now that that's saved we should be able to go into our Windows Explorer or Linux or wherever you are you can even do this on the command line and we should be able to mount that share using the credentials provided so let's go and try that you're going to want to map a network drive you can choose the drive location that you want to use mine's defaulted to Y because I'm already using Zed and for this you'll see the format is slash Dash server slash share now we want to do backslash backslash and then you want the IP address of your true Nas installation in my case it's 192.168 200 188 and the share name I called mine my first data set so whatever you called your surname one thing to note is if you don't want to have to remember the IP address in our previous video with pi hole you could actually put in an internal DNS name there so you could have truenas.local or whatever you want to do worlds your oyster the key thing here is that when we try to finish this we want to connect using different credentials so we don't want to use the credentials that you're using for your Windows installation so it's now going to ask us to put in our credentials now these are the credentials you just specified when you created the new user intrunas so mine was user one and I put my password in I want to save this so that every time my computer boots it's going to log in and automatically Mount this share so let's hit OK and see what happens and there we have it we see down here my first data set is mounted to my PC I can now create a new text file we'll just call that test let's open that up let's write some text let's save that let's close it down let's open that up and as you can see the text is saved into that file it's behaving just like a folder would on your normal computer so let's go ahead now and connect to this file share through Linux that will mean that we can access and validate that that file was written and also it gives us confirmation that all the systems on our network will be able to write and read to this drive so in order to mount our SMB share within Linux log into your Linux machine I'm going to assume it's your Docker VM at the moment and you're going to need to install a prerequisite so first of all you need to install sifs this is an application that you can use to mount SMB shares so it's simple as sudo apt install utils and then we can put Dash y to make the prompt disappear put your password in once that's done you're going to want to make a folder where you will Mount your share to so that's a bit different to Windows so let me walk you through that so let's change to our root folder and let's make a directory so sudo make the that's make directory let's say slash media slash share okay that's created so there are two ways you can mount this you can either mount it for now I.E this session or you can actually add it to the file system Tab and it will mount it every time you boot Linux so let's go and do that we're going to have to Nano to Etc FS tab we're going to go to the bottom and we're going to append a new line and what we're going to need is the location of the share so this is the same as what we put in our Windows install we're also going to need the name of the share as well so mine was my first data set we're going to have to tell it where we want to mount that so we did Slash media slash share but you can do it wherever you want we're going to tell it that we need to use sifs which is the application we just installed for mounting this Amber share we're going to mount it with our current user which has a user ID of 1000 we're going to put in the username as our user that we created within trunas in my case that was user one we're going to put in the password that we chose mine is a super secure password as you can tell and we're going to put a couple of additional options that give you better compatibility with Linux so that's underscore net Dev space zero space zero and then we're going to save that so click Ctrl o and return great that's written and now we should be able to do sudo Mount Dash a and then if we change directory and go to our slash media slash share fingers crossed we should see our text file and voila we do so let's cut that and there you can see the text that I wrote on my Windows machine so there we have it we have an SMB share that you can now access across all of your devices that support SMB so if you've managed to follow the guide so far we've just hit another major milestone in our home lab Journey now we have a full-blown proxmox server we have a Docker VM we have a firewall we have container-based security tools with crowdsec and now we have a Nas so it's time to start using that Nas and get into some more complex setups in the next video I'll be showing you how to set up your very own media center with Plex and jellyfin see you on the next video foreign [Music]
Info
Channel: Jim's Garage
Views: 5,386
Rating: undefined out of 5
Keywords: NAS, truenas, linux, proxmox, DIY, build, storage, samba, ubuntu, windows, smb, budget
Id: ilqH_V4v-Gs
Channel Id: undefined
Length: 30min 14sec (1814 seconds)
Published: Wed Jun 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.