DietPi-OS Files stored & backed up by Truenas | iSCSI Drive | opne-iscsi setup | Proxmox Home Server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and thank you much for watching this is me Mr P and this is another episode of the proxmox tutorials in this video we'll show you how you can set up the iSCSI drive inside your virtualized true Nas virtual machine and how you can link that is because you drive to let's say a Raspberry Pi running type iOS and that will make that the diet pios files will be stored on your true Nas virtual machine with the snapshots and a backups and if something happens to Raspberry Pi to the diet pios installation on your Raspberry Pi you have all the data files still stored inside your true Nas safely backed up and easy to restore couple of things I want to mention before carry on into this video yes all this is going to be done for Raspberry Pi but I will use the Raspberry Pi dire pios virtual machine just easier for me to record this easier for me to post edit of it it's just I'm lazy I I just can't be bothered connecting disconnecting this Raspberry Pi from the capture card and then doing all the sync post-processing editing so basically the Raspberry Pi diap iOS ID number 800 will represent this Raspberry Pi so everything what I will do in this VM with the diet iOS can be easily done with any version of a diaper iOS so first thing what we need to do obviously I'm going to start this virtual machine technically the same way as you will focus for example plug in this into a power running type iOS and get everything set up first so my virtual machine of a Raspberry Pi running tire pios is rooted again this ID number of 800 virtual machine represents any Raspberry Pi computer running type iOS any computer that is running type iOS just to again mention that everything what I will do in this virtual machine can be easily replicated on any device that is running diet pios so virtual machine is running someone needs help to get this prepared to use Isis first thing what IP address I do I do received okay so it's 192.168.178.69 nice remotely connected to that virtual machine to to that Raspberry Pi Let's Pretend This is Raspberry Pi and it's already here first thing I need to do is just quickly update and upgrade all the packages just to make sure that this Raspberry Pi is up to date and it has all the packages installed while this doing that uh what we're going to use is a package called open Ice guys is internet small computer actually what is called internet I'm just gonna double check that's yeah internet small computer system interface in a quick tldr it's a protocol it's a way to connect storage to the computer and that storage can be anywhere in the world so uh this is running my Raspberry Pi plus pretend Raspberry Pi is up to date so we need to install open skazy to do that we need to type apt install open dash iSCSI enter and that will take no time to install it's just couple of megabytes uh it's actually 2.1 megabytes in size press 1 Y and enter and open skazy is installed so right now this Raspberry Pi this virtual machine is ready to accept connection to the Target of iSCSI and I'll explain to you how everything is Works hi everyone Mr P from the future here a little adjustment to this part of the video we need to change the iscs configure file to initiate is the agent to ReDiscover and reconnect all the ice because it drives every time you machine with a diet bios will restart to do that you need to type inside the terminal while you logged into the Raspberry Pi nanospace Etc D dot config press enter and if you scroll down a bit you'll find the line which is going to say node dot startup equals manual you need to put the hashtag in front of it to comment that in and couple lines above is going to say node.statup equal automatic you need to delete the hashtag to comment that out Ctrl X to close y to save enter to confirm and right now every time you restart this machine which runs diet pios the I schedule automatically ReDiscover and automatic will reconnect all the targets that will you will connect to this machine Let's right now connect to True Nas I Can See the tag number is 24 so my true Nas IEP in address should end with 24 press enter on that and log in to my true Nas which is running inside the proxbox I'm just going to open proxbox as well so trueness is connected everything's great all my two terabyte drives ticking nicely so next step is we need to prepare our selfie ice because it drive inside this true now if on the left hand side if I click on storages and if I drill down all the way to the all the subfolders this is how we set up as you can see it says file systems and I have data inside data I have data set proxmox inside that I have PVE backups PV drives Etc what I want to do is under proxmox actually under data I'm gonna Mouse over over data I'll click on the three dots and instead of creating data set uh yeah actually let's create data set let's call this Raspberry Pi I'm doing that because maybe in the future we'll have more than one Raspberry Pi that will require the ice guys so I'm creating data set for that so let's wait for data set to get created and like I showed you in the previous videos we need to get ACL sorted so I'm Gonna Change group from root to Dex and why it's Dex I explain to you while I was just giving a demo how to set up to NAS so apply to a group decks great let's apply that so right now it's doing the ACL updates so right now under data I have a data set called proxbox and a data set called Raspberry Pi a mouse over Raspberry Pi click on the three dots and choose Z volume and this is the iscos Evol you will need to set up so name will be let's say for example this is a Kodi case for Raspberry Pi so I'm going to call it Cody and then there is a this field which is called size for this Z volume with the data sets when you're creating a data set it will take the storage of all the available space with a 0 Z volumes or is because you drives you need to pre-select how much storage you're allowing this to have so you need to think ahead okay this Raspberry Pi will use maybe 250 6 256 gigabytes maybe 512 gigabytes maybe a terabyte of storage so for this demo uh the SD card that is inside this Raspberry Pi is 32 gigabytes but let's say I want to Triple quadruple that let's say I'm gonna give 256 G so 250 gigabytes size because the drive will be used for this Raspberry Pi so I gave the name I gave a amount of storage scroll down and click save and that's it and right now if I expand the data sets right now on the Raspberry Pi as you can see it says volume the all file systems and this is just volume and it's already pre-selected amount of storage this drive allows to have so this is done next thing what we need to do on the left hand side we need to go and click on the shares and inside here we have a Windows Samba we have you Unix we have web dev and we have block is share Target we click on the configure and now there is a base name I suggest this to be changed to something very easy for you to understand because you will have to punch that in something simple so I'm gonna call this is Dex here we go so iska ZX and I click save so right now the target okay is asking me to enable the service because it's first time doing this so yeah enable the service that means that if I go back to shares this is right now as you can see it says running and the others are stopped so back to configure and name exchange that's great now I will click on the wizard click on the wizard give a name so I'm going to call this Cody it's gonna be device I'm sharing via is a protocol I'm sharing the device click on the drop down and I choose tank slash data slash Raspberry Pi slash Kodi and this is the Z volume of virtual physical kind of hard drive that's what I'm sharing with this block under sharing platform I will choose use modern OS and click next next and the portal I'll click a drop down and you will see nothing here like I do click new and right now uh there's now yeah leave like this and click next under initiator I'm gonna leave everything as it is and this one I'm click save actually hold on oh yeah I saw it under portal you need to click add an IP address I'm gonna do 0.0.0.0 and 3260 is a default Port this means that any IP address is accepted to connect to the Z volume if you know already Raspberry Pi in my case this virtualized Raspberry Pi IP address is ending with 69 so I would create in here IP address ending with 69 that means that only this Raspberry Pi can connect to this target I'm just gonna do zero zero zero to say everyone can access within my home network and now I can click save that's it that's done click save again on here just to make sure and right now back on the left hand side and the shares I should see block iSCSI has a code inside here that means that is binge shared across my home network go back to turmox and right now I do have Isis installed or open isks installed and this let's pretend Raspberry Pi which I'm virtualizing because it's much easier for me to post edit but let's say this is the one that we sshed into so let's clear the screen and right that's right iSCSI ADM Dash m stands for mode and the mode we're gonna use you can write Dash M or you can write like this I'm just gonna put Dash M called I want to run iSCSI admin in the mode called Discovery and I want to discover Target which is static Dash B that means on a IP address 178 and what's my true Nas IP address is 24 so you enter your IP address of it through Nas and press enter as you can see it's detected that's inside there there is a iSCSI Dax set colon Kodi so this name is Dex colon Cody this is the one we change the name to so imagine hover is on the shares so imagine in the future if you haven't changed that you will have to punch all the alien in The Next Step but right now hours is very easy which is is it X colon Kodi and now the fun part is we need to make that Raspberry Pi this rice di pios connect to this ice guys yes we discovered it does exist so right now we need to go and start adding that in to do that I need to type iSCSI I because the ADM Dash M node that means that I'm acting as a node which will connect to the Target and the target is a shared Z volume inside my virtualized true Nas virtual machine we put the target name so put Target name and this is where you need to enter this target AP Target name Dex iSCSI colon Kodi so this is where I enter in this name if I haven't changed the name in here under the shares and then choosing guys cousin configure all this thing that was in previously in here I would have to remember and I would have to enter every time that I want to connect to this Z volume Target so we have a Target name next we're going to do portal that means that we're giving um IP address where actually to connect and then again in the in the quotes we put IP address of the true Nas in my case is ending of 24 so true nice ending with 24 enter that in that dash dash login if I do that uh why you don't want to find this the problem was I had the iSCSI decks in the wrong way around I had Dex ice Skies but it's actually as a a little hint above is a deck so that's the one I need to enter so quick rundown I'm running Ice crazy iaadm command with the mode of node I'm giving her Target name of iso ZX colon Cody this is the same one as inside here as you can see iSCSI decks followed by colon Kodi and the Kodi is means what I am sharing inside the here so this is the name I'm picking from then a portal is AP address the port number you can enter the port number you don't need to enter the port number but it's gonna pick port number by default which is 3260 and then login and press enter so as you can see a bunch of stuff showed up and the login to interface deterior is successful and now if I'm gonna run DF I will should see a drive here lsblk so here we go SD DB is 256 gigabytes it's like a physically I attached a hard drive of 256 gigabytes of this Raspberry Pi this is how it showed up and now next thing is we need to format this virtual Z volume drive to do that inside Die app IOS you need to type diaper dash Drive underscore manager and press enter and this is a drive that we connected as you can see there is no file system and the format is required I'll press enter on that I'll say yeah format that yes format that this gives me a bunch of information that is about to delete everything and partition delete all the partition everything will be formatted I'm going to say okay and press enter and right now dire pios formatting this Virtual Drive that is host inside trueness but as far as the dire pios thinks about this drive is like a physical Drive I just plugged in instead of mounting into this weird location I'm going to delete all that and I'm going to put the name called iscasi so okay on that okay and that back exit and okay and now if I'll put DF I should see a message showing up at the bottom as you can see it says Mount at Sky Z and it's 256 gigabytes of this Virtual Drive that is being hosted inside the truenas now that means that I have for example let's say this 32 gigabyte micro SD card inside this Raspberry Pi and I have virtually attached 256 gigabytes of a drive diet Pi was our diaperos allows you to move the dial Pi user data from one storage to external storage and in my case external storage is discussy to do that I'm gonna write a command dire Pi again diet Pi Dash Drive manager select the drive which is says here etextd4 capacity 150 250 ish about 251 gigabytes enter on that and scroll down a bit or go down a bit until you find user data I'm gonna enter on that and it says your user data will be moved from internal micro SD card to this mounted drive I'm going to say yeah I'm fat I'm happy with that and that's it so right now yes all the dire pios dry files that requires to run diaperos is still located on micro SD card but all the user files all the setups that I will do with the dock and Etc and Etc they're already now stored inside this virtual 256 gigabyte drive that is hosted inside the true Nest so right now everything is stored inside true Nas and next thing I will go back to a true NASCAR truenas dashboard and the data protection I'll click on that and it says periodic snapshot task or click add and what kind of data set I want to take a snapshot of I'm going to say tank slash data that means that basically everything that is below this will be taken a snapshot and what the beauty of the true now snapshot is not like a backup where for example you have a gigabyte file and you back that up it backs up the gigabyte again so you end up with two gigabytes of storage being taken by taking one backup if you want to have increment backups let's say you want to keep daily backup of seven days so one gigabyte of your storage will end up being extra of the seven gigabytes of storage because it's going to backed up seven times with the true net snapshot the snapshot will take the difference between the changes from the previous snapshot so if you have one gigabyte of file and you snapshot that it will create a small file snapshot file that will say okay all the Z ones and zeros this is the location how these all ones and zeros are done and if that's one giga gigabyte file changes it only will snapshot the changes it will not start creating the massive files as a backup would do so this is why I'm going to go inside a data protection under periodic snapshots I'm going to say I want to backup everything below the data I want to keep for two weeks that's fine and naming scheme I will leave as Auto and then the schedule I'm going to click on that I'm going to say custom and what I want in here is basically like this I'm going to say asterisks on here so that means that as you can see here system time zone I'm in Los Angeles I will change that in a minute but this is takes a snapshot hourly of a data set I'm going to click on that and it says it's going to start at the midnight and it will finish one minute before minute I'm gonna say save that and because I haven't changed the time zone I'm just gonna do quickly that I'm gonna go into system settings then General scroll down until localization click settings and under the time zone I'll click on that actually can I start typing in here yes I can so I'm going to say Europe slash London and click save so time zone is changed to correct way so back to data protection as you can see right now it's going to run hourly on exactly one hour or exactly zero minutes past each hour it's gonna run a snapshot and this is right now is gonna do one in 23 minutes and that is fine or running great so that means that every hour this data set with everything below with all the proxmox stuff with all the P drive so all the raspberry stuff even the Raspberry Pi Z volume code it will be snapshotted every hour let's go back to the Raspberry Pi or virtualize Raspberry Pi and in here if I go into Mount iSCSI inside here I have a folder which is lost and found we can actually delete that so inside here I have a data user diaper user data and this is the location of all the files for user diapie and inside this folder for user dial Pi let's say for example I have music pictures videos Docker data because I have a Docker installed then low let's say I will create another folder important stuff and the number folder let's say subscribe and another folder please click like so let's say I'm have all these things right stored inside this Virtual Drive tomorrow for example let's say tomorrow the SD card of this Raspberry Pi running diaper with dies tomorrow and all the updates all the programs that are installed and it's running yes they will disappear with this micro SD card but all the folders all the files all the stuff I has I have set up and then loaded they're gonna stay here and the beauty of this that the true Nas will take a snapshot every hour of the Z volume coded and if the micro SD card will die tomorrow I can swap MicroSD with another micro SD card running type iOS and I can relink this Z volume back to the new micro SD card new diap iOS installation and I will have all my files backed up there is a downside of using the iSCSI with the iscs is that only one device is allowed to connect to a scuzzy is z volume you can have two Raspberry Pi is connected to one single ISO Drive where with the samba shears you can but with the sample Shear yes I can create the data set calling Kodi backups and I can go inside here and mount the Samba share to this diaphras and try move the user files but the problem is if I'm gonna try to move the user files like I did here use the data I can't move the user data files to assemble mounted Samba share where is it like I said to this diaperos installation ISC has a drive as far as this diaperos installation thinks it's just a physical drive connected to the USB port with the snapshots right now let's go I'm inside the storage and I will go on the Kodi click on the three dots and I'll click create a snapshot which is going to do a manual snapshot snapshot is done I'll go at the top it says snapshots click on that and choose snapshots as you can see right now it's created the manual snapshot and great right now I have a backup to go to go back to this point in time let's say for example I will go and right now backup's done go back go back go back let's say my I deleted the folder let's call it I deleted subscribe folder I deleted the um let's say stuff folder and I deleted important stuff folder a bunch of stuff I deleted by accident and delete this uh remove dash R please click like here we go I lost these all files and folders Beauty right now the true Nas I can actually restore all that how to get all this for example file retrieved from here so I'm going to click on this and it's going to say clone to a new data set I want let's say for example this one clone to a new data set so it's going to clone to this new data set where it says manual I'm gonna just delete all that and I'm going to say Kodi code E2 click save so that's saved okay under shares I'm going to click on that and the blocks I'm going to click configure click Wizard and this one I'm going to say Kodi backup okay if I can type correctly backup come on okay now we type correctly on the device click uh I will leave a device and I will choose that I want to restore actual coded-2 sharing is modern next portal it should already give me the IP address or a white listed IP address list from the previous setup I'm going to click next on that click next on that and click save so right now I have restored the iSCSI volume with the files that I deleted and let's say if I go here as you can see the files are inside mount iSCSI and I don't have nothing here because I deleted just before taking a snapshot or I deleted the files I created previously so right now let's go and do this thing excuse AMD M discover Dash and discover and then is I want Target static with the IP address of this one 24. so now I have two ice castle drives one is coded one is coded backup code is already been used so I have Kodi backup let's right now Mount that in so I'm going to do ISC come on can't even type uh AMD Dash M node Target name and this is going to be is because you Dex Cody Dash backup and then I need to go and do portal IP address of the true Nas and then log in that's successfully connected great I can right now run dial PI drive I have this drive but as you can see right now it doesn't tell me that I need to re format it because this is a copy of the drive that we used before I'm just need to mount that somewhere so I'm going to delete this and I'm going to say I want to mount this as a Kodi Dash backup great I'm mounted that in so now if I navigate to Mount I should see that one is called Kodi backup and one is called scuzzis because it's the main one and go the backup that's the backup we have and if we navigate to go to backup I have my diaper user data files inside here I have my please click like stuff subscribe and Etc folder that I created but for example I just backs and deleted so restored that back to as it was that's great let's say I restored the files I go back to the type I user drives and actually I need to exit this folder so you need to exit the folder off from the driver to try and turn Mount otherwise it's going to give you an error so go back in the drives so call the backup I'm going to say unmount that so Drive isn't mounted so it's like I I am physically unplunk the hard drive from my Raspberry Pi and now I need to type is crazy AMD Dash M node Target name because I need to disconnect this ice because you drive from my Raspberry Pi and what all this command does is basically the login command button reverse so we have the running iSCSI admin with the mode node Target name is iSCSI Index this colon code backup this is the one that we're sharing here if I click on here so code the dash backup and portal we're using portal IP address of a true Nas and I'm going to say log out they said drive has been disconnected that has been I snapshot I restore from a snapshot the drive mounted into my diaper iOS restore the files that I lost that I deleted by accident deleted stuff I got that sorted and I disconnected the drive I go back here and under code a backups I'm just gonna say I don't want that to be shared anymore yes I'm happy with that so that has been removed and under storage if I'll go to the data Raspberry Pi this says coded-2 I'm gonna click three dots I'm going to say delete Z volume and I need to get the name go to Dash 2. say confirm and click delete and that's it that's it I restore the files that I have deleted by accident from the snapshot that I created just before before basically running this test so it's a quick recap if just all this video a bit confusing you the idea for this video is of the idea for me to shoot these videos to demonstrate that you have a raspberry pipe of the micro SD card with eight 32 gigabytes 64 gigabyte doesn't matter but you have Micro SD card and we have dire pios running on this micro SD card on the Raspberry Pi or on the laptop diaper actually runs quite a lot of devices you can run an old computer and even on my on the Mac Mini 2012 version type OS runs quite happy on that device but anyway you have Micro SD card with the pios and you set up a lot of stuff on there you have a bunch of Docker containers running and they're doing all sorts of things you have a database you have the next Cloud you have file browser you have torrent torrent client you have transmission etc etc all this the micro SD card will die eventually so we're using the Port we're using proxmox and we're using true Nas virtual machine which is virtualized inside that proxbox to create the Z volume in a TLD i z volume is is drive it's an internet small Computer Connection something something protocol I already forgot what that means but basically we created a Virtual Drive of 256 gigabytes and we mounted that to the Raspberry Pi and we used dire pios built-in feature which is called move user data to different location to do that like again is using this command I go inside here it says user data and I say that this drive this is where user data is needs to be located and right now the micro SD card Die Tomorrow doesn't matter I have everything backed up using the true Nas snapshots and is backed up using the Z volume which is hosted inside true and as true Nas virtual machine I hope all this makes sense once I discovered this and set this up it just was super amazing that means that I can have a bunch of Raspberry Pi's running all sorts of stuff around my house from my octoprint to motion I CCTV and Etc but I know that all the type I use the data files will be safely stored inside one Z volume so one is because you drive that in case if a Raspberry Pi micro SD card dies well it dies I don't really like I don't have funds to start buying terabytes and terabytes with nvme drives for all my Raspberry Pi's so why not just to have all these uh files stored inside one central location and micro SD card is used just as like as a boot drive just to make dive iOS functioning on the Raspberry Pi where all the important stuff are stored inside the Z volume inside trueness and trueness does the elderly snapshots just in case if I'm stupid and I delete the file that I was not supposed to delete anyway thank you much for watching I hope this video makes sense and upcoming videos we're gonna do another stuff another amazing things with the proxmox Raspberry Pi and Samsung Dex thank you much for watching and I'll see you in the next one goodbye
Info
Channel: MRP
Views: 2,064
Rating: undefined out of 5
Keywords: proxmox, proxmox home server, iscsi, truenas iscsi drive, dietpi, raspberry pi, use iscsi with linux, open-iscsi, mounting iscsi drive, MRP
Id: -dfBmMcc9Vg
Channel Id: undefined
Length: 28min 37sec (1717 seconds)
Published: Mon Jan 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.