17

I can't create folders or files named 'com1', 'com2', ..., 'com9' in my extended hard drive. I'm trying to create a Wine prefix on my other drive where my games are stored, but I get some errors.

enter image description here

Here is a pastebin of the whole output when I run winecfg to a new prefix. https://pastebin.com/SsaAFGdw

I believe it's not a permission issue since I can make directories and files. And, I also tried creating a prefix from my main boot drive, then move it to my extended hard drive, then I get errors when it's now trying to copy files named 'com1', 'com2', ..., 'com9'.

enter image description here

This is how my extended drive partitioned: enter image description here

sudo WINEPREFIX='path' winecfg also does not work, same result.

EDIT: OS: Manjaro KDE Plasma

Output from mount | grep /dev/sdb:

/dev/sdb2 on /run/media/snich/Extended type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb4 on /run/media/snich/Games type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb3 on /run/media/snich/Personal type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
4
  • 8
    Some background info: youtu.be/bC6tngl0PTI
    – R.M.
    Commented Oct 5, 2022 at 14:41
  • 11
    Please don't post screenshots of text. Copy the text here and use code formatting instead: unix.stackexchange.com/editing-help#code
    – muru
    Commented Oct 6, 2022 at 3:10
  • @muru I'm not sure which screenshot I should had included as text.
    – snich
    Commented Oct 7, 2022 at 12:18
  • 1
    The first two can be just text
    – muru
    Commented Oct 7, 2022 at 14:58

2 Answers 2

32

Assuming ntfs-3g is used,windows_names is probably set somewhere as an option. Seen man page

OPTIONS

windows_names

This option prevents files, directories and extended attributes to be created with a name not allowed by windows, because

  • it contains some not allowed character,
  • or the last character is a space or a dot,
  • or the name is reserved.

The forbidden characters are the nine characters " * / : < > ? \ | and those whose code is less than 0x20, and the reserved names are CON, PRN, AUX, NUL, COM1..COM9, LPT1..LPT9, with no suffix or followed by a dot.

Existing such files can still be read (and renamed).

Edited response :

I'm currently with debian/Buster and there is a /etc/udisks2/udisks2.conf file containing :

### For the reference, these are the builtin mount options:
# [defaults]
[...]
# ntfs_defaults=uid=$UID,gid=$GID,windows_names
# ntfs_allow=uid=$UID,gid=$GID,umask,dmask,fmask,locale,norecover,ignore_case,windows_names,compression,nocompression,big_writes

So, for debian, and probably most of their derivatives, mounting an NTFS implies using option windows_names. As explained in the same file (a little bit higher), you could try putting your options in a /etc/udisks2/mount_options.conf file. Just edit/create the file, copy those two lines, remove leading hash and remove option windows_names. Do everything as root, and take care of permissions.

Unmount and re-mount.

(Now, I'm not sure all this is a good advise : as Wine will act "à la" MS-Windows, this will not end to be a good thing.) This is just a feeling, not fact, and many others did proved it doesn't hurt.

Enjoy !

7
  • 8
    They really didn't like the folder called NUL I created on the file server a decade and a half ago.
    – Joshua
    Commented Oct 5, 2022 at 17:47
  • 1
    this will not end to be a good thing... this isn't true at all. Windows supports names like con, lpt or comX... without any problem. It just forbid them by default for backward compatibility with DOS. You can create files with those names in Windows by prepending \\?\ to the name
    – phuclv
    Commented Oct 6, 2022 at 15:20
  • @phuclv and Joshua are right, I just gave there a bad feeling without any proof. I edited my response.
    – user4089
    Commented Oct 6, 2022 at 17:08
  • 2
    @phuclv Just because NTFS (and Windows) supports them doesn't mean applications will. If an application tries to open your file named COM4 without using UNC form (the `\\?` prefix), they'll get an error. Most programs don't use UNC paths because they're not really necessary. Since OP is using Wine, the programs they use probably will have issues.
    – Cole Tobin
    Commented Oct 6, 2022 at 17:38
  • @ColeTobin: Explorer on windows doesn't use `\\?` so ...
    – Joshua
    Commented Oct 6, 2022 at 20:35
8

WINE is emulating Windows and so must be compatible with it. COM* are reserved words for com (serial) ports under MSDOS and WINDOWS.

Microsoft help

Do not use the following reserved names for the name of a file:

CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended. For more information, see Namespaces.

10
  • 10
    That in itself doesn't explain why it won't work. These reserved names are a (1970s to 1990s) MS-DOS problem, and not at all applicable to Linux. And the NTFS file system in itself also doesn't care about these names. But you're of course right – someone added this as a "safeguard" to the Linux NTFS driver, so that you can't create a file that will later be completely unusable by windows machines. Commented Oct 5, 2022 at 5:01
  • 9
    That's how DOS was and that's how Windows is. If you look at the link? Its dated 2022 and is for windows. WINE is emulating Windows, so it has to work like Windows. Commented Oct 5, 2022 at 6:03
  • 7
    Wine is completely irrelevant to the problem at hand. Nothing here is done through a layer of wine. Commented Oct 5, 2022 at 6:06
  • 4
    His tag is wine Commented Oct 5, 2022 at 6:13
  • 6
    @MarcusMüller Wine actually is very relevant here because OP wants to use these dirs for Wine. Thus even if OP decided to disable this safeguard and make these directories anyway, the end result would still be completely unusable by Wine. Sounds like an issue that's certainly worth mentioning. (Also, OP did actually try creating these dirs "through a layer of Wine" as well.)
    – TooTea
    Commented Oct 6, 2022 at 8:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .