Invalid filename error when copying from one ntfs to another

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
n0madsoul
Level 1
Level 1
Posts: 8
Joined: Sun Aug 19, 2018 6:53 am

Invalid filename error when copying from one ntfs to another

Post by n0madsoul »

Hello there,

I am trying to backup some data to a freshly bought 1 TB USB Drive in Linux Mint. However, when I copy+paste it starts transferring data really quick at first, then slows down and ends with an error concerning directories that have dots in their names („Invalid filename“ or „Invalid argument“ when using cp in the command line). The strange thing is that this shouldn't be a problem, as the data already rests on an internal hard drive, which is also ntfs-formatted.

The only threads concerning this problem are about 10 years old and all consider just renaming the directories using some command line tools. That's fine for me if nothing else works, but I think I might be missing something here. Can anyone help? I am happy to provide any information necessary.

Thanks a lot.

Internal harddrive is a Seagate Barracuda ST1000DM010-2EP102
External harddrive is a Seagate Expansion Portable 1 TB
System is Linux Mint 20.1
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
karlchen
Level 23
Level 23
Posts: 18224
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Invalid filename error when copying from one ntfs to another

Post by karlchen »

Hello, n0madsoul.

Please share the complete unmodified commandline, which you execute, and the complete unshortened screen output, which the command displays, with us.
We need both in order to have an idea what the issue may be.

Best regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
n0madsoul
Level 1
Level 1
Posts: 8
Joined: Sun Aug 19, 2018 6:53 am

Re: Invalid filename error when copying from one ntfs to another

Post by n0madsoul »

Hello there and thanks for the quick reply. I can reproduce the error with this

Code: Select all

cp -R /mnt/580D692D5C65BD65/Dokumente/Bewerbungen/Zertifikate\,\ Zeugnisse\ etc./ /media/user/Seagate\ Backup/Dokumente
Outpout reads as follows

Code: Select all

cp: das Verzeichnis '/media/user/Seagate Backup/Dokumente/Zertifikate, Zeugnisse etc.' kann nicht angelegt werden: Das Argument ist ungültig
In English it would be this I guess

Code: Select all

cp: cannot create regular file 'xx': Invalid argument
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Invalid filename error when copying from one ntfs to another

Post by Flemur »

n0madsoul wrote: Wed May 12, 2021 8:33 am Hello there and thanks for the quick reply. I can reproduce the error with this

Code: Select all

cp -R /mnt/580D692D5C65BD65/Dokumente/Bewerbungen/Zertifikate\,\ Zeugnisse\ etc./ /media/user/Seagate\ Backup/Dokumente
Outpout reads as follows

Code: Select all

cp: das Verzeichnis '/media/user/Seagate Backup/Dokumente/Zertifikate, Zeugnisse etc.' kann nicht angelegt werden: Das Argument ist ungültig
In English it would be this I guess

Code: Select all

cp: cannot create regular file 'xx': Invalid argument
Yuo have a period at the end of the name (Zertifikate, Zeugnisse etc.) :
In addition to these characters, the following conventions are also illegal:
Placing a space at the end of the name
Placing a period at the end of the name
Edit: from here: https://kb.acronis.com/content/39790

The windows_names restriction is part of the partition mount parameters in linux, so the name could be OK on one partition but not another, depending how they're mounted.

Edit: with windows_names set:

Code: Select all

/mnt/BU_NTFS/DATA # ls > a
/mnt/BU_NTFS/DATA # ls > a.a
/mnt/BU_NTFS/DATA # ls > a.
zsh: invalid argument: a.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
freddyy
Level 1
Level 1
Posts: 5
Joined: Sat Aug 07, 2021 12:35 pm

Re: Invalid filename error when copying from one ntfs to another

Post by freddyy »

Thanks for the info.

and now ?

Such an operating system is not usable.

Will the problem be solved in the foreseeable future ?

I am a layman. Is it not possible to use the tool
from OpenSuse Leap 15.3 ?


Greetings

freddyy
mikeflan
Level 17
Level 17
Posts: 7136
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Invalid filename error when copying from one ntfs to another

Post by mikeflan »

You have a folder that has a period on the end of it. Maybe more than one. We are thinking you should remove that period. Is that possible / practical / acceptable to you?

If you open a terminal in the root of the NTFS drive and type
find * -type d -iname '*.'
That might list all the directories with a period at the end of them.
Can you rename them?
Is it not possible to use the tool from OpenSuse Leap 15.3?
Maybe. Do you know what the tool is called? Perhaps we can find another tool that does the same thing.

If you don't know how to open a terminal in the root of the NTFS drive, open a terminal and type this:

Code: Select all

df -Th
Then report the results here.
User avatar
karlchen
Level 23
Level 23
Posts: 18224
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Invalid filename error when copying from one ntfs to another

Post by karlchen »

Hello, freddyy.
freddyy wrote: Wed Aug 18, 2021 5:28 amSuch an operating system is not usable.
Which operating system do you consider unusable? Linux Mint? Or Windows? Or MacOS?
Mac OS permits having filenames and foldernames having a dot as the last character.
Windows does not permit so by default. Reason: The last dot in a filename is always considered the separator between filename and filename extension. No extension, no dot.
As you are copying from one NTFS filesystem to another NTFS filesystem, NTFS filesystem naming conventions apply. NTFS is a Windows filesystem type.
Linux Mint merely sticks to the NTFS filesystem rules in this case.

So which operating system is unusable? - I guess you will have to accept that different operating systems have got slightly different rules. And you will have to accept these rules.

Regards.
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
Locked

Return to “Storage”