How to build a storage server from scratch and why you SHOULDN'T!

How to build a storage server from scratch and why you SHOULDN'T!

Show Video

there are some incredibly well-built storage platforms like tras scale that allow you to take your own hardware and turn it into a complete TurnKey storage solution that takes all of the complexity out of building your own storage server by hand I use tras scale for all things storage in my home lab and it's great but it got me thinking could I build my own complete storage system myself and what would that even look like so let's find out hey there home lbers cell hosters it pros and Engineers Rich here I'm going to make a bold statement I think that we all take sof for like trass scale unraid open media Vault Sigma Nas rockstore and others for granted and it got me thinking can I build my own storage system from the ground up using individual software packages available and since I have yet to push my new storage system into production yet why not try take you guys along with me and at the end give you my final thoughts one more thing guys this is going to be a journey I expect to make mistakes and I expect to screw some things up follow along at your own risk and don't hesitate to tell me in the comments where I screw up what I'm doing wrong or what I could have done better I think the best place for us to start here is with a list of the features that my bespoke small batch handbuilt server should have let's figure out what features This Server should have since I'm trying to make this system compete as much as possible with the other established storage platforms available on the market today let's go over what it should be able to do the first and most obvious feature is going to be file serving what good would a storage server that didn't serve files B so my system needs to be able to serve SMB and NFS at a minimum next if I I'm going to compare or compete with the true Nas scales and unres of the world I need to have virtualization functionality so we'll need to add that along with virtualization it would probably be wise to be able to run containers as well so we'll be adding the ability to run containers to the list with all the services out of the way we need to make sure that my Homebrew storage server has all the general functionality to manage it installed as well because my physical Hardware has 24 bays and no raid card I want to make sure that it has the ability to utilize ZFS for data protection snapshotting and performance all want some way to view or monitor all the temps and sensors that are embedded in the hardware so we'll need something for that and the biggest thing here a gooey this thing needs a graphical user interface yes I know we can just manage all this with the command line but really if I'm going to try and compete with the other storage software that's out there I need to be able to manage it from a web interface all right that is a pretty good list let's move on features defined I think the next step here is to decide on an operating system obviously this thing was going to run Linux from the GetGo but which distribution should I use choosing your favorite Linux drro is like choosing your favorite pizza toppings I think pineapple belongs on pizza and you might not and likewise some people like Arch and that's fine I have always been a heavy user of Debian and auntu so naturally auntu server is my OS of choice and of course I'll be using 2404 LTS because I want the 5 years of security updates that come with it by all means tell me in the comments what drro you choose and why now that we've got the OS decision made let's start filling in the other packages we're going to need for this Sy system for SMB we'll obviously be using Soma for NFS we'll be using NFS server for virtualization we'll be using KVM and qemu four containers we'll be using podman for ZFS support we install ZFS utils and to monitor thermals we'll install LM sensors and for the guey yes let's talk about the goey I spent a lot of time really thinking about the best way to decide on which gooey would best suit my artisanal bespoke small batch storage server there are a lot of ways you could take this but collectively I think it boils down to two different approaches a single painted glass to rule them all like you get with trass scale unraid and others or Death By A Thousand Cuts of different individual goys and portals for each component of the system honestly I don't know which is the right approach both have their advantages and disadvantages you can make the case that there are very limited options for a single painted glass Management goey in Linux compared to having a variety of very specific dedicated management gooey options for each individual service again I'm trying to build my own storage system here that takes its inspiration from the established storage system out there already so I want to go the single painted glass route this means I really only have two options that I know of to achieve this in Linux cockpit and webman the cockpit project is an open-source web-based server management tool that originated in 2014 as part of red Hat's efforts to simplify Linux server Administration designed to provide a user-friendly interface for managing servers in real time cockpit allows administrators to handle such tasks as monitoring performance managing storage networking services and even containers without needing extensive command line knowledge it was initially created only for red hat-based distributions but has since expanded its compatibility to include other lengths distributions like debban and auntu built to be lightweight and modular cockpit enables extensions for additional functionality making it highly adaptable as of today it remains an actively developed and widely adopted project with strong community and Enterprise support webman is an open- Source web-based system administration tool that was first released in 1997 by jamy Cameron to simplify Unix and Linux server management through a browser-based interface it allows administrators to manage various aspects of a server including user accounts DNS file sharing databases and software packages all without relying on commandline expertise written in Pearl webman is highly modular enabling users to extend its functionality with additional modules or customize it for specific needs over the years it has grown to support a wide range of Linux and Unix based systems becoming a popular choice for both home users and Enterprises if you know of other web goys for management by all means I want to know what they are For Better or Worse these two projects are are the only two real single panes of glass goys that I am aware of so the question becomes which one is right for the job let's quickly go over some of the highlighted differences between these two goys cockpit is written in C and uses HTML 5 JavaScript CSS react and patternfly for the front end webman is written in Pearl 5 and uses HTML JavaScript and CSS as well both have a modular framework where you can add additional functionality to them to extend their capabilities both feature basic core Administration functionality out of the box like patch Management Service management network configuration and more both platforms are open source and are active projects that are wellmaintained both platforms look nice and they're clean and easy to navigate both platforms support Debian and auntu natively in terms of Advanced Services out of the box cockpit lacks the ability to manage Advanced Services like buying DNS mail or database services without additional tools webman has more Advanced Services it can support out of the box with Native modules for DHCP DNS mail transports and a lot more for the most part the list of features is nearly at parody so which goey am I going to deploy I'm going to deploy cockpit and here's why one I personally like the UI of cockpit over webman because I think it's a bit more modern and lightweight two webman doesn't have a module for ZFS and since I'm using ZFS for storage that's a necessity three hands down webman has far more standard and advanced modules out of the box and cockpit but this is a storage server only and I don't benefit from having a module for DHCP or buying DNS and so on and there's one more Factor here that leans into my decision cockpit has modules freely available that are made by 45 drives that I want to take advantage of things like a module for ZFS storage management and with that out of the way I think it's time to build the system I'm going to walk through this with you step by step from OS and package installation to module install and config to storage deployment any snag I hit along the way I'll call out or you can skip to the end and get to my tldr and final thoughts let's do this the first bit of this install is going to be happening via the ipmi interface of the server so I can capture the initial install inst process of auntu server 2404 on the host after that we'll do everything via SSH I won't bore you with the mundane details of installing auntu I booted off ventoy launched the 24041 live CD and ran through the setup everything was fine until I got to the disc configuration I have two 480 gig Intel ssds in the back of this host that are there for boot functionality only so obviously I wanted them to be a raid one mirror for redundancy however for the life of me I couldn't figure out how the hell to set up an MD array as a boot disc for auntu and it turns out after a lot of searching on the internet the short answer is you really shouldn't do that with MD and auntu so I said screw it and moved on I am disappointed that building a software mirror during the install process wasn't something that I could figure out I've have seen articles online where people have figured it out but the collective wisdom on the Internet is something to the effect of just because you can doesn't mean you should so I moved on as an aside you can easily do this in truna scale uninstall so there's that one more thing if you watch the first video I did on the system I threw out a call to everyone watching to help me choose a name for the server and there were some really good suggestions and in the end I settled on Ultra sand anyway OS installed let's get the second phase of this going let's get all the things we decided earlier in the video installed and set up on the host I'm going to bounce through this relatively quickly to save you time but I will show you the commands I'm running and I'll make sure to provide a link to them in the description to our website if you're following along let's get to it all right let's get logged in this is the first time officially logging into this freshly minted server so of course my client doesn't trust it we'll type in yes and hit enter to move on and then I'll type in my password the first thing I do when I log into a fresh installation of Linux is to update the entire system before doing anything else so I'll sudu as root using sudu dasi and enter my password and then use this command this command updates all the package repos on the host installs all waiting updates including kernel updates cleans up after itself and then reboots the system after a brief Interruption due to rebooting we'll get lged back into the system and again issue a sudu dasi to elevate my console to root privileges I think the first place to start here is with the cockpit goey it doesn't have any dependencies on any of the other packages we're going to be installing so we'll knock that out first we'll use the command apt install cockpit Dy and hit enter to install it one more command to finish out the cockpit install the command system CTL enable Das now cockpit. socket make sure that cockpit starts up with the system every time it reboots all right all done with that let's just double check to make sure it's working we'll pop open a browser and enter in the URL to the server at http/1 72241 3990 and hit enter boom there it is we can log in just to make sure all is well and it all looks good I don't want to spend too much time in here just yet since we have a bunch more stuff to install but the tldr is that cockpit is up and running moving on now let's get ZFS utils installed on the host to do this we'll use the command AP install ZFS utils - Linux Dy and hit enter ZFS utils provides the user space utilities to manage and use ZFS it includes essential tools and utilities for creating configuring maintaining and interacting with CFS next we'll install Soma the command we'll be using here is AP install s-y Soma provides SMB Network file serving functionality SMB is the file share protocol used by Windows and is necessary for making Network shares available from the storage server to the rest of the network along with Samba I wanted to provide NFS shares as as well so we'll be using the command apt install NFS kernel server-- y NFS or network file system is a file sharing protocol used primarily between Linux and Unix systems and you see it used a lot less these days I use it for mounting file shares between my Linux VMS like nexcloud implex ZFS utils Soma and NFS are really the core file system and file sharing packages we need to create a file server everything else we're about to install from this point on is more about creating a feature parody between TurnKey systems like TR scale and unraid now let's get virtualization support installed and configured here's the next command apt install qm- KVM followed by vert dmanager followed by livert D clients followed by bridge-utils followed by livert D D- system followed by vert inst Dy this string of multiple packages will install KVM qmu vert manager and the other supporting packages will need to run virtual workloads on the server now that's done we need to enter the command system CTL enable livert D which will configure the host to start KVM on boot which will be necessary if we want any of our virtual machines to boot when the host boots up we're not quite done with the virtualization commands though we'll need to add my user to two groups on the system so I can create manage and maintain VM workloads the first command is user mod space- lowcase a capg livert followed by my username and then enter and the second command is user mod space- lowcase a capg KVM and my username and again enter all right all done let's move on one more big feature to add to match all the turnkey storage systems is something to run containers to install podman on our host we'll type in apt install podman Dy and hit enter we're using podman over Docker because cockpit only supports podman so that kind of forces our hand but podman isn't any less functional than Docker and the commands effectively are the same so we're good all right one more thing we can do really quickly related to podman we can enter an appt install p-p podman Dy and hit enter this installs the cockpit module for managing podman in cockpit so we might as well do that now one more package to kick in this round and that is LM sensors we'll type in the command apt install lm- sensors Dy and hit enter LM sensors is a Linux utility that monitors Hardware Health by providing information about various system sensors such as CPU temperature fan speeds voltage levels and other related metrics I want to be able to see The Thermals and health in cockpit and LM sensors is how we we do that now that LM sensors is installed we need to quickly configure it we'll type in the command sensors D detect and hit enter sensors detect is a command line utility included with the LM sensors package its purpose is to detect the hardware monitoring sensors present in the system and generate the necessary configuration for LM sensors to read data from them we'll say yes to all these prompts and then yes to updating the config file let's quickly jump over to cockpit to make sure everything is looking good logging in we can see everything looks functional so let's continue with the installs phase one installs out of the way let's talk about what's next in terms of cockpit we really only have it and the podman module installed so now we need to finish up the rest of the module installations this is the list of currently available modules or applications as they're called for cockpit there are a lot of them some of them like the storage Network and software updates applications are installed with cockpit by default so we won't need to add those but we definitely will want to add the virtual machines application for controlling and managing VMS the diagnostic report cuz why not and then further down we get to the good stuff from 45 drives 45 drives has a dedicated ZFS Manager application for cockpit which will definitely add we'll also add their file sharing application for managing Samba and NFS shares and their navigation application to get a nice graphical file manager there's one more application not made by 45 drives to give us graphical access to our LM sensor data so we'll add that too as an aside there are also applications for tail scale head scale and Cloud flare tunnels if that's something you're looking for as well we'll be skipping in those and focusing on the list previously mentioned let's get everything installed all right let's get the rest of the modules installed for cockpit let's start with adding the virtual machines application to cockpit we'll use the command sudu apt install cockpit Das machines Dy and hit enter now that's done we'll install the SOS report application we'll enter in sudu app install cockpit D SOS report Dy and hit enter perfect now let's get the 45 drives ZFS application installed based on the installed documentation on their GitHub we'll need to pull down the project using git and then copy the data over to cockpit so we'll enter in the command get clone followed by this URL and hit enter now we need to move the data we just copied locally over to its final location on the file system using the command sudu cp-r the CFS manager is now installed all right next is the 45 drives sharing application for cockpit we'll first be running the command curl space- lowcase s caps capl followed by this URL pipe sudu bash and then hit enter this command will add the 45 drives app package repo to our system making it a lot easier to install much of the 45 drivve software and also allowing us to get automatic updates when 45 drives pushes them out now that's done we need to run an apt update to update our host pack package list since we've added the new repo all right we're ready to install the 45 drives sharing application so we'll toss in this command sudu apt install cockpit D file-sharing Dy and hit enter in addition to the 45 drives file sharing app the project also recommends installing the 45 drives identities app as well so we'll do that by entering the command sudu apt install cockpit D identities Dy and hitting enter just two more apps left to install next is the final 45 drives app called Navigator which provides a really nice file manager for cockpit we'll enter in the command sudu apt install cockpit dnor Dy and hit enter all right that's all the 45 Drive software our last application is the LM sensors application this big block of text downloads the LM sensors app for cockpit then untar it then moves the data to the correct location for cockpit on the file system then cleans up by deleting the untar directory in files and then finally deletes the downloaded tar archive we'll hit enter and kick this off all right from this point everything I can think to install is installed all right here is the dashboard for cockpit we've got a few cards on the right for system Health usage system information and configuration on the left in the navigation pane we have a bunch of additional sections that weren't there before let's tear through them really quickly logs gives you a place to view CIS log events that have happened on the host at the top of the window you can filter on time and priority pretty straightforward ZFS is the 45 drives Z CFS Manager application we installed a bit ago first time opening the app we're asked to set initial configurations I'll leave it as is and click configure all right there are no storage pools found because we haven't built any yet we'll get to that later moving on storage is a built-in cockpit application that provides visibility into all of the storage devices on your system you can also create partitions MD arrays and so on unfortunately the one thing you can't do in it is create ZFS pools hence why we have the 45 drives CFS manager app installed next Network for all things networking on your host you can change address configurations build bonds teams ad vlans all the typical stuff you'd want or need in terms of network Management on your host podman allows me to create and manage Docker containers so that's there which is great next is virtual machines which allows me to provision out storage pools configure virtual networks and build out VMS on the host accounts is a built-in cockpit application for managing local users groups and access rights on the box Services is another built-in cockpit application for Manching services on the host Navigator is the 45 drives file management application we installed this gives you the ability to do more basic file management functionality on the host via cockpit like upload download rename copy move delete files and folders from the host file sharing is another 45 drives app we installed just a bit ago it provides a gooey way to manage SMB NFS and even ice scuzzy shares from the cockpit guey endes is also a 45 drives up we installed it provides you with another way to manage local users and groups on the host and also provides you with a log on history at the the bottom down below in tools we have an application section that for some reason only includes the cockpits Project's own applications and none of the others we've installed all the enters here are also directly represented in the left navigation pane as well diagnostic reports is uh apparently broken so that's cool sensor shows us all of the dedicated sensors on my host it allows me to convert Celsius to Fahrenheit because I'm a lazy American and expands out to show me a lot of detail about current temps Max temps and critical temp limits for my CPUs and other thermal sensors and also shows me my current power draw on the host which is great I am always asked in the comments of my server videos how much power does this host consume and the answer is an average of 254 WTS there it is software updates is also uh apparently broken so we'll need to figure that out since that's kind of a critical thing to have in the guei and finally terminal is just that access to the command line from the web guei cool so for the most part things are functional with the exception of the SOS reports and getting access to software updates before we attempt to troubleshoot the update issue let's see about getting a ZFS pool built for storage using the 45 drives ZFS app in the ZFS application we'll head over and click on create storage pool to get started looking at this window I can instantly tell that we're very light on using the advanced features of ZFS it looks like viia the skoy the best thing we can do is just create a single volume let's run through it first off we need to give the pool a name so I'll call it big pool the next step is to decide on which level of protection we want for our data vdev we've got all the standard hits here disc for single Drive mirror for disc mirroring and raid Z1 through Z3 noticeably missing here I don't see any options for special vdf types like log caching metadata and so on which is a bummer I'll leave this set to raid C2 for two dis Rundy and move on the next step is to select the discs to add to the pool there's no way to select all the drives that I can see and then deselect the ones you want so you'll have to go through them one by one and select them you have some configuration options to make about the pool like sector size record size d duplication options and a refresher vation that feels like a typo you guys tell me if I'm wrong I do like that you can also set options like Auto expansion Auto replace Auto Trim and so on I'm going to select automatic trim since these are SSD drives and I want them to stay fast let's create this pool now ZFS pool creation was easy enough however I'm bummed you don't have any options in the guey for creating additional vdev types if I'm being honest I don't use any special vevs in my production storage anyway but I know others that do and you can do this in true as scale don't get me wrong I know you can do all this via the command line using ZFS utils and whatnot so it's not like you can't actually do it at all just not through the app that I've installed for cockpit oh and one other thing I didn't show it but the ZFS app also allows you to create standard data sets once you've created your pool so you can carve up your pool as many ways as you'd like to organize and segment your data now let's try to figure out what's going on with the updates the error I'm getting was cannot refresh cash whilst offline so the first thing you do in a situation like this is copy the entire error message from the screen and go to the Googles searching for the error on Google netted me some useful answers the answer to the problem for me was found on Reddit cuz well of course it was and the answer was I needed to add the line renderer colon network manager to fix this so let's do that now sshing back into the host we'll type in the command sudu Nano Etsy netplan - cloud-init yaml and hit enter followed by my password since I need sudo rights to edit this file your Cloud andit file might have a different number in the file name so don't be surprised if yours is a 10 or something like that all right this is the network configuration for the host we need to add our line at the bottom so we'll head down below the final line and paste it in yaml is very structured so make sure you make the start of the statement align with the start of the last line as well or it might not work all done here let's hit CR o and press enter to write out our changes and crl X to close Nano I'm going to reboot the box now using the command sudu reboot let it come back up and see if that fixes our issue now that the host is back up back into cockpit I noticed that we have an error under Services looks like our changes caused system D- Network D- we- online to fail to start another search on the net States that's expected behavior and we can disable that service from starting on the box it will have no impact on the system let's check on software updates now and it looks like it's working that wasn't too hard to fix but it'd be really nice if it wasn't an issue to begin with I'll go ahead and kick off updates by using the install all updates button at the top updates ran for quite some time got most of the way through installing and then blasted me with yet another error message this time something related to being unable to override a Json file that coexists with another package a refresh of the page shows that most of the updates were installed as expected including the security updates and we have a few left over from the previous attempt I'll try again and failed again something for me to troubleshoot on the containers common package Super One Last Thing Before we close out the video let's set up an SMB share and make sure it works for storing data inside the 45 Drive sharing application our first stop is to click on the Plus in the sharing configuration section we need to give our shareer name so I'll use big poool next we need to provide the path on the file system that we'd like to share so I'll enter in/ big poool and select it as well for the sake of Simplicity we'll enable a few permissions first we'll enable guest okay then inherit permissions and click apply boom just like that we're done let's check to make sure we can see the share in Windows and create a folder in it all right I'm on Windows 11 here and I've used the UNC path of 172 2413 your IP address for your host will likely be different I can see the new share we just created called Big poool let's enter it and make sure we can create data inside of it we'll right click and add a new folder and name it hello perfect everything's working one last stop let's take a look at the folder using the navigator app in cockpit back over to the guy we'll head up and click on Navigator now we'll open big poool and we can see my created folder we'll right click on it and delete it and we're done I'm not going to continue to troubleshoot this with you guys on here cuz it's just kind of painful to watch based on the functionality that's up and running though we've completed our goey storage sharing monitoring and so on so let's talk about how I feel about doing this up front I'm going to tell you this kind of sucked was I able to build a storage server from the ground up using individual package installations and have a functional storage server yes absolutely is it anywhere near TurnKey like scale or unraid absolutely not did I learn things yeah I certainly did let's talk about what I learned first I learned that it is a nightmare to attempt to create an MD mirror for a boot install in auntu server that was a bummer thing is what you guys see here on the screen is only a snippet of like 45 minutes plus amount of effort that I went through trying to figure that out attempting reading reattempting researching just to find out the general consensus is that you probably shouldn't do this thing anyway being as I spend most of my time working in Virtual systems I honestly never think twice about redundancy at the boot level because it's a non-issue in virtualization but I feel like it's critical for physical hosts so I'm not sure why it's not easily baked into the install process for auntu by the way this is something that you can do trivially in tras scale in the install process so there is that secondly I don't feel like I was able to achieve that true single pain of glass gooey that I had imagined in my head sure I got what I needed in there for the most part but it's not the ideal solution that I was imagining and to be honest at best it's just m me third and this will probably be a controversial opinion here but cramming all these different features into creating this all-in-one package and then having to deal with broken updates with podman containers just reminds me why shoving everything together in a single Linux box kind of sucks and it also really makes me appreciate what we get from the turnkey Solutions out on the market the big benefit in using something like scale unraid or open media vault is that there are people working behind there to make sure that everything just works and that updates happen without issues for Downstream users don't don't get me wrong I'm fully aware that things break in those platforms as well I've had my share of BS and tress believe me but I know they'll get fixed and the best part is I won't have to do it so final thoughts here if you want to Endeavor to do something like this go for it maybe my experiences will help inform yours or maybe not or maybe you don't care about a gooey and that's cool I respect that in the end though this really has been a good reminder not to take those projects for granted they're doing a good job and overall making all of our Lives easier in the home lab and that friends will do it for this video if you liked it throw us a sub and like and if you have a beef with anything I've said here let me know in the comments below special thank you to our YouTube members you guys help keep the lights on and we thank you for it if you'd like to help support the channel consider becoming a member or buying some of our swag it'll helps us keep making these videos and now that you finish watching this video how about checking out this place over of other great hom Lab videos we've done in the past if you're looking for your next great homelab idea we can help [Music] oh

2025-02-17 08:08

Show Video

Other news

Proficy 2025 Webinar Series_Proficy Historian: Hybrid Data Management at Scale | GE Vernova 2025-03-17 05:43
Nero AI Video Upscale Pro 2025-03-16 09:41
IBM's Arvind Krishna on the Future of AI and Quantum Computing | SXSW LIVE 2025-03-14 10:17