0

I have a network (samba) share mounted at /run/user/1000/gvfs/smb-share:server=wdmycloud,share=family. Most activities work fine within the share - I can move stuff around, create and delete files, etc. However, if I cd into Music/Various Artists (both of which definitely exist) and try to create a specific directory, it fails:

$ mkdir "Pretty in Pink: The Original Motion Picture Soundtrack"
mkdir: cannot create directory ‘Pretty in Pink: The Original Motion Picture Soundtrack’: No such file or directory

mkdir -p also fails:

$ mkdir -p "Pretty in Pink: The Original Motion Picture Soundtrack"
mkdir: cannot create directory ‘Pretty in Pink: The Original Motion Picture Soundtrack’: No such file or directory

However, mkdir functions fine for other directory names:

$ mkdir test
# no output, directory created

What's special about the name Pretty in Pink: The Original Motion Picture Soundtrack that mkdir chokes on it? How can I get around this issue?

Please don't judge me for the music, I'm doing this for someone else...

1

1 Answer 1

5

Colons aren’t valid characters on SMB/CIFS shares — Windows uses them for drive letters. The failing directory name contains one, which is why mkdir fails.

6
  • ... yep. Cool and bad. Good thing this drive has an FTP frontend as well.
    – c-x-berger
    Aug 1, 2020 at 16:39
  • 2
    @c-x-berger if you create a filename containing a colon then you won't be able to see it across the Samba share unless you've either mangled names = yes (horrible) or you've enabled catia and are happy for the colon to be rewritten as a similar-but-different character
    – roaima
    Aug 1, 2020 at 16:40
  • @roaima unfortunately, the Samba share is hosted by a consumer-grade network drive that I can't really configure that much. However, it presents other frontends (FTP, NFS, etc) that actually work and I don't think these files need to be accessed by anything besides a Linux HTPC.
    – c-x-berger
    Aug 1, 2020 at 16:42
  • Samba won't show "illegal" file names without the catia module enabled
    – roaima
    Aug 1, 2020 at 17:42
  • 3
    I’d say NFS would be a better replacement, at least you could mount your storage in a similar manner to what you have now. Aug 1, 2020 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.