Ksmbd (Samba3/4 alternative, ex cifsd/smbd) package support thread

Problem: NTFS share drive cannot access.
Info from my ubuntu: "You do not have the permissions necessary to view the contents of usb-128gb on 192.168.xx.xx".

If the drive using Fat32 or Ext4 formats, works no problem.
The same NTFS drive works fine on a Samba4 router.

I have installed ntfs-3g ntfs-3g-utils kmod-fs-ntfs .
And all settings did not set the security for any permissions and authentications.
How to fix/debug on this NTFS drive problem, thanks.

1 Like

chmod -R 777 the whole share

1 Like

Thanks, @Gingernut , could you tell me more details, how to apply the changes.

I use luci to Create mask to 0777 from 0666. No effect.

ssh to device
chmod -R 777 /mnt/sda or whatever the mount path is.

1 Like

why I got this:

BusyBox v1.35.0 (2022-10-26 07:59:38 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r21112-eb456aedfe
 -----------------------------------------------------
root@Xiaomi-MIR3:~# 
root@Xiaomi-MIR3:~# chmod -R 777 /mnt/sda1
chmod: /mnt/sda1: Read-only file system
chmod: /mnt/sda1: Read-only file system
root@Xiaomi-MIR3:~# 

How are you mounting the drive?

In the luci Mount Points:

Have you tried what the wiki says?

2 Likes

Thanks, I'll check it.

(edited) After I did this:

root@Xiaomi-MIR3:~# umount /dev/sda1
root@Xiaomi-MIR3:~# chmod -R 777 /mnt/sda1
root@Xiaomi-MIR3:~# ntfs-3g /dev/sda1 /mnt/sda1 -o rw,big_writes
root@Xiaomi-MIR3:~# ln -s /usr/bin/ntfs-3g /sbin/mount.ntfs
ln: /sbin/mount.ntfs: File exists
root@Xiaomi-MIR3:~# 

The NTFS drive works OK.

To auto mount a partition at startup (with hard drive plugged) edit /etc/rc.local:

sleep 1
ntfs-3g /dev/sda1 /mnt/sda1 -o rw,lazytime,noatime,big_writes
exit 0

But after reboot the router, the problem comes again.

1 Like

Try like this:

root@Xiaomi-MIR3:~# umount /dev/sda1
root@Xiaomi-MIR3:~# ntfs-3g /dev/sda1 /mnt/sda1 -o rw,big_write
root@Xiaomi-MIR3:~# chmod -R 777 /mnt/sda1
root@Xiaomi-MIR3:~# ln -s -f /usr/bin/ntfs-3g /sbin/mount.ntfs

yes!!! I changed the file rc.local to this:

sleep 1
umount /dev/sda1
ntfs-3g /dev/sda1 /mnt/sda1 -o rw,big_write
chmod -R 777 /mnt/sda1
ln -s -f /usr/bin/ntfs-3g /sbin/mount.ntfs
exit 0

fully works fine. Thanks.

1 Like

Is it normal that if an USB3 SSD is connected to the USB3 port (in my case to R7800 USB3 port) the router CPU load can be almost 100% during high speed transfers (copy/paste) from/to the SSD. There were several reboots too. Check this post.

Short answer, yes.

With an SSD attached, you have (effectively) no 'natural' speed limit on the storage backend, so the SOC will drive USB3 to its maximum speed. That alone can tax the CPU pretty hard, but in practice all reads/ writes also come over the network and some remote filesystem (most commonly samba, maybe nfs or sshfs/ sftp/ scp), bumping CPU requirements even more than that.

2 Likes

On my R7800, I use Samba4 for the USB share, not ksmbd, because R7800 has a large flash.

I also think that it depends on what filesystem you use on the external drive.

That depends on what you mean exactly, yes ntfs-3g would have a significantly higher CPU overhead (and many context switches, really hurting performance) than ext3/ ext4 (or mainline's ntfs3), but that's transparent to the cifs client over the network.

Well the filesystem used on the USB attached storeage, in this case it looks to be either exFAT or F2FS, does make a big difference afaik to the router's CPU load.

Maybe it's just a ksmbd problem on kernel 5.10, I would suggest to try samba and or ext4.

This package has been very helpful for my router with 8MB flash where samba4 libs are just huge.. Everything works great but I see this error,

Sat Dec 31 22:51:30 2022 kern.err kernel: [ 1095.273039] ksmbd: Unsupported RPC: svcctl
Sat Dec 31 22:51:30 2022 kern.err kernel: [ 1095.277289] ksmbd: Unable to open RPC pipe: -22

Also, during streaming every now and then there is a pause but it continues automatically. What are these errors denote?

so 3.4.7 is out.

Main developer is asking about ksmbd.adduser: https://github.com/namjaejeon/ksmbd-tools/issues/188#issuecomment-1407223718

Does everyone manually run ksmbd.adduser here?

1 Like

I did on initial setup.