Temat: Problem z samba w gargoyle 1.15.0.1

Witam
Zauważyłem problem z połączeniem z udostępnionym folderem na sambie. Połączenie jest odrzucane. Na tym serwerze są oprócz tego jeszcze dwa inne udostępniane foldery z którymi problemu nie było. Popatrzyłem więc w konfig i rzuciło mi się w oczy, że tam gdzie problemu nie ma tam jest podana długa nazwa dysku z tymi losowymi znaczkami. Tam gdzie problem był, to była podana nazwa kontenera cryptsetup. Gdy wszedłem przez gui do edycji tego problematycznego udziału i przestawiłem opcję, że ustawienia dotyczą tylko konkretnego dysku a nie folderu na dowolnym dysku, to problem ustąpił.

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

2

Odp: Problem z samba w gargoyle 1.15.0.1

Więc może coś źle wykrywa jeżeli na dysku jest zaszyfrowany kontener. zrób

fdisk -l /dev/sdX

na tym nośniku i pokaż co wyszło

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: Problem z samba w gargoyle 1.15.0.1

Tylko że cała partycja jest zaszyfrowana.

root@Gargoyle:~# fdisk -l /dev/sda
Disk /dev/sda: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: 2115
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: E1FA805F-67D0-450F-BF31-4DDB543241BA

Device     Start        End    Sectors  Size Type
/dev/sda1   2048       2247        200  100K Linux filesystem
/dev/sda2   4096 5860533134 5860529039  2.7T Linux filesystem
MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

4

Odp: Problem z samba w gargoyle 1.15.0.1

Nie ma to znaczenia, ważne że partycja jest.  Jeszcze pokaż wynik blkid

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5

Odp: Problem z samba w gargoyle 1.15.0.1

To dzieje się tylko na sambie, ftp jest ok.

root@Gargoyle:~# blkid
/dev/nvme0n1p1: SEC_TYPE="msdos" LABEL_FATBOOT="kernel" LABE
L="kernel" UUID="1234-ABCD" BLOCK_SIZE="512" TYPE="vfat" PAR
TUUID="5d200170-9b7c-7009-4faa-e74f149c1501"
/dev/nvme0n1p128: PARTUUID="5d200170-9b7c-7009-4faa-e74f149c
1580"
/dev/nvme0n1p2: LABEL="rootfs" UUID="ff313567-e9f1-5a5d-9895
-3ba130b4a864" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="5d200
170-9b7c-7009-4faa-e74f149c1502"
/dev/mapper/magazyn: UUID="098d5b18-d4e4-4ac5-acb6-721575391
220" BLOCK_SIZE="4096" TYPE="ext4"
/dev/sda2: UUID="aa7e162b-cf03-44e2-9b7e-1d2a16fd764e" TYPE=
"crypto_LUKS" PARTUUID="0bcc5827-adfa-5841-9af9-ce407e583cac
"
/dev/sda1: UUID="e40a3db2-dfda-4bb6-9722-b22ad08c5bc5" BLOCK
_SIZE="1024" TYPE="ext4" PARTUUID="0dbe70dd-943b-3b42-b96f-e
30d3267d9ed"
MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

6

Odp: Problem z samba w gargoyle 1.15.0.1

Can you show the config when it works and when it doesn't please?
I think this may be due to symlinks...

7

Odp: Problem z samba w gargoyle 1.15.0.1

Sure. It works:

/etc/ksmbd/ksmbd.conf                                                                        1179/1179              100%
[global]
        netbios name = Gargoyle
        server string = Ksmbd on Gargoyle
        workgroup = WORKGROUP
        interfaces =
        display charset = UTF-8
        unix charset = UTF-8
        bind interfaces only = no
        ipc timeout = 20
        deadtime = 15
        map to guest = Bad User
        smb2 max read = 64K
        smb2 max write = 64K
        smb2 max trans = 64K
        cache read buffers = no
        cache trans buffers = no
        guest account = nobody
        invalid users = root

######### Dynamic written config options #########

[transfer]
        path = /tmp/usb_mount/098d5b18-d4e4-4ac5-acb6-721575391220/transfer
        valid users = rkuci, Ryszard, testowy
        write list = rkuci, Ryszard, testowy
        create mask = 0777
        directory mask = 0777
        browseable = yes
        read only = no
        guest ok = no

It doesn't work, check the "path" variable.:

[global]
        netbios name = Gargoyle
        server string = Ksmbd on Gargoyle
        workgroup = WORKGROUP
        interfaces =
        display charset = UTF-8
        unix charset = UTF-8
        bind interfaces only = no
        ipc timeout = 20
        deadtime = 15
        map to guest = Bad User
        smb2 max read = 64K
        smb2 max write = 64K
        smb2 max trans = 64K
        cache read buffers = no
        cache trans buffers = no
        guest account = nobody
        invalid users = root

######### Dynamic written config options #########

[transfer]
        path = /tmp/usb_mount/dev_magazyn/transfer
        valid users = rkuci, Ryszard, testowy
        write list = rkuci, Ryszard, testowy
        create mask = 0777
        directory mask = 0777
        browseable = yes
        read only = no
        guest ok = no
MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

8

Odp: Problem z samba w gargoyle 1.15.0.1

Is
/tmp/usb_mount/dev_magazyn/
A symlink to
/tmp/usb_mount/098d5b18-d4e4-4ac5-acb6-721575391220/
When you’re in the not working config?

If yes, I would be interested to see if it starts to work if you swap ksmbd out for samba36.

ksmbd does not support symlinks. They removed them from the code and have not provided an alternative yet.
I haven’t tested it but I had thought this might cause a problem.
If that is confirmed a problem, I will patch symlink support back in.

9 (edytowany przez badziewiak 2025-05-03 13:27:20)

Odp: Problem z samba w gargoyle 1.15.0.1

lantis napisał/a:

Is
/tmp/usb_mount/dev_magazyn/
A symlink to
/tmp/usb_mount/098d5b18-d4e4-4ac5-acb6-721575391220/
When you’re in the not working config?

If I understood your question correctly, then yes, /tmp/usb_mount/dev_magazyn/ is a symbolic link to /tmp/usb_mount/098d5b18-d4e4-4ac5-acb6-721575391220/.

lantis napisał/a:

If yes, I would be interested to see if it starts to work if you swap ksmbd out for samba36.

ksmbd does not support symlinks. They removed them from the code and have not provided an alternative yet.
I haven’t tested it but I had thought this might cause a problem.
If that is confirmed a problem, I will patch symlink support back in.

New network shares are created correctly. For me, this basic functionality is sufficient. However, if you think it's worth looking into, I can check what happens after a software update. If possible please prepare the update so that I can do it remotely, because I am connecting to the device via vpn and the device is in another part of town. I only have physical access to the device occasionally.
My device is a MiniPC on an Intel N100 from the Chinaman. I am using the image gargoyle-1.15.0.1-generic-ext4-combined-efi.img.gz
Maybe just writing me step by step what to do without having to install a new image is enough? Alternatively if I update keeping the settings, that's fine too.

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

10

Odp: Problem z samba w gargoyle 1.15.0.1

The instructions are basically to install samba36-server, the modify the usb_storage.sh check so it prefers it over ksmbd. Then act as normal.
I will test it here in the coming weeks.

11 (edytowany przez lantis 2025-06-15 12:34:09)

Odp: Problem z samba w gargoyle 1.15.0.1

Just to circle back on this, it is definitely caused by ksmbd. It does not support symlinks currently. The developer has said that it is on their roadmap to add it back in (as a different more secure implementation) but for now this option should be avoided with samba shares.
Alternatives are to install samba36-server which will work fine.

I am going to try to find time to bring samba4 into Gargoyle as a third alternative as well (as samba36 probably should not be used) but this will be lower priority. I'm hoping ksmbd gets it done before I do.
https://github.com/namjaejeon/ksmbd/iss … 2955925743

Also I attempted a crude backport of the original functionality but I either missed something or did something wrong as it would hang the filesystem when a symlink was involved. So I'm abandoning that approach.

12

Odp: Problem z samba w gargoyle 1.15.0.1

Thank you!

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)