[Samba] Samba 3 dynamically enable or disable share

Michael De Groote ict at sint-pietersschool.be
Mon Apr 29 06:54:44 MDT 2013


Wouldn't it be very simple to just create a VERY small partition (e.g.
10MB) on the main drive (the one that your system disk is on), and mount it
on e.g. /mnt.
Then, even if one of your disks can't mount for some reason, only this very
small partition will fill up => no problem for the rest of the system.
You would still have to configure your other machines to handle disk full
failures and maybe subsequently try another share...

Michael



2013/4/29 Mauricio Alvarez <maurialvarez303 at rocketmail.com>

> Hello,
>
>    I wonder if it is possible to dynamically enable/disable samba 3
> shares.
>
> Here is my problem.
>
> On a remote server I have 4 removable hard drives, large capacity. I am
> not using any RAID/JBOD, so each drive is mounted individually (like
> /mnt/DISK1, /mnt/DISK2 etc) and each drive is individually shared,
> something like:
>
> [STORAGE01]
> path = /mnt/DISK1
> Guest OK = false
> ...
>
> [STORAGE02]
> path = /mnt/DISK2
> Guest OK = false
> ...
> etc...
>
> Then I have a bunch of machines that just wait for the share (each machine
> points to only one share) to be available and then start blindly dumping
> data into the share (the hosts don't make checks--if the directory
> structure isn't there, they just re-create it and start dumping data).
>
> Problem is, the samba server is in a remote location and if for any reason
> one of the drives isn't mounted, samba will share the system drive instead,
> and this will fill up very fast and lock up my server.
>
> So, I can make a script to mount the external drives, and only if all went
> well then start samba. But since my system is best-effort, in case say
> Disk3 fails to mount, I would like to still be able to share /mnt/DISK1,
> /mnt/DISK2 and /mnt/DISK4 but NOT /mnt/DISK3 (sharename is STORAGE03).
>
> This would call for either my script to copy to samba.conf one of 2^4
> different smb.conf files (covering all possible combinations), then start
> samba.
>
> This is messy, it would be so much better to be able to selectively
> enable/disable the shares.
>
>
> Any other ideas? Thanks in advance!
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba
>



-- 
Michael De Groote
ICT-coordinator Sint-Pietersschool Korbeek-Lo
ICT-support Sancta Maria Basisschool Leuven


More information about the samba mailing list