Samba Fails on RO filesystem

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Posts: 1
Joined: Tue May 19, 2020 4:57 pm

Samba Fails on RO filesystem

Post by phyr080 »

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

Code: Select all

/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

Code: Select all

        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!
User avatar
Posts: 3259
Joined: Sat Nov 16, 2019 12:49 am

Re: Samba Fails on RO filesystem

Post by Joulinar »


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.

Code: Select all

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

Code: Select all

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.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply