Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Read-only super-share

Featured Replies

Hi,

 

I would like to see the addition of a read-only super-share that includes all (or user-defined) disks. E.g.:

 

Existing user-shares

--------------------------

disk1-5 Videos

disk6-12 Series

disk13-15 Music

disk15 Documents

 

New read-only super-share

------------------------------------

disk1-15 Array

 

This Super-Share would include:

 

Videos

Series

Music

Documents

 

Thanks.

Harald

 

This will get you close...

 

type the following commands, or add them to the end of your "go" script.  (If you type them, you do not need to do the "sleep" command, it is only to give the array time to come on-line in the "go" script.  You only need the echo commands.

 

sleep 30

echo "[superShare]" >>/etc/samba/smb.shares

echo "path = /mnt/" >>/etc/samba/smb.shares

echo "read only = Yes" >>/etc/samba/smb.shares

echo "force user = root" >>/etc/samba/smb.shares

echo "map archive = Yes" >>/etc/samba/smb.shares

echo "map system = Yes" >>/etc/samba/smb.shares

echo "map hidden = Yes" >>/etc/samba/smb.shares

echo "create mask = 0711" >>/etc/samba/smb.shares

echo "directory mask = 0711" >>/etc/samba/smb.shares

smbcontrol smbd reload-config

  • Author

This will get you close...

 

Not close enough ;-)

 

I will see the disks within this Samba share. That's not what I tried to see. My "Super-Share" would show the total of all user-shares:

 

/mnt/user/Videos (disk1-5)

/mnt/user/Series (disk6-12)

/mnt/user/Music (disk13-15)

/mnt/user/Documents (disk15)

 

Will result in...

/mnt/user/SuperShare (disk1-15)

 

... and show

 

/Documents

/Music

/Series

/Videos

 

Harald

 

AS a quick test I created a directory on /mnt as

 

mkdir /mnt/superusershare

 

Then I linked in the directories I wanted to expose.

 

root@unraid:/mnt# cd superusershare/

root@unraid:/mnt/superusershare# ln -s ../user/images images

root@unraid:/mnt/superusershare# ln -s ../user/video  video 

root@unraid:/mnt/superusershare# ln -s ../user/music music

 

 

Then I added a segment to /etc/samba/smb.shares like

 

root@unraid:/etc/samba# cat <<-EOF >> /etc/samba/smb.shares

> [superUserShare]

>    path = /mnt/superusershare

>    read only = Yes

>    force user = root

>    map archive = Yes

>    map system = Yes

>    map hidden = Yes

>    create mask = 0711

>    directory mask = 0711

> EOF

 

 

Then I did

smbcontrol smbd reload-config

 

I "think" this is what you want.

 

Try it out, if so we can create a scriptlet to automate it.

 

 

 

 

  • Author

Try it out, if so we can create a scriptlet to automate it.

 

Great stuff!!! Thanks. Some small questions:

 

1.) Why /mnt/superusershare and not /mnt/user/superusershare?

 

2.) After thinking about the name I would take the machines name (e.g. /mnt/user/Tower).

 

3.) How can I remove the symbolic links - somewhere in my head is some sort of a caution sign ...

 

4.) I think this is a small enhancement that should find it's way to the GUI below "user shares" on the "Shares" page:

 

Create read-only global user share: Enabled, Disabled.

 

Would be cool.

 

Regards

Harald

 

Try it out, if so we can create a scriptlet to automate it.

 

Great stuff!!! Thanks. Some small questions:

 

1.) Why /mnt/superusershare and not /mnt/user/superusershare?

/mnt/user is in Tom's user share file-system.  It does not support symbolic links.

 

2.) After thinking about the name I would take the machines name (e.g. /mnt/user/Tower).

Then change the one line in the script from "[superUserShare]" to "[Tower]"

You can also rename the mount-point directory if you like, just change the name appropriately. 

A mount point in Linux is simply an empty directory. It can be almost anywhere and be named as you like.

3.) How can I remove the symbolic links - somewhere in my head is some sort of a caution sign ...

rm link_name

4.) I think this is a small enhancement that should find it's way to the GUI below "user shares" on the "Shares" page:

 

Create read-only global user share: Enabled, Disabled.

I think MANY other items on the laundry list should come before this, especially since you can do it on your own.  You would have to take a poll of other that would need it on the gui and present your case why it should come before NFS, Native NTFS support, UPS Support, E-Mail report of failures, etc., especially since the configuration of the symbolic links to the folders on the other disks can be very complicated and unique based on how you want to present the data.

 

Joe L.

  • Author

I think MANY other items on the laundry list should come before this, especially since you can do it on your own.

 

You are correct - many things are more important. I just wanted to add this to the list. I don't care about it's current position.

 

Thanks

Harald

 

Here's my script. - S90-smb-shares

 

Hope it helps.

Also, I would not worry about the sym links, once you reboot they are gone!

 

#!/bin/sh

if [ ${DEBUG:=0} -gt 0 ]
   then set -x -v
fi

SU_SHARE_NAME=superusershare
SU_SHARE_NAME=tower

if [ ! -d /mnt/$SU_SHARE_NAME ]
   then mkdir /mnt/$SU_SHARE_NAME
fi

cd /mnt/$SU_SHARE_NAME || (echo "cannot cd: /mnt/$SU_SHARE_NAME";exit)

while read SHARENAME
do
    SHARENAME=${SHARENAME%#*}  # Comment ?
    if [ -z "${SHARENAME}" ]   # Skip if null/comment
       then continue
    fi
    # echo "SHARE: $SHARENAME"                                    
    if [ -d ../user/${SHARENAME} ]                                
       then if [ ! -L ${SHARENAME} ]                              
               then ln -s ../user/${SHARENAME} ${SHARENAME}       
            fi                                                    
       else echo "User share: ${SHARENAME} does not exist on /mnt/user"
    fi                                                            
done <<-EOF                                                       
# pub                                                             
video                                                             
images                                                            
# porn  LOL!!!!                                                   
music                                                             
EOF      
                                                          
                                                                  
if grep $SU_SHARE_NAME /etc/samba/smb.shares > /dev/null 2>&1     
   then echo "Share definition: $SU_SHARE_NAME already exists. skipping"
        exit                                                      
fi                                                                
                                                                  
cat <<-EOF >> /etc/samba/smb.shares                               
                                                                  
[mnt]                                                             
    path = /mnt/                                                  
    read only = Yes                                               
    force user = root                                             
    map archive = Yes                                             
    map system = Yes                                              
    map hidden = Yes                                              
    create mask = 0711                                            
    directory mask = 0711                                         
                                                                  
[$SU_SHARE_NAME]                                                  
    path = /mnt/$SU_SHARE_NAME                                    
    read only = Yes                                               
    force user = root                                             
    map archive = Yes                                             
    map system = Yes                                              
    map hidden = Yes                                              
    create mask = 0711                                            
    directory mask = 0711                                         
                                                                  
EOF                                                               
                                                                  
smbcontrol smbd reload-config                                     

 

 

  • Author

Here's my script. - S90-smb-shares

 

Thanks you very much!

 

Regards

Harald

 

This is a great feature to be fully incorporated into Unraid!

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.