Windows forbidden characters in file names on NTFS

I’m using a USB external harddisk with NTFS as my backup for several OpenSuse and Wiindows machines.

The problem is with file names, an example being a filename containing “|”, and using windows to access an OpenSuse written file or directory.

OpenSuse writes and reads the files as they are, while windows chokes on names with forbidden characters, you can’t even delete them.

Any suggestions how to handle this?

rih5342 wrote:
> I’m using a USB external harddisk with NTFS as my backup for several
> OpenSuse and Wiindows machines.
>
> The problem is with file names, an example being a filename containing
> “|”, and using windows to access an OpenSuse written file or directory.
>
> OpenSuse writes and reads the files as they are, while windows chokes
> on names with forbidden characters, you can’t even delete them.
>
> Any suggestions how to handle this?

Get another disk and format it with a Linux filesystem

+1
By backing up to a non-Linux file system, you not only have that file name problem, but you also loose most of the meta-data that belongs to the file like owner, group, permission bits.

My advice is to use non-Linux file systems only for direct exchance with non-Linux systems (in that case you have to handle those incompatablities anyhow, in one or the other direction). But never use it for all Linux situations (like backups, I bet that in case of a disaster you want to restore things as they were when you made the backup).

(BTW it is not needed to get another disk I guess, creating an ext4 fs on that very disk is also an option when nothing important is on it yet).

I do that too.

You run into filename problems if you backup with direct copying. If you use some kind of archive then you only need to be careful about the name of the archive. So use “zip” or “tar” or “dar” or similar.

I am currently using “dar” to backup linux, and Acronis True Image to backup Windows.

You can create a permanent map for your External hard drive in your /etc/fstab file by editing the file manually as root or using the YaST / System / Partitioner where you elect to only mount and to not format the drive. You can the add in the option called “**windows_names” **which would prevent file names not supported by Windows being used. Here is an Example of such a mount:

/dev/disk/by-id/usb-ST32000641AS_9WM0BWE8-part2                    /Windows             ntfs-3g    defaults,**windows_names,**nofail,noatime                                        0 0

The name of your drive would be different. I am using the folder name /Windows to mount the drive. When mounting an external hard drive do not use the default mount folders for this mount but use something different and from the root generally. For editing files as root, have a look at this utility.

SYSEdit - System File Editor - Blogs - openSUSE Forums

Thank You,

Depends on what you mean by “backup.”
If you’re simply copying files, then you’ll have that problem.

If you use a proper backup program that supports and understands Windows file names, then it shouldn’t be an issue since the individual files are compressed into a single file which could be named anything and therefor comply with NTFS restrictions.

So, the most simple example could be to grab a bunch of files you want and ZIP or RAR them into a single file on the target destination.
Restoring would be simple, unzip or unrar (extract) files to the chosen (perhaps original) location.

HTH,
TSU

i find that using 7z as a back up archive works VERY well
ARC will even list the folder structure and allow you to extract only one file if that is all you need .

it also supports encryption and passwords

so if all your backup’s are archived BEFORE moving them to the NTFS drive , there should not be problems.
UNLESS there are non std characters in the archive name .Then use the above mentioned fstab mount option to prevent that .

Great comments, thank you.

You are welcome for the help. If you elect to use any advice here, you might come back and tell us what it was and if it helped. It can be helpful for anyone else reading this message with the same issue. If you need further help, just let us know and good luck.

Thank You for using openSUSE,

This is what I did.

  1. My “backup” is a simple copy and paste.
  2. In the OpenSuse directory, I did a search for the forbidden characters, then deleted the forbidden characters, using rename.
  3. Looking to the future, with the external-USB drive mounted, I tried to use YAST/System/Partition, and add “windows-names” to the option window which was greyed out and un-editable.
    Considering the “Use-Extreme-Caution” warning accompanying the YAST/System/Partition program, I chose to abort.

Thank you.

On 2013-07-15 02:56, rih5342 wrote:
> 2. Looking to the future, with the external-USB drive mounted, I tried
> to use YAST/System/Partition, and add “windows-names” to the option
> window which was greyed out and un-editable.

I think you may only do that if the filesystem is mounted via fstab, not
automatic.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)