Help with my new server setup

Hi there,

Today I managed to install latest dietpi on my dell optiplex i5 pc. This was installed on m2 sata drive and I also have a second normal 3tb hdd which was used previously on a windows machine as ntfs file system storage drive.

I managed to Install pie hole with unbound fine.
Also managed to install plex server fine
However I don’t know how to utilise my second internal drive for storage and tell plex to use those libraries instead?

Also can i connect to that particular drive from another local machine to transfer files in and out?

I have installed samba server however that only gives me access to my m2 sata drive?

So on this drive are still files you wanna access via plex? First, mount this drive via dietpi-drive_manager, if it’s not already mounted. After that you can simple add the folders via the plex wizard, I think.

If you want to access this drive from a windows machine, you could use samba. (If you only want to access it from other linux machines you can go with NFS) As you stated you already have installed samba, but only your system drive is shown up right now.
In your samba config at /etc/samba/smb.conf you can change the path of the existing config and (but you will lose access to the m2 drive via samba) or you create a second config entry for your plex media, and change the path like:

        path = /path/to/your/media

You also need to setup a samba password for the user plex with smbpasswd.

Also the media needs to belong to the user or group plex (at least they chown it for NTFS drives), but I’m not familiar with plex and the permissions it needs and maybe somebody else can tell you something about the permissins you need.

edit: corrected wrong info.

many thanks for your reply.

I managed to mount the hdd and plex is all good now.

I am stuck with samba and cannot change the config file.

I’m using putty and when i enter command /etc/samba/smb.conf I am getting:

root@DietPi:~# /etc/samba/smb.conf
-bash: /etc/samba/smb.conf: Permission denied

Can you please advice what im doing wrong?

you need to use a command line editor.

nano /etc/samba/smb.conf

But you should not use valid users = plex as this should not be a user valid for login.

thank you,

i managed to add the share, formatted the drive to ext4. however i cannot read or write from my windows pc… any solution to this?

can you share some more details? What you changed on the configuration exactly?

what i did is format my share drive from ntfs to ext4. i can see the drive from my windows machine but cannot read or write into it. i formatted my drive back to ntfs now and can read and write back to normal…

share the exact config you have done. The configuration file you changed. Otherwise, we don’t know what exactly to check. Best to format the drive as ext4 again.

Hi there,

I have my main windows 10 pc and use putty to login to my dietpi pc server. Nothing was changed on the config file posted here. I noticed when I formatted my second drive inside the diet pc server in ext4 i lost read/write from my main windows pc. This was re-stored when i reverted back to ntfs format.

I understand windows cannot rw into ext4 partitions/drives: Am i loosing a lot if I keep ntfs for this drive which is currently holding all my data for my plex server in dietpi?

Alternatively if I one day switch from windows to Linux on my main pc lets say to Mint or Ubuntu, will I be able to ssh with putty into the dietpi server and read/write files in/out the ext4 drive? will it be the same way via samba? any good distros you recommend for my main windows pc: dell OptiPlex 3060 i5 8th gen with 16 gb of ram and built in intel graphics, I’m not a gamer but do use streaming, so qbit torrent and something similar to internet download manager usability are a must for me…

I thought you used SAMBA to access the drive? Because there the file system format did not matter and you could access the share from every windows system. What needs to be done on ext4 is to ensure correct file system permission to allow the samba user to access the drive.

That’s correct Samba is running in dietpi and I’m using config posted here. I then connect from my windows pc through run \dietpi ip and I connect to my samba share. If the drive is formatted in ntfs I can read and write. If formatted in ext4 no chance.
Same config.

Can you please guide me in how can I fix this?
Change user permissions for the drive? There is nothing wrong with my samba config I have triple checked

I requested already 2 times to share your current samba configuration file. But you simply did not do that. I need to know how it looks like now. Otherwise I can support you.

root@DietPi:~# nano /etc/samba/smb.conf
GNU nano 5.4 /etc/samba/smb.conf


        workgroup = WORKGROUP
        server string = %h server
        dns proxy = no
        log file = /var/log/samba/log.%m
        max log size = 1000
        syslog only = no
        syslog = 0

        panic action = /usr/share/samba/panic-action %d

        security = user
        encrypt passwords = true
        passdb backend = tdbsam
        obey pam restrictions = yes
        unix password sync = yes

        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        pam password change = yes
        map to guest = bad user

        load printers = no
        printcap name = /dev/null
        disable spoolss = yes

        comment = Plex
        path = /mnt/A44EBA524EBA1CCC
        browseable = yes
        create mask = 0664
        directory mask = 0775
        valid users = dietpi
        writeable = yes
        max connections = 8

The drive is ext4 now? If not, pls do first. Afterwards share following

lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid
ls -la /mnt/A44EBA524EBA1CCC

In my smb.conf I rather use the commands

force create mode = 0776
force directory mode = 0776

they lead to a “minimum” mask 776 for files and directories if they are created.
I made good experiences with a Windows access with them. :slight_smile:

The commands

create mask = 0664
directory mask = 0775

lead to a “maximum” value of 664 (files) resp. 775 (directories) if they are created. I did not use them.

So you can say that the force ... are kind of setting rights bits (in an OR manner) and ... mask are a kind of resetting rights bits (in an AND manner).

root@DietPi:~# lsblk -o name
root@DietPi:~# ls -la /mnt/A44EBA524EBA1CCC
total 24
drwxr-xr-x 3 root root  4096 Nov 16 23:20 .
drwxr-xr-x 7 root root  4096 Nov 16 23:21 ..
drwx------ 2 root root 16384 Nov 16 23:20 lost+found
root@DietPi:~# lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid
NAME        FSTYPE LABEL   SIZE RO TYPE MOUNTPOINT            PARTUUID                             UUID
sda                        2.7T  0 disk
└─sda1      ext4           2.7T  0 part /mnt/A44EBA524EBA1CCC 38e1ee24-6211-40d0-9300-4d76e073af22 e1a06753-6b7a-4951-94b0-b6cc9d788e63
sr0                       1024M  0 rom
nvme0n1                  238.5G  0 disk
└─nvme0n1p1 ext4         238.5G  0 part /                     d08eccbc-01                          bbfd5220-9997-4974-912f-73a2d0a61a07

the whole folder is writable for user root only. But you are going to login with user dietpi. Therefore, folder ownership to be changed.

chown dietpi:dietpi /mnt/A44EBA524EBA1CCC

try again Samba access.

1 Like

yesss finally. youre a star :smile:

thank you so much!