Samba first run

Here you have it:

total 24
drwxr-xr-x 3 root root  4096 Sep 23 08:56 .
drwxr-xr-x 7 root root  4096 Sep 23 08:56 ..
drwx------ 2 root root 16384 Sep 23 08:55 lost+found
sda                   59.5G  0 disk
└─sda1   ext4         58.9G  0 part /mnt/sdcar 7db185fa-01                          3304bda5-37c2-4c61-93ee-d719fb76710d
mmcblk0               28.9G  0 disk
└─mmcblk0p1
         ext4         28.9G  0 part /          47aa7b94-01                          84a23f99-fa00-4f15-abf8-3430c6169475

Oh actually I have found misspell error /mnt/sdcar instead od sdcard but in my /mnt is sdcard. So why is that here sdcar?

Ok so here we go with that global password etc.

On ssh as root I can access folder makes dirs etc. But they only available as root. when I enter ssh as dietpi I do not have access to do anything only read. As my user martin the same only read. Howvere in smb.config there is suppose to be all read and write.
So I remember during installation of smaba server vis dietpi launcher I was ask about some user etc, it seems to be not translate to permission, and that sdcar misspelling error why?

My question is all software which I am installing I use ssh with root or dietpi and sudo?
Or no sudo needed?

I guess the output is just cut off, otherwise the ls -la /mnt/sdcard command had thrown an error?

As you can see, owner and group are root and the permissions are rwxr-xr-x which means read,write and execute for the owner, read and execute for anybody else.
The masks you set in the config only apply to files (create mask = 0664) and folders (directory mask = 0775) you create (writeable = yes) in the future,it does not change the already exisiting permissions for this folder. So samba would let write you, but the permissions of the folder don’t.

You could chown this directory to dietpi:dietpi (or any group you want) and add the user martin to this group. Then change the permissions of the folder to 774 (owner and group can do everything, anybody else only read).

As root:

chown -R dietpi:dietpi /mnt/sdcard
usermod -a -G dietpi martin
chmod -R 774 /mnt/sdcard

You are not able to run the scripts like dietpi-software without root privileges, so you need to use sudo or to be logged in as root.

1 Like

Thanks, that (chown) did do the trick.

So why during samba installation when scrip asks me about a user and password it doe not assign proper privileges (I mounted the drive first before installing samba)

Honestly, not sure what you have done. But our SAMBA server installation script is not aksing for a single user input during install process. We setup a default SAMBA server configuration pointing to /mnt/dietpi_userdata as target directory and using SAMBA user dietpi. There is nothinng ask for user, password or target folder.

Probably you mixed the Server installation with setting ab a Client connection using dietpi-drive_manager. This indeed is asking for user/password. But these values are needed as client to be able to connect to a remote server. It has nothing to do with setting up a SAMBA server on DietPi.

Ohh well I did fresh flash and now I ma paying attention to every bit, I have set up samba ad it is working now as I wanted (after chown magic), there is new update to dietpi 8.9.1 and so far so good good job guys.

BTW is there any advantage to installing Sonarr, Radarr, Lidarr, NZBget as packages instead go for docker and using containers?

on the updated version, nothing changed related to SAMBA.

depends on your own preferences. There are pro and cons for both szenarios.

From our side, we try to integrate the tools as much as possible right from the beginning, to avoid too much configuration efforts needed on end user side.

Running docker you need to calculate with around 100 MB additional memory usage for the Docker engine. If Docker is failing, all your container will be offline.

On the other hand side, a brocken container could be simply recreated.

Thanks, I got it. I must say I observe Dietpi like for 5years nearly You guys are doing a great job for SBC and Linux geeks.

Cheers

1 Like

One more question about good housekeeping.

As you mentioned samba is pointing to /mnt/dietpi_userdata so maybe to avoid all these permissions problems I should mount an external SSD to that folder like eg /mnt/dietpi_userdata/ssd1?

Or mount to /mnt/ssd1 and make simlinks to Music, Movies, etc at /mnt/dietpi_userdata?

However, you still need to manage the file system permissions. Adding an additional volume or creating symbolic links is not enough to avoid managing it.