Samba Fails on RO filesystem

When i try to set filesystem (/) in RO with dietpi-drivemanager, and i always saw a fail error when smbd and nmbd on restart…

/DietPi/dietpi/func/dietpi-globals: line 570: ((: <= 120 : syntax error: operand expected (error token is "<= 120 ")
/DietPi/dietpi/func/dietpi-globals: line 576: ((: >= 7 : syntax error: operand expected (error token is ">= 7 ")
[FAILED] DietPi-Drive_Manager | RootFS is currently set to R/O. DietPi-Drive_Manager requires R/W access to function. Aborting...
[ INFO ] DietPi-Drive_Manager | Rerun "dietpi-drive_manager" to enable RootFS R/W access.
[ SUB1 ] DietPi-Services > start 
[  OK  ] DietPi-Services | start : avahi-daemon
[  OK  ] DietPi-Services | start : proftpd
[FAILED] DietPi-Services | start : nmbd
[FAILED] DietPi-Services | start : smbd
[  OK  ] DietPi-Services | start : php7.3-fpm
[  OK  ] DietPi-Services | start : lighttpd
[  OK  ] DietPi-Services | start : transmission-daemon
[  OK  ] DietPi-Services | start : cron

in RW all goes perfectly!

i’ve tried to force to use an external partition in rw mode but without succes, this is my smb.conf

        workgroup = XXXX
        server string = XXXX
        netbios name = XXXX
        netbios aliases = XXXX
        hosts allow = 192.168.1.
        server min protocol = SMB2
        server max protocol = SMB3
        server role = standalone
        cache directory = /mnt/LCLBKUP/samba/cache/
        log file = /mnt/LCLBKUP/samba/log/log.%m
        lock directory = /mnt/LCLBKUP/samba/lock
        state directory = /mnt/LCLBKUP/samba/state/
        utmp directory = /mnt/LCLBKUP/samba/run/utmp/
        winbindd socket directory = /mnt/LCLBKUP/samba/run/winbindd/
        wtmp directory = /mnt/LCLBKUP/samba/run/wtmp/
        pid directory = /mnt/LCLBKUP/samba/run/
        #max log size = 1000
        syslog = 0

        # Debug logging information
        log level = 10
        #log file = /var/log/samba.log.%m
        max log size = 50
        debug = 1
        debug timestamp = yes

        #panic action = /usr/share/samba/panic-action %d
        #load printers = yes
        #printing = cups
        #printcap name = cups
        min receivefile size = 16384

Where could it be the problem?? Something missing???
Thank you!


many thanks for your report. It’s not 100% the answer you are looking for but maybe something similar. Probably you can use overlayroot. Seems to be an interesting alternative to keep your rootFS r/o and simulate a r/w file system for your applications due to overlay. I was playing with it and installation was quite easy.

login as user root
apt update
apt install git initramfs-tools
git clone chesty
cd chesty
cd /root
nano .bashrc
ADD >> lines from GitHub

After reboot you can check mounted fs using mount command. It should show overlay mounted r/w as rootFS while the original root partition is mounted r/o to /overlay/lower

overlay on / type overlay (rw,relatime,lowerdir=/overlay/lower,upperdir=/overlay/upper,workdir=/overlay/work)
/dev/mmcblk0p2 on /overlay/lower type ext4 (ro,relatime)

In any case, do a full backup of your SD card before, to avoid any data loss or corruption.

I’ve only just really started looking at DietPi as a way to create serveral snapcast clients quickly and easily.

Do you think the above is something we’d be able to build into the DietPi core as an option? It seems having a RO filesystem really would align with what people want in a small reliable distribution.

I’m using it and it works a treat so far and you just type rootwork to go to a writeable file system.

I’ve also just got the overlayroot dev to create a tag so we can change the instructions to be more repeatable as follows:

login as user root
apt update
apt install initramfs-tools
wget ""
unzip ""
cd overlayroot-1.0.0
nano /root/.bashrc
ADD >> lines from GitHub

I guess something like this is on the open item list. Not sure what the actual plan is. Best to my knowledge this option is dedicated to RPi and might not work on other SBC DietPi is supporting.

Just mistake.
Just mistake.