Cannot create new files with ":" in their filenames, but I have already 13300 of them that work fine (linux, ntfs partition)

0

I have a Windows 10 / Manjaro (4.19.32-1-MANJARO) dual boot. All my personal data is stored on an NTFS partition that I use in both systems.

I have a project which involves pictures with some colons (:) in their filenames. I can access those files correctly in Linux (I know I can't with Windows, and it's fine).

However, when I try to create new files with special chars like : (from Linux, of course), in this partition, I can't. It worked fine until recently (2-3 weeks ago). I noticed the issue today.

Example using touch:

[user@user-thinkpad Data]$ touch a\:b
touch: setting times of 'a:b': No such file or directory

Another example:

[user@user-thinkpad Data]$ echo "Hello Hello" > 'a:b'
bash: a:b: Invalid argument

Copying from an external NTFS drive (new files for the project) doesn't work either, using the Files explorer:

enter image description here

Any idea why?

Here is what the mount options look like:

/dev/sda3  on  /run/media/user/Data  type  fuseblk     (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
[user@user-thinkpad Data]$ sblk -f | grep sda3
├─sda3 ntfs     Data    36A83041A83001C3    52.6G    80% /run/media/user/Data

I'll be happy to share some more information about my system if needed.

Note: I always use the command shutdown /s /t 0 to completely shut Windows down before booting Manjaro.

hibol

Posted 2019-04-07T13:48:14.757

Reputation: 3

2What happens when you try to create them? Any error messages? Are you creating them via the terminal? If so, what command(s) are you using? – Nasir Riley – 2019-04-07T13:53:02.433

Thanks, I edited the question. – hibol – 2019-04-07T13:57:18.737

Does this command work: echo "Hello Hello" > 'a:b'? If it doesn't, add the error to your question. For the error in your image, try copying the file by surrounding it with single quotes. – Nasir Riley – 2019-04-07T14:13:53.860

Done. For the error in the image, I used the files explorer to try to copy a file. The double quotes are only on the error message. – hibol – 2019-04-07T14:17:18.897

My mistake. The command should be: echo "Hello Hello" > 'a:b'. – Nasir Riley – 2019-04-07T14:30:16.607

Exactly same result – hibol – 2019-04-07T14:31:39.047

Do the commands work on another partition/filesystem such as your home directory? I'm thinking that it may be your environment. I'm not able to reproduce this in my Arch Linux VM (Manjaro is derived from Arch Linux). The commands work without the errors. – Nasir Riley – 2019-04-07T16:05:27.120

Yes, it works inside my home directory. On the worst case, I'll rename all my files but I am really curious to know why this happens and would be happy to solve the issue. – hibol – 2019-04-07T16:10:28.600

Add the output of lsblk -f | grep sda3 to you question. That will show the actual filesystem instead of fuseblk. – Nasir Riley – 2019-04-07T16:16:19.190

The ":" is how you access multiple data streams on NTFS from within Windows, such as file:s1 file:s2 etc. Are you trying to access different data streams within the same file through Linux? – Alex Cannon – 2019-04-08T00:42:00.337

Instead of mounting the drive as fuseblk, install ntfs-3g via pacman -Sy ntfs-3g and the mount it as ntfs via mount -t ntfs /dev/sda3 /mount/point. – Nasir Riley – 2019-04-08T01:55:05.720

@AlexCannon Nothing so special. I am just dealing with jpg files that are named "yyyy-mm-dd.hh:mm:ss.jpg – hibol – 2019-04-08T08:32:05.673

@NasirRiley Thank you! mount -t ntfs /dev/sda3 /mount/point solves the issue. You can post this as an answer, and it would be perfect if you can explain how I can mount this partition automatically this way when the system boots. – hibol – 2019-04-08T08:33:52.550

@hibol well / : * ? " < > | are all illegal characters for file names when created in Windows explorer NTFS on XP. Maybe a bug was corrected in ntfs-3g. – Alex Cannon – 2019-04-08T17:39:05.587

Answers

0

Instead of mounting the drive as fuseblk, install ntfs-3g via pacman -Sy ntfs-3g and the mount it as ntfs via

mount -t ntfs /dev/sda3 /mount/point

To have it mount at boot, add this line to /etc/fstab:

/dev/sda3 /mount/point ntfs-3g defaults 0 0

To make sure that it works, unmount the drive first via:

umount /mount/point

Then remount it via

mount -a

That will make sure that it will mount at boot with no errors.

Nasir Riley

Posted 2019-04-07T13:48:14.757

Reputation: 886