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.

How to mount /dev/shm as SMB to allow for network access to ram-disk

Featured Replies

I have a usecase that involves a lot of calculations that are causing excessive TBW on my drives. I want to provide a network ramdisk to share via smb for my other servers to read and write to.

Would it work to add these lines to smb-extra.conf?


[ramdisk]

path=/dev/shm

browseable = yes

public = yes

writeable = yes

  • Community Expert

Should yes if /dev/shm is the ram disk.

Settings > SMB > smb extra:
image.png

Here is How I would go about it though...

User script plugin at first array start.

Create a dedicated RAM disk (tmpfs)

User scirp plugin for reboots

# create a mount point
mkdir -p /mnt/ramdisk

# mount a tmpfs of the size you want (example: 32G). 
# mode=1777 = world-writable like /tmp, with the sticky bit.
mount -t tmpfs -o size=32G,mode=1777,nosuid,nodev tmpfs /mnt/ramdisk

# verify
df -h /mnt/ramdisk

*this way /mnt/ramdisk is my share path and its a 32 GB Ram allocation...

Better to edit eh web UI...
Add this block to Settings → SMB → SMB Extras (or edit /boot/config/smb-extra.conf


Samba options:

[ramdisk]
   path = /mnt/ramdisk
   browseable = yes
   public = yes
   guest ok = yes
   read only = no
   writeable = yes
   force user = nobody
   force group = users
   create mask = 0666
   directory mask = 0777
   oplocks = no

I would avoid trying to use /dev/shm directly...

If you really want to share /dev/shm

It does work, but be aware it’s shared OS/containers space and defaults to ~½ of RAM. If you still want to, use:*(That’s essentially what you proposed; I just added a little safety/compatibility lines.) Reference thread where this idea came up is here...

[ramdisk]
path = /dev/shm
browseable = yes
public = yes
guest ok = yes
read only = no
writeable = yes
force user = nobody
force group = users
oplocks = no


Quick tests

  • Local write test:

    dd if=/dev/zero of=/mnt/ramdisk/test.bin bs=1M count=1024 status=progress
    
  • From a client, copy in/out and confirm speed and that files vanish on server reboot (expected—RAM only).


Notes

  • Volatility: This is RAM—data disappears on reboot/array stop. Use it for scratch only.

  • Sizing: Adjust size= to whatever you need; consider separate RAM disks per workload if you want isolation.

  • Performance knobs: Usually leave Samba defaults; oplocks = no reduces corruption risk for DB-like workloads hitting a network share. If you need strict durability semantics, you can add strict sync = yes (but that will slow it down).

Edited by bmartino1
scirpt fixes and updates

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.

Guest
Reply to this topic...

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.