openzfsonwindows / openzfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
455 stars 16 forks source link

can write but not read on local mapped drive #365

Open hspantera opened 6 months ago

hspantera commented 6 months ago

Hope someone can help me. configured pool with assing letter on windows 11. can acess from the local pc to the drive letter and can read,write and make everything. but when i share the drive letter to can access from another pc on the same network i can acess the share see whats inside, write to but i cant read nothing froom there. i have some movies that i can see on my netwok share but when i try to open vlc says the file dont exist and cant reproduce. but i can write to that share. i give all permissionson windows pc. do i have to give any permissions on openzfs to acess? hope someone can help.

System information

Type Version/Name
Distribution Name
Distribution Version
Kernel Version
Architecture
OpenZFS Version

Describe the problem you're observing

Describe how to reproduce the problem

Include any warning/errors/backtraces from the system logs

lundman commented 6 months ago

OK, so everything works as expected on local machine. Then you share over Samba A network client accessing it, can read, but not write ?

hspantera commented 6 months ago

Yes . On local machine 100%. Local share can write but not read.. strange . I can see the files . For example I see all my Mkv movies but when I open gives me an error. Don’t play.

hspantera commented 6 months ago

Sorry. On network client that this happens. Can’t read but can write.

lundman commented 6 months ago

Yeah, I'll dig into it tomorrow. If you are bored, run "FileSpy" as Administrator http://www.zezula.net/en/tools/filespy.html and change it to monitor your ZFS drive, then make the client write problem happen, could be it will give hints.

hspantera commented 6 months ago

No.. no problem in write. Only read. IMG_6747

this is my local zigs drive.

IMG_6748

This is my network share on another windows 11 pc on same network

IMG_6749 IMG_6750

I can see all files and folders . Can write to share but can’t read. If I try to read from voc it show me this error.

IMG_6751

very strange. Because I can access.. see what’s in there.. write to it. But can’t read files.

lundman commented 6 months ago

error when dragging to desktop or somewhere to copy?

hspantera commented 6 months ago

Yes.. won’t let me read too

lundman commented 6 months ago

ok thanks. I'll check what FileSpy says tomorrow

hspantera commented 6 months ago

FileSpy info.zip

here is filespy when i try to acess video file on client share

lundman commented 6 months ago

Hmm interesting - it's certainly trying a few times, and something makes it unhappy.

hspantera commented 6 months ago

very strange. but it happens on both windows clients with windows 11 pro workstation installed. same error on both.

lundman commented 6 months ago

Refuse a lock, and the open-by-id seems to fail. Could be either of those two, or of course, something completely different

hspantera commented 6 months ago

i have 2 windows clients on same network and they both do exactly the same thing. can see whats inside, can write to the share but cant read or do nothing with existing files.

hspantera commented 6 months ago

Another strange thing that happens

IMG_6752

open a folder

IMG_6753

then select mkv file

IMG_6754

give me an error on vlc can’t read

IMG_6755

and if I open again same folder it shows empty. No mkv file. But I go to the original pc and open folder and it’s there. Only on client don’t show. It does this with all files I try to open on client share. Open file. Gives error. Open folder again and it’s empty. But the file still existed on original pc.

hspantera commented 6 months ago

But after a while I open the folder and it shows the file again. But if I try to play gives error and desapears again.

hspantera commented 6 months ago

IMG_6757

this is my zpool.

lundman commented 6 months ago

yes it is just that it uses something unexpected to verify the file is there, and ZFS replies incorrectly, so it removes it. Small files, like .nfo/.sfv also fails to read? In case it is a filesize thing

hspantera commented 6 months ago

It opens a small winrar file of file spy for example. But .srt file don’t show on client. I copy 5 srt files to the original zpool folder and on client don’t show the files.

hspantera commented 6 months ago

.txt file don’t show too.

lundman commented 6 months ago

OK, not a filesize thing. I didn't it was, but worth ruling out.

hspantera commented 6 months ago

Hi. Have a question not related with this problem. I extended my raidz2 with one new hard drive. Has you can see in picture is resizing. It says it will take 4 days. My question is: Can I export the pool and change all drives to new system and import the pool and continue to resizing from where it lefted when I export it? Thanks

IMG_6765

lundman commented 6 months ago

ZFS it supposed to let you do that, and it will continue to resilver. Haven't tried it but the core is the same.

hspantera commented 6 months ago

Ok. I will do it.. after I import in new system I have to execute any command? Or it starts resizing automatically?

lundman commented 6 months ago

Should just start, afaik

hspantera commented 6 months ago

Yes.. worked perfectly.. started resizing automatically. Thanks. What about the bug of share? Did you see anything? Thanks.

lundman commented 6 months ago

OK, so smb works here, but one side is Win10 - so it could be that Win11 has changed something. But in the FileSpy it clearly tries FileFsObjectIdInformation multiple times, so I have implemented that - perhaps it will help.

Can you try:

OpenZFSOnWindows-debug-2.2.3rc2-2-geb5def3b01.exe

from releases.

hspantera commented 6 months ago

Installed and still has same problem..

lundman commented 6 months ago

Rats - can you do a new FileSpy - so we can see how it behaves now?

hspantera commented 6 months ago

FileSpylog.zip

here t is.

lundman commented 6 months ago

Thanks. Looks pretty good, does retry a bunch of times, which sort of suggests it's not happy about something, even if we now have implemented one of the calls. IOCTL_MOUNTDEV_QUERY_DEVICE_NAME still fail, but I think it is supposed to. I will have to set up a Win11 client as well, and give it a whirl myself.

lundman commented 6 months ago

If you are reeeaaallly bored, and I don't expect you to be, create a .vhdx file, format NTFS, copy a file to it - perhaps the same one as in filespy, and run FileSpy reading over SMB from that NTFS device. Can compare the two filespy logs and see if anything stands out.

but i get it if you dont have time, I'll get to it.

lundman commented 6 months ago

Hmm even with both VMs being Win11 I can not replicate the read problem. I get plenty of permission issues over SMB, like trying to create a new directory, but playing the files seem to work fine. Tested with latest VLC 3.0.20

hspantera commented 6 months ago

Maybe it’s because it’s windows 11 pro workstation?

hspantera commented 6 months ago

All of my 3 systems are windows 11 pro workstation.

lundman commented 6 months ago

Hard to imagine why they would have a different SMB on it, but I suppose it is possible.

sskras commented 6 months ago

@hspantera: you probably know – there are two permission mechanisms that control shared folders: NTFS Permissions vs. Share Permissions – What’s the Difference?

What's both of your sets? Mine:

hspantera commented 6 months ago

I activated share via windows and get full permissions for all.. so it’s anything I have to do? I have a normal hard drive with this configuration and it works well.. only the pool share ( that I give full permitions via windows) has this problem.

sskras commented 6 months ago

To be double sure, can you please get the output of powershell "Get-SmbShareAccess -Name SHARE-NAME" for both of you shares?

hspantera commented 6 months ago

IMG_6770

it gives me this error.

lundman commented 6 months ago

oohh what does ntfs share say? can you filespy that too and I'll implement whatever is missing

hspantera commented 6 months ago

But I make a shed not by command line. I make it on windows normally.

hspantera commented 6 months ago

I’m running locally. So a shared normally as I shared normal folders on pc.

hspantera commented 6 months ago

IMG_6771

my pool share is X: How do I execute the command for knowing the permitions of NTFS and share permissions?

lundman commented 6 months ago

share one of your ntfs drive (or make a vhdx) then map it to drive letter

hspantera commented 6 months ago

IMG_6772

my pool share permitimos NTFS.

sskras commented 6 months ago

@hspantera wrote:

my pool share is X:

And the share name for that resource is simply X. So the 1st command would be:

powershell "Get-SmbShareAccess -Name X"

How do I execute the command for knowing the permitions of NTFS and share permissions?

In addition to the version that you did, the 2nd command could also be:

cacls X:\

... but your powershell Get-Acl X: was nice too. I didn't know it, so thanks for telling. :)

hspantera commented 6 months ago

powershell "Get-SmbShareAccess -Name X” On cmd don’t work. IMG_6773

I’m doing something wrong?

hspantera commented 6 months ago

Already dit it.

IMG_6774

I have full permitions.

sskras commented 6 months ago

Already dit it. [...] I have full permitions.

Thanks. Full Access via Network is permitted only for the Todos account, and no one else. Are you sure you are accessing this share from the remote machine (via SMB) under the same username?

PS. Also can you please return to the NTFS/local permissions command and expand it to that form:

Get-Acl X: | Format-List

The default output looks truncated in your photo. It should look like this:

PS C:\Users\saukrs> Get-Acl D: | Format-List

Path   : Microsoft.PowerShell.Core\FileSystem::D:\
Owner  : NT AUTHORITY\SYSTEM
Group  : NT AUTHORITY\SYSTEM
Access : NT AUTHORITY\Authenticated Users Allow  -536805376
         NT AUTHORITY\Authenticated Users Allow  Modify, Synchronize
         NT AUTHORITY\SYSTEM Allow  FullControl
         NT AUTHORITY\SYSTEM Allow  268435456
         BUILTIN\Administrators Allow  268435456
         BUILTIN\Administrators Allow  FullControl
         BUILTIN\Users Allow  ReadAndExecute, Synchronize
         BUILTIN\Users Allow  -1610612736
Audit  :
Sddl   : O:SYG:SYD:(A;OICIIO;SDGXGWGR;;;AU)(A;;0x1301bf;;;AU)(A;;FA;;;SY)(A;OICIIO;GA;;;SY)(A;OICIIO;GA;;;BA)(A;;FA;;;B
         A)(A;;0x1200a9;;;BU)(A;OICIIO;GXGR;;;BU)
hspantera commented 6 months ago

IMG_6775