Samba 共用資料夾名稱在 Linux 電腦上顯示不正確

Samba 共用資料夾名稱在 Linux 電腦上顯示不正確

我有一台運行 OMV 5 的 NAS 伺服器,用於儲存個人資料(文件、照片、影片等)。我使用 Samba 共享來自 NAS 的數據,並在用於存取共享數據的用戶端上運行 Fedora 33。

我遇到的問題是auxNAS 上命名的資料夾顯示為AHY9U3~9Fedora 用戶端上的資料夾,請參見下面的範例 在此輸入影像描述 左側 tmux 面板中的工作目錄位於用戶端上,而右側面板中的工作目錄位於 NAS 上。我發現很奇怪的是,我可以使用奇怪的名稱或資料夾在 NAS 上的正確名稱來存取客戶端上的資料夾。

當我嘗試使用客戶端上運行的軟體在客戶端和 NAS 之間同步資料時,偶然發現了這個「錯誤」。我有一堆名為 aux 的資料夾分散在整個資料夾層次結構中,同步軟體為它們標記了一個差異,而問題實際上是它們的名稱在客戶端上的映射方式。

我不知道是什麼原因導致了這個問題,最重要的是,如何解決它。我還想知道是否還有其他資料夾名稱被錯誤地對應到客戶端。

請找到下列客戶端和伺服器的軟體版本資訊 伺服器 samba 版本: Samba 版本 4.9.5-Debian 用戶端 samba 版本: 版本 4.13.12 用戶端資訊:

  • 核心版本 - 5.14.13-100.fc33.x86_64
  • 肉桂版本 - 4.8.6

我找到了一些相關的帖子,請參見下文,但是,根據 samba 規則,我認為這aux是一個有效的文件名,不是嗎?

  1. samba如何顯示名稱中帶有冒號的檔案?
  2. 不修改名稱會導致音樂在 Windows 10 Samba 上無法播放

編輯:以下是 smb.conf 中的全域部分和對應的共享部分,

[global]
workgroup = WORKGROUP
server string = %h server
dns proxy = no
log level = 0
log file = /var/log/samba/log.%m
max log size = 1000
logging = syslog
panic action = /usr/share/samba/panic-action %d
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = no
unix password sync = no
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
socket options = TCP_NODELAY IPTOS_LOWDELAY
guest account = nobody
load printers = no
disable spoolss = yes
printing = bsd
printcap name = /dev/null
unix extensions = yes
wide links = no
create mask = 0777
directory mask = 0777
use sendfile = yes
aio read size = 16384
aio write size = 16384
time server = no
wins support = no
multicast dns register = no
# Special configuration for Apple's Time Machine
fruit:aapl = yes
[test]
path = hidden-path/test/
guest ok = no
guest only = no
read only = no
browseable = yes
inherit acls = yes
inherit permissions = no
ea support = no
store dos attributes = no
vfs objects = 
printable = no
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
hide special files = yes
follow symlinks = yes
hide dot files = yes
valid users = 
invalid users = 
read list = 
write list =

EDIT2:我不會認為aux這是一個保留字,但是是的,它是,請參閱https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file。感謝@Ricky 指出這一點。現在,我只需要更改資料夾的名稱。

答案1

aux是 DOS/Windows 中的保留字。透過任何「正常」方式嘗試存取該檔案都會失敗:

T:\>dir \\.\t:\aux
10/31/2021  08:50 AM                 0 aux
           1 File(s)              0 bytes

T:\>dir t:\aux
File Not Found

我的 samba 版本(3.0.10)已經很舊了,所以它的名字一點也不混亂。 (短名稱和長名稱均為“aux”)

相關內容