SMB Server In Docker with ZFS! Simple, Cheap, and Efficient!

  Рет қаралды 56,273

Jim's Garage

Jim's Garage

Күн бұрын

Пікірлер: 95
@michaelgleason4791
@michaelgleason4791 11 ай бұрын
You don't want to mount drives using the /dev nomenclature. Always use the UUID as those are immutable.
@dzmelinux7769
@dzmelinux7769 11 ай бұрын
Yeah! I told him too 🤔🤨😳😲😉
@makeitcloudy
@makeitcloudy 2 ай бұрын
true, was just a victim of the /dev when mixing up with the storage on xcp-ng, hence I second that xd
@isamaru01
@isamaru01 11 ай бұрын
Thanks!
@Jims-Garage
@Jims-Garage 11 ай бұрын
Thanks for the donation, that's very kind
@markandrow4010
@markandrow4010 11 ай бұрын
Thank you James, Tutorials are constantly getting better in every way, keep it up 👍
@Jims-Garage
@Jims-Garage 11 ай бұрын
Appreciate the feedback and support 👍
@KeithWeston
@KeithWeston 11 ай бұрын
"Don't get these. They're terrible." There. That could be your first short. Your long-form videos are nearly always must-see for me.
@Jims-Garage
@Jims-Garage 11 ай бұрын
Haha, true 😂 I might do that if I get time. Thanks for the feedback
@MenkarX
@MenkarX 11 ай бұрын
The other option worth trying would be a turnkey file server from LXC templates library.
@Jims-Garage
@Jims-Garage 11 ай бұрын
Yes, that's a good option. I'm yet to cover turnkey.
@marcosscriven
@marcosscriven 11 ай бұрын
@@Jims-GarageI much prefer using LXC for sharing Proxmox storage, then all other LXCs on the host can use it directly, rather than resharing. Plex is a natural use case here.
@domantlen6231
@domantlen6231 11 ай бұрын
LXC requires additional shenanigans if you have ZFS and want to use Docker. By default it will use VFS driver which not only is slow but doesn't support copy on write so Dockers layers instead of megabytes will take gigabytes of disk. That's why you have to manually format zfs subvolumes to something else (xfs, ext4) and keep their naming properly if you want to preserve ability to do backups from webui. I've used to create LXC, create additional zfs subvolume, format it to xfs, mount it as a second drive to LXC, copy /var/lib/docker to it and replace original /var/lib/docker with symbolic link to docker folder on that drive.
@MarcMcMillin
@MarcMcMillin 11 ай бұрын
excellent explanation and video!
@Jims-Garage
@Jims-Garage 11 ай бұрын
Thanks, Marc. Have a great weekend
@yourpcmd
@yourpcmd 11 ай бұрын
Perhaps do a follow-up to this by adding additional users with their own "folder" and permissions. Is there a way to hide specific folders from other users? Also, connecting to it using an FQDN for those users outside the network.
@plrpilot
@plrpilot 11 ай бұрын
I’ve got a dedicated NAS, so this won’t necessarily be my use-case, but it does clear up some confusion I had on the mapping of drives. Excellent tutorial. I’m going to use this as the basis for a FOG storage instance. You may want to check that out project out, as it’s a pretty cool way to swap out environments for non virtualized hardware. I use it to swap out hypervisors for testing on different hardware. It’s a no-frills, but extremely useful project.
@Jims-Garage
@Jims-Garage 11 ай бұрын
Thanks, glad it helped. I'll take a look at that.
@dionisierus5055
@dionisierus5055 11 ай бұрын
This is a great topic, Jim. Have you thought about cockpit and zfs-manager module to manage snapshot, replications, etc? Potentially, samba shares also. I think it might be easier and safer in the long run. Great work on your homelab series. Clear and complete instructions make it a pleasure to follow your videos every time.
@Jims-Garage
@Jims-Garage 11 ай бұрын
Great suggestion! I'll take a look at it
@dzmelinux7769
@dzmelinux7769 11 ай бұрын
Great idea for a low power mini server 👍
@Jims-Garage
@Jims-Garage 11 ай бұрын
I think so too!
@shootinputin6332
@shootinputin6332 7 ай бұрын
As soon as the new ZEN 5 release (getting a 9950X), I'm going to move from UnRaid for my NAS needs into Proxmox. Will be back to this video in July ;)
@Jims-Garage
@Jims-Garage 7 ай бұрын
Awesome, that'll be a monster machine
@demanuDJ
@demanuDJ 11 ай бұрын
I'm doing that the similar way but using Open Media Vault VM instead of docker container you're using
@philippemiller4740
@philippemiller4740 11 ай бұрын
I don't think you can expand raidz yet. It should be implemented on open zfs 2.3. Expanding mirrors you're tied to the smallest capacity drive within the same vdev but usually you expand mirrors pool by adding mirror vdevs to the pool so you can have mixed drives capacity vdev within the same pool
@Jims-Garage
@Jims-Garage 11 ай бұрын
Good to know. Yes, believe you can expand a mirror into raidz10
@blender_wiki
@blender_wiki 11 ай бұрын
I confirm, you can't expand raidz, yet
@chrisg394
@chrisg394 11 ай бұрын
Mirrored disks is my preferred setup in a homelab environment. ZFS lets you add drives to the mirror (more redundancy) or add more mirrors to the pool (more storage space). You can even do the reverse and remove drives. In my opinion the most efficient solution for the homelabber.
@philippemiller4740
@philippemiller4740 11 ай бұрын
@@chrisg394 I do the same, even when raidz expansion will be a thing it won't allow for different drive size while using all the capacity and downsizing either.
@stephenlau3690
@stephenlau3690 7 ай бұрын
Wonderful video, I would like to know in 6:21, if that would be better to enable Cache section with such as "write back" function?
@peteradshead2383
@peteradshead2383 11 ай бұрын
I'm using a LXC container to make my samba server and passing the full ZFS pool , added webmin to setup the share points. Being on a LXC I just give it own directory and use a mount point to it , no passing it the full drive . I got a pair of sandisk 960gb SSDs from Maplin and not had a real problem with them , I guess you have a story about yours. Most of my SSDs are samsung 870-QVOs 6 x 4TB total plus 2 crucial mx500 4TB drives .
@dktol56
@dktol56 11 ай бұрын
Any reasons why you chose webmin over cockpit to manage the shares? I've been investigating web frontends for server management. Webmin is the grandaddy but not clear (to me, at least) how capable the interface is with modern server technologies. Redhat still seems to be actively extending and promoting cockpit. 45Drives has re-written the cockpit zfs module (Houston). Looks very capable.
@chrisa.1740
@chrisa.1740 11 ай бұрын
As always, well explained and demonstrated. I'm not sure the VM + Docker is really necessary, unless you just really want to run SMB in the virtualized environment instead of directly on the Proxmox host. I've been running CIFS shares directly on my Proxmox host for a couple years now, specifically to share OS.iso image files for easy cataloguing and sharing of all my various flavors of Linux and Windows, and the connectivity works the same as this example. Either way, the data is shared out transparently to the target, it's just a different method to get there. Thanks for the video!
@Jims-Garage
@Jims-Garage 11 ай бұрын
Thanks, I do mention that you can directly serve from the host and an LXC, but I prefer to let Proxmox do just Proxmox, and I like the simple repeatability of Docker. But definitely, if it works it works
@chrisa.1740
@chrisa.1740 11 ай бұрын
Entirely fair, I just wanted to point out it was also possible without using either LXC or VM.
@QrchackOfficial
@QrchackOfficial 11 ай бұрын
@@Jims-GarageThe problem is, this way you're virtualizing a SCSI controller (that's virtio for you), that is presented with a ZFS dataset created for the VM, and then you're also putting ext4 on top of that. Each read/write operation has to update things in ext4, go through the virtualized SCSI controller, and write to underlying ZFS. And then Docker and Portainer on top of that... honestly, it would be easier to just apt install samba and avoid yet another abstraction layer. Even better, you can install cockpit with the plugin from 45drives, so you can manage your Samba config from a web UI tuned for working with a storage server, basically the same as 45Drives Storinator units - instead of faffing about with environment variables in docker-compose (which may not expose functionality of samba that you need further down the line). A smarter way to go about it would be to either pass in a HBA (so the VM can access drives directly), or if you don't have one, you could do a raw block device passthrough to the VM and set up ZFS inside the VM. That way you could create new datasets, use snapshots and other ZFS features from inside the VM. Perhaps having different shares with different settings for things like compression, deduplication, atime and so on.
@pabloszi
@pabloszi 11 ай бұрын
⁠@@chrisa.1740 I have the same thoughts. For few years I used VM, but now transformed all my services to LXCs containers which are at least 5 times more efficient and less power hungry in comparison to VMS... Finally all what I ran on strong PC currently run on small NUC which use 20 Watts instead of 100...
@mcdebugger
@mcdebugger 11 ай бұрын
I'm thinking about spinning it up on a K3s cluster :)
@Jims-Garage
@Jims-Garage 11 ай бұрын
Yes, that would be possible. There could be better options though depending on what you're trying to achieve.
@kitsunesuzuka1029
@kitsunesuzuka1029 2 ай бұрын
Hello Jim!, I finally found this guide about SMB Share. On my previous setup, I was struggling about file permissions. Upon creating a ZFS pool, I mount pointed some folders to different lxc containers. I have this the same setup now on my SMB Share and I can't modify the files that was created by other lxc containers on that specific folder. Am I missing some permission setup to be able to edit all the files on the share? Thanks!
@KTSpeedruns
@KTSpeedruns 4 ай бұрын
I think I'll stick to virtualizing trueNAS on my server. Proxmox will be installed on the machine with all the drives anyway.
@FTLN
@FTLN 11 ай бұрын
Great video, I actually do it via LXC container. What would be cool would be a ISCSI target on the same VM and having it mounted in windows, some apps dont play well with files on a samba share. Have greate weekedn, cant wait for the nexit video :) By the way, getting a Minis Forum MS01 delivered in the next week or so for dedicated firewall, cant decide if I wanna play with Sophos or OPNSense, can I get a demo of Sophos to trial for a month or so?
@Jims-Garage
@Jims-Garage 11 ай бұрын
Thanks. Sophos XG is free for home use. Limit is 4 cores and 6GB RAM which is more than enough for a homelab.
@Tgspartnership
@Tgspartnership 11 ай бұрын
enjoy the MS01 they look sweet
@shabadabadoo4326
@shabadabadoo4326 9 ай бұрын
When you add the share to the container, it's thin provisioned on the zpool, right? i.e., from your example of the 32GB NAS bit assigned to the smb container, if there's only 5GB put in that share via the container, only 5GB is used in the zpool? And you can use that single pool for multiple containers yeah?
@zyntax81
@zyntax81 11 ай бұрын
4:44 It sounds like you are saying raidz is expandable. I think it's important to explain the limitations of that to new users of zfs.
@Jims-Garage
@Jims-Garage 11 ай бұрын
I've covered raidz in a previous video and outlined how to expand. You can expand a raidz but not in the same way. You're limited by the size of the smallest drive
@blender_wiki
@blender_wiki 11 ай бұрын
​@@Jims-GarageYes, but no. It is absolutely not recommended unless you want to risk losing your entire RAID. In my opinion, this is something you really shouldn't advise to amateurs, who make up the majority of your audience. I would never take such a risk, given the high probability of hardware failure. Most people attempting this kind of operation likely do it on HDDs that have already run for thousands of hours and are probably at the maximum for RAID Z1.
@misterc3835
@misterc3835 11 ай бұрын
Can you explain or point to some more info?
@Jims-Garage
@Jims-Garage 11 ай бұрын
@@blender_wiki I agree, which is why I've extensively discussed and shown how to operate a 321 backup solution. That should remove the risk. There's also the point of personal responsibility, people are shown how to do something, they need to test and be sure to understand it before doing it (it's the 'jump of a cliff' scenario).
@Jims-Garage
@Jims-Garage 11 ай бұрын
@@misterc3835 this should help you understand everything, also check out my previous TrueNAS videos. www.truenas.com/community/resources/introduction-to-zfs.111/download
@dmbrv
@dmbrv 11 ай бұрын
Nice tutorial. Can somebody explain what is with that config.yml file? Isn't docker compose file suppose to have all the settings?
@Jims-Garage
@Jims-Garage 11 ай бұрын
No, traditionally the compose file tells how the container should be deployed. You normally supplement that with a .env or config file to configure the actual application (sometimes you use env variables in compose). A good example of this is using a separate file for password credentials.
@slayoftw
@slayoftw 11 ай бұрын
Hey Jim. This video kept me wondering how did you manage to connect to this SMB container without exposing 465 port in compose file. But then i have noticed network mode: host xD
@Jims-Garage
@Jims-Garage 11 ай бұрын
Haha, yes. I probably should have called that out explicitly.
@gaoqifen
@gaoqifen 9 ай бұрын
Is it possible to spin down the hard disk while not in use, assuming I am using 3.5” non SSD? Read somewhere about this hd-parm in terminal.
@MenkarX
@MenkarX 11 ай бұрын
Thanks for the video. Just one question, why to bother with docker at all and not to use Truenas core or OMV? As soon as the data protected with ZFS on the host, you can attach a disk to TrueNas/OMV VM and assign a singe disk to pool.
@Jims-Garage
@Jims-Garage 11 ай бұрын
Thanks. I've shown how to do that in previous videos. In this video I mention that docker has advantages in being simpler if you don't need all that TrueNAS has to offer. Plus you don't need an HBA etc. AFAIK, the documents recommend that TrueNAS directly controls the disks, it cannot do that in the way you have described.
@MenkarX
@MenkarX 11 ай бұрын
@@Jims-Garage Thanks for the answer. One more question, ZFS is using RAM for caching (ARC) on the host and in LInux by default it equals to half of the RAM. How Proxmox react on the fact that almost all memory is used? Would it deflate RAM on the VMs with balooning=1 flag in order to free more memory?
@Jims-Garage
@Jims-Garage 11 ай бұрын
@@MenkarX yes, it probably would. You can amend the amount of ram it uses though by amending the defaults (I do that for my boot pool)
@christophjahn6678
@christophjahn6678 11 ай бұрын
That is a bad idea. ZFS assumes to have direct access to hardware. If this condition is not met and something bad happens, there is a strongly increased risk to loose data.
@epictetus8028
@epictetus8028 7 ай бұрын
@@christophjahn6678 yeah, I like my data tight too.
@sozonpv
@sozonpv 11 ай бұрын
i noticed in the "Use Proxmox Cloud-Init " video you did not check "discard" when setting up your SSD or NVME drive. You only checked SSD emulation. But in this video you did. Why is that?
@Jims-Garage
@Jims-Garage 11 ай бұрын
I simply forgot 😔 discard should be clicked to take advantage of trim
@melaronvalkorith1301
@melaronvalkorith1301 2 ай бұрын
At 10:48 you mention that you will link a container that will do the same thing with NFS - am I missing it, or did you forget to add it?
@74357175
@74357175 11 ай бұрын
Question: Why not run Docker in an LXC container rather than a full-on VM?
@Jims-Garage
@Jims-Garage 11 ай бұрын
Mainly for security. More secure as it doesn't share the host's kernel and there are only minimal overheads.
@74357175
@74357175 11 ай бұрын
​@@Jims-GarageI see! Is that not also an argument not to use LXC containers, since then you share the kernel with the host?
@Jims-Garage
@Jims-Garage 11 ай бұрын
@@74357175 imo yes. There's nothing wrong per se, they work exactly as intended. I simply prefer the extra safety layer.
@74357175
@74357175 11 ай бұрын
@@Jims-Garage got it. Do you think the same way about LXC+turnkey (as suggested elsewhere in the comments) or only about Docker?
@Jims-Garage
@Jims-Garage 11 ай бұрын
@@74357175 anything using an LXC shares the host's kernel. Yes there's logical segmentation but if it fails your device is basically compromised. However, if it's just internal stuff with no exposure to the internet etc it should be fine for a homelab. All depends on how comfortable you feel. As someone discussing tech and recommending things I feel obliged to be more risk averse.
@trevsweb
@trevsweb 6 ай бұрын
I got lost and gave up
@dktol56
@dktol56 11 ай бұрын
So the shared smb storage is a virtual (qcow2 ??) disk on an underlying zfs dataset managed by the proxmox host. Seems like extra overhead and potential fragmentation from the sparse nature of qcow2 on zfs, but my knowledge on that topic is limited. Why couldn't you create a zvol block device in the NAS pool on the proxmox host and pass that to the ubuntu VM running docker. I'm guessing the proxmox web gui doesn't handle creating and managing zvols (yet), but that step could be done on the command line. Aside from a different block device, the steps on the VM and docker container should be the same.
@Jims-Garage
@Jims-Garage 11 ай бұрын
Both of those are valid alternatives. I'm keen to test the performance impacts. I may update based on what I find.
@dktol56
@dktol56 11 ай бұрын
@@Jims-Garage Among the many youtube videos on zfs and homelab, I really don't see much (or any) discussion on using zvols. Maybe the lack of gui support. Looks like an underutilized zfs feature.
@toddselby443
@toddselby443 11 ай бұрын
You must have some really long arms.
@Jims-Garage
@Jims-Garage 11 ай бұрын
I do, it's really frustrating, I usually have to sit in the adjacent room just to operate the keyboard 😢
@KeithWeston
@KeithWeston 11 ай бұрын
BTW, 24% wearout? Is that at all concerning to you? Have you discussed wearout info in Proxmox? I have a SSD that's reporting 14% wearout and I've been getting nervous. Seeing your 24% makes me wonder if that concern is warrented.
@Jims-Garage
@Jims-Garage 11 ай бұрын
To me it means worry in 76% ha. It's not as if it'll stop working after that, just that it's a good idea to replace. All data is backed up, plus at current rate it's another 4 years
@DavidAshwell
@DavidAshwell 11 ай бұрын
You don't interpret that to mean ~240GB or the 1TB are now no longer usable? Or at the very least, no longer reliable?
@therealtimray
@therealtimray 8 ай бұрын
How the heck did you create a zfs pool and suddenly it's in a NAS under the datacenter??? I just created a ZFS pool and it is NOT in a NAS. I don't even see that as an option.
@christophjahn6678
@christophjahn6678 11 ай бұрын
Recommending RAIDZ over mirrors as a general advice is wrong. In fact for most use-cases other than archiving mirrors are the better choice, because they deliver more IOPS. RAIDZ delivers more net capacity, but of what value is that if your VMs perform slowly.
@Jims-Garage
@Jims-Garage 11 ай бұрын
Thanks. I'm not proposing people use it for VMs, I explicitly show using nvme for VMs, and in this video it's purely an SMB share which isn't suitable for VMs. I've covered this topic in previous videos.
@aijokker
@aijokker 3 ай бұрын
Can’t you just install samba without any docker? What is the point of docker here?
@Jims-Garage
@Jims-Garage 3 ай бұрын
@@aijokker you can. Docker simply means you have a portable, instantly deployable configuration to speed things up.
@congenio
@congenio 11 ай бұрын
The setup shown here has a number of disadvantages when compared to a "native" Samba setup on the Proxmox host itself: 1. You have to allocate the space for the shared disk statically, thus rendering the potential to expand the ZFS pool later on partly useless. 2. You stack one filesystem (ext4) on another (ZFS), meaning higher CPU usage than using ZFS directly. 3. You lose the possibility to access snapshots via Samba, because ext4 does not offer it. Instead, I would just install Samba on the docker host, plus the package zfs-auto-snapshot. There are lots of instructions out there showing how you can expose the snapshots to Samba clients. This way, you can even distribute the ZFS pool capacity to your liking. And also, you can expose the share via NFS as well.
@gordslater
@gordslater 11 ай бұрын
"don't buy these - they're terrible" I disagree - I remove the labels using a hairdryer then keep them in a box to use as arse roll in the next pandemic. Haven't found a use for the SSD parts yet though so they just go to recycling.
@Jims-Garage
@Jims-Garage 11 ай бұрын
Haha 😂 that's likely more performant
@ewenchan1239
@ewenchan1239 11 ай бұрын
There no shortage of ways to do this.
@Jims-Garage
@Jims-Garage 11 ай бұрын
Agreed, this is one of them.
Manage Docker & Kubernetes Remotely with VS Code!
21:34
Jim's Garage
Рет қаралды 15 М.
Running a NAS on Proxmox, Different Methods and What to Know
18:47
ElectronicsWizardry
Рет қаралды 72 М.
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН
Caleb Pressley Shows TSA How It’s Done
0:28
Barstool Sports
Рет қаралды 60 МЛН
Setting Up NAS Server On Proxmox
16:28
Novaspirit Tech
Рет қаралды 108 М.
Turning Proxmox Into a Pretty Good NAS
18:31
apalrd's adventures
Рет қаралды 273 М.
My ENTIRE Home-Lab On A SINGLE CPU???
25:08
Hardware Haven
Рет қаралды 267 М.
Proxmox LXC - How To Guide - Better Than A VM?
17:01
Jim's Garage
Рет қаралды 79 М.
Whats the faster VM storage on Proxmox
8:56
ElectronicsWizardry
Рет қаралды 56 М.
5 Ways to Make Proxmox Better (New Install Changes)
16:41
WunderTech
Рет қаралды 31 М.
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН