openzfsonwindows / openzfs

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

ZFS cannot work with special character ( | ) #391

Closed derritter88 closed 2 months ago

derritter88 commented 3 months ago

System information

Type Version/Name
Distribution Name Windows 11 23H2
Architecture amd x64
OpenZFS Version zfs-2.2.99-149-gf9ec771f74

Describe the problem you're observing

When trying to backup my YouTube videos ZFS seems to have troubles again with some file names. Betrunkener September | Terminator-Schnaps | Adult Swim [x4-Who_dlHA].mkv is not being tried to copy over. Instead the compare and copy process hangs forever.

lundman commented 3 months ago
<chatgpt>
ZFS does allow filenames with the "|" (pipe) character. However, NTFS (the filesystem used by Windows) 
does not support using the "|" character in filenames. NTFS has a set of reserved characters that cannot 
be used in filenames, and "|" is one of them.

So hmm I guess we could UTF-8 encode them or something.

lundman commented 3 months ago

Heh it read my mind

unfortunately, UTF-8 encoding the "|" character won't allow you to save it in NTFS filenames. NTFS has specific rules about which characters are allowed in filenames, and even if you encode special characters like "|" using UTF-8

derritter88 commented 3 months ago

Which would be interessting as on my personal Win23h2 desktop as well as on the SMB Win Server it allowed me to save the file with multiple | characters

derritter88 commented 3 months ago

Also with former ZFS versions it worked well. And if I would like to export a drive the whole ZFS process hangs:

zunmount(Serien/Backup,H://Backup) running
zunmount(Serien/Backup,H://Backup) returns 0
zunmount(Serien,H:/) running
zunmount(Serien,H:/) returns 0

The command was entered about and hour ago

sskras commented 3 months ago

@derritter88 commented:

Which would be interessting as on my personal Win23h2 desktop as well as on the SMB Win Server it allowed me to save the file with multiple | characters

Does md "A|B" command really work for you? Win10 21h2 does not allow this:

image

EDIT: That's on NTFS, of course.

derritter88 commented 3 months ago

@sskras No that also do not work for me. But it is interessting as I downloaded a video via yt-dlp on Ubuntu (WSL) to my regular Windows download folder and it accepted it without any problems. Also copying the whole file over to the server did not cause any troubles.

lundman commented 3 months ago

The | utf8 thing refers to ntfs, fairly sure I can encode it in ZFS, if it even reaches us. This will be the thing to test, if you use | in explorer, does it reject it before calling ZFS

sskras commented 3 months ago

IMO, reserved ASCII characters like | are being filtered out at WinAPI level: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions

lundman commented 3 months ago

Yeah, can't even type one into Explorer, so pretty far from getting into ZFS code. Be fun to create on Unix, import - we surely will display the names with | fine, but you presumably can't do anything with it.

derritter88 commented 3 months ago

The problem I got now is that after there was no progress with the pipe character, no zpool and also no zfs command are working now. It is like it's waiting for the command to finish.

Is there any way to reload the driver?

lundman commented 3 months ago

zfsinstaller.exe uninstall path/to/openzfs.inf - but I think that too will get stuck if it really is stuck waiting on something. Reboot will clear it.

derritter88 commented 2 months ago

Okay another issue where ZFS hangs (but previous ZFS versions worked): grafik

This would be the mounted ZFS volume which is being compared to the regular Windows path via FreeFileSync

derritter88 commented 2 months ago

I had to destroy the ZFS pool and create a new one - that was the only way to get the backup process back working