Samba Fails on RO filesystem Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
phyr080
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


[global]
        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
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: Samba Fails on RO filesystem

Post by Joulinar »

Hi,

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.

https://github.com/chesty/overlayroot

Code: Select all

login as user root
apt update
apt install git initramfs-tools
git clone https://github.com/chesty/overlayroot.git chesty
cd chesty
./install.sh
cd /root
nano .bashrc
ADD >> lines from GitHub
reboot
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
foxy82
Posts: 3
Joined: Fri Jun 04, 2021 9:21 am

Re: Samba Fails on RO filesystem

Post by foxy82 »

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:

Code: Select all

login as user root
apt update
apt install initramfs-tools
wget "https://github.com/chesty/overlayroot/archive/refs/tags/v1.0.0.zip"
unzip "v1.0.0.zip"
cd overlayroot-1.0.0
./install.sh
nano /root/.bashrc
ADD >> lines from GitHub
reboot
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: Samba Fails on RO filesystem

Post by Joulinar »

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