Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
305 views
in Technique[技术] by (71.8m points)

Files appearing as directories on samba share when I copy/move files locally

I have an Ubuntu 20.04 LTS with Samba installed on my "Server" laptop. This is my samba configuration:

[global]
workgroup = WORKGROUP
server role = standalone server
map to guest = bad user
usershare allow guests = yes
unix password sync = yes
browseable = yes
guest ok = yes
obey pam restrictions = no
server min protocol = NT1
client min protocol = NT1

[My Files]
path = /home/%U
read only = no
hide unreadable = yes
guest ok = no
valid users = @smbusers

[Share] 
path = /public/Share # A mount point to an external ntfs hard drive
read only = yes
hide unreadable = yes
guest ok = yes

The scenario is I downloaded files from my phone and copied it to "My Files" share. Later, I locally moved those files to "Share" - which is a mount point to an external NTFS hard disk drive. After that I went on my phone to watch from there. But the problem is those files appeared as folders on my phone.

Screenshot taken from my client phone

I grabbed my other laptop which has Windows 10 and Ubuntu installed. I booted Ubuntu first and browsed to the files location. It also displayed those files as folders. I tried to open one and it did nothing.

Screenshot taken from my client laptop running Ubuntu

Now I booted Windows 10. After opening one of the "folders" file explorer became unresponsive for a minute and then it gave me this error.

Screenshot taken from my client laptop running Windows with an error

I checked back on my server to see if those files actually turned into directories but they didn't.

Screenshot taken from my server laptop

I found a temporary fix on this problem. I just had to rename it and it now the server displays those as actual files. I tried to delete the following lines from the smb.conf but it didn't solve the problem.

server min protocol = NT1
client min protocol = NT1

I am not sure why this problem happens specifically when I am locally copying/moving files in the server. I suspect the reason is either because I was moving files from an ext filesystem drive onto an ntfs drive so the properties of those files are lost or I have configured my server wrong, though I am not sure which.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...