October 14, 2025Oct 14 Hello all,Tried searching for this info but not exactly sure if I'm using the proper terminology, so came back with nothing.My "issue:" I like to export all my disk shares on top of my regular shares. I'm using unRAID solely as a file server with a few shares spread across multiple disks. I like to be able to go in to specific disk shares and move things around if I see fit. I've got 15 disk shares, so going into each disk and setting it to export/secure, and then waiting for the refresh to change user access to read/write is not a deal breaker but something I would like to batch, if possible. I think this might be possible to do with the SMB extra configuration options but I'm not a power user by any means so I haven't the faintest idea what to put. If someone could point me in the right direction, that'd be great.What I'd like is to set every disk to...export=yescase-sensitive name=(stays on auto)security=secureAnd then user access...<user name>=read/write (there's only one user, me)Thanks for any and all help!
October 14, 2025Oct 14 Community Expert https://forums.unraid.net/topic/178033-bmartino1-user-scripts/#findComment-1478661
October 14, 2025Oct 14 Author 33 minutes ago, bmartino1 said:https://forums.unraid.net/topic/178033-bmartino1-user-scripts/#findComment-1478661Thank you for the reply. I think there's some stuff in there that pertains to what I want to do but a lot of this stuff looks like another language to me.Do you think this would work for what I want to do?[global] # Optional global options hide dot files = no browseable = yes # Match all disk shares dynamically [disk*] path = /mnt/%S comment = %S browseable = yes writable = yes public = no valid users = @users create mask = 0666 directory mask = 0777 Edited October 14, 2025Oct 14 by CasanovaFly
October 14, 2025Oct 14 Community Expert What is the problem with setting things up this way-- Right from the GUI? >>>>> Then >>>>>> Repeat for each disk. Remember that disk shares are not turned on by default because disk operations between Disk Shares and User Shares can result in data loss!!!!EDIT: You might as well make the disk share private if you require a login and you are the only user. Edited October 14, 2025Oct 14 by Frank1940
October 14, 2025Oct 14 Community Expert When you do the above this entry will be generated by Unraid in the /etc/samba/smb-shares.conf file:
October 14, 2025Oct 14 Author 41 minutes ago, Frank1940 said:What is the problem with setting things up this way-- Right from the GUI?As I said above, I've got 15 disks and doing it through the GUI isn't a crazy amount of time-consuming, but if I can automate it or batch it, I'd like to do so. Whenever I make a new config it also wipes out the disk shares and I have to re-do them.I figured there was a relatively simple way to do this via extra config and trying to see if that's the case.
October 15, 2025Oct 15 Community Expert I'm personally not a fan of disk shares on unraid.This really requires that their share to begin with is ONLY SET TO A PRIMARY no mover, no prefer cache NO SECONDARY STORAGE SET!... As Frank said. The difference between your user shares "/mnt/user/share name" and disk shares "/mnt/disk1" "/mnt/cache" etc etc... can result in data loss... This is due to the way you may have set up the share...While Yes its possible to manually script it (the disk share). No you shouldn't as I can't guarantee the disk share path if you're using new config and disk are changing quite a bit...AS, They get erased due to that disk not being there and the need to keep the samba server stable on unraid... no /mnt exist smb is bad and won't loadtestparm is your friend...So to go over your example samba share I'm concerned as its not sated ... "/mnt/%S" in your context is not correct as samba is seeing multiple paths do to Pearl/bash and is unable to mount at the share name...as you need a share for EACH DISK AND SETTING FOR EACH DISK, not a one and done...A similar structure of: Generic samba settings...[share name see]samba settingsSo the corect way to work around this is.. (use unraid as intended or...) the goal is to configure your share via unraid one last time and cat the smb-shares file and copy the smb config shares for the disk shares... and past that into your smb-extra that won't get wiped.. and remove the configured unriad disk shares never to be touched again in the web ui...You will need to configure each one once more!!! AND turn them all off once you get the data... (you DON'T WANT CONFLICTS!)and past the disk share setting you made once into the smb-extras as all your doing is moving the good complete data form 1 file to another...This way disk share are set correctly once and never touched in the web Gui anymore...I DON'T RECOMMEND DOING IT THOUGH!Its why even with my feature request Requested by many before me) I went with F IT and replace samba config... but to keep unraid webui share edits and the ability to use the web ui added the included at the bottomSince have of it is "greek to you"...https://forums.unraid.net/topic/151422-feature-request-custom-smb-with-out-unraids-default-config-options/#comment-1365921 I can recommend a workaround but this means you have to abandoned using the webui ever to set and mange disk shares...as you are essential, writing your own samba config. I find that unbraids default samba is Too restrictive and thus I have to kill their conf and rewrite my own.Its resctrive for security and folows some hardening rules...once configured go to /etc/samba to get your corect code for smb extra... as I'm not going to go over constructing a share...root@The-Borg:~# cd /etc/samba/root@The-Borg:/etc/samba# lslmhosts smb-fruit.conf smb-names.conf smb-shares.conf smb-unassigned.conf smb.confroot@The-Borg:/etc/samba# there you will see disk1 as example:[unas-backup] path = /mnt/user/unas-backup comment = browseable = yes # Secure public = yes writeable = no write list = unas case sensitive = auto preserve case = yes short preserve case = yes vfs objects = catia fruit streams_xattr fruit:encoding = nativeand will need all your code for each disk... and each disk copied to smb extraAs I'm using a smb-overide as Orginal posted... this is a note to my self to use and edit my custom config... then use a user script plugin to restart samba as i'm essential telling unraid once the array is up to remove the smb.conf repalce it with my smb-override and restart samba to apply... (not needed if your just adding cusutm shares via the smb extra so past your disk share in here AFTER DISABLING them once configured and you have your share code!*This is why the array needs to be off to kill teh disk and samba to edit the samba extra configurations.the smb.conf is whats loaded into unraid for there samba share. where it has inincludes when the next file is added and ran.this is seperated due to how the dev/mainteners made samba on urnaid. IT OUTDATED!but with the limitation of slackware and samba teh defaults they ship with are fine. ther is no need to edit. I would stop using new config and fix your disk setup and array. Edited October 15, 2025Oct 15 by bmartino1 spelling - data - werid forum glicth with a link pasted...
October 15, 2025Oct 15 Author So what if I changed 16 minutes ago, bmartino1 said:Yes its posble to manualy script it. No you shouldn't as I can't gurantee the disk share path if you using new config and disk are chaning quite a bit.So what if I change it to...[global] hide dot files = no browseable = yes # Auto-generate secure exports for disks [disk1] path = /mnt/disk1 comment = Disk 1 browseable = yes writable = yes public = no valid users = @users create mask = 0666 directory mask = 0777...and repeat for each disk?This should avoid the shuffling of disk paths, no?
October 15, 2025Oct 15 Community Expert Just now, CasanovaFly said:So what if I changedSo what if I change it to...[global] hide dot files = no browseable = yes # Auto-generate secure exports for disks [disk1] path = /mnt/disk1 comment = Disk 1 browseable = yes writable = yes public = no valid users = @users create mask = 0666 directory mask = 0777...and repeat for each disk?This should avoid the shuffling of disk paths, no?Correct, sorry, had a weird unraid forum gltich. That is a correct share code with a single path and yes repeat for each disk. Edited October 15, 2025Oct 15 by bmartino1 spelling
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.