1

I have a filesystem with some old files, which were probably copied there with some windows encoding in filenames (and not UTF8). When I try to backup them to samba share (Hetzner Storage Box) via CIFS-mounted filesystem, the files are created, but are not accessible in any way. The only way to remove them is via other means (like SFTP access to the share). I am using rdiff-backup, but the same happens with rsync or plain cp.

Original file:

-rwxr-xr-x 1 www-data www-data 2082 May 21  2010 ./domain/old/images/images2010/news/53x53_A?istýjrancejevonku.jpg

File on the samba share:

ls: '53x53_A?istýjrancejevonku.jpg': No such file or directory
total 48
-rwxr--r--  1 root root 2082 Nov 20 23:49 53x53_A?istýjrancejevonku.jpg

The share is mounted with unix/posix extensions, but needs vers=1.0 option in Debian 11 as otherwise it says unix extensions are not available on the server via SMB 3.1.1.

grep cifs /proc/mounts
//xxx.your-storagebox.de/backup /backups/xxx cifs rw,relatime,vers=1.0,cache=strict,username=xxx,uid=0,forceuid,gid=0,forcegid,addr=2a01:xxxx,soft,unix,posixpaths,serverino,mapposix,acl,noperm,rsize=1048576,wsize=65536,bsize=1048576,echo_interval=60,actimeo=1 0 0

Filenames with utf8 chars are working normally when copied to this share, just files with non-utf8 chars are problematic. Is there any mount option which can allow me to copy/backup these files? Or rdiff-backup option, which would workaround it (I guess not as the copy operation itself succeeds)?

5
  • I have a filesystem What's its type?
    – Tom Yan
    Commented Nov 21, 2022 at 5:58
  • @TomYan ext4 created on debian 11. Contents was rsynced from ext4 on debian 9, but as I said, the files on ext4 are accessible without issues (although with weird filenames).
    – Marki555
    Commented Nov 21, 2022 at 9:23
  • I was thinking about the iocharset mount option that is available in some "not-no-native" filesystem types. I wonder what kind of "state" the filename is in the filesystem. (Perhaps with certain locale it could show "properly"?) Btw, I don't suppose you can access the file on the ext4 with the name single-quoted in shell (or having a backslash before the ?)?
    – Tom Yan
    Commented Nov 21, 2022 at 11:09
  • @TomYan of course not with that ? char, but with shell autocomplete I can access the file. Also find can access the file. On the samba share, find will just show error that the filename does not exist (hmm maybe samba returns different string for "readdir" and for "stat" of the actual filename).
    – Marki555
    Commented Nov 21, 2022 at 11:59
  • Got sane problem with network drive. They work fine with windows, so i mount it in linux as automounf with "-fstype=cifs". Unfortunately MailDir files have ":"-char with filenames. They are copied fine to network drive, but ":" in the filename is changed to "?", so they can not be accessed and not even seen in linux that nakes automount, but are in the in network drive - which is linux machine -, of you connect with ssh to it. I haven't found solution yet. Commented Jan 24 at 20:14

1 Answer 1

1

(1) Workaround :

You can try this :

cd ./domain/old/images/images2010/news/
mv 53x53_*ancejevonku.jpg normal_name.jpg

Proceed with your workflow.
When required , you can rename that back to something like the original.

(2) Solution :

I am not very clear what your Issue is or what you want to achieve.
The way I am interpreting your Situation , this Solution will work :
On the Original Directory, top-level of the back-up , you can make a zip (or tar) file of the whole Directory.
Then back-up this zip (or tar) file to you cifs volume. The weird filename will then be hidden inside that container , hence the workflow will not encounter the Current Issue.
When necessary , you can unzip to the original Directory where the weird filename will come out to be visible , but there is no Access Issue on the workflow there.

4
  • Yes, I could do that on the original filesystem, but there are at least 100 such files on this 300 GB filesystem and I'm not sure if customers are not referincing to those weird-encoded filenames from their database/websites. And I cannot rename it back to original, as the backup job to samba share will be run daily.
    – Marki555
    Commented Nov 21, 2022 at 9:24
  • I updated that Answer , @Marki555
    – Prem
    Commented Nov 21, 2022 at 11:06
  • Also the 2nd is just workaround as it requires the files on the original fs to be removed/renamed and as those files are not mine, I don't want to do it unless really needed. But it might be useful for others, so I upvoted the answer.
    – Marki555
    Commented Nov 21, 2022 at 12:02
  • Or you mean to backup the whole filesystem as one big zip archive? That won't work as I am running daily incremental backups via rdiff-backup tool.
    – Marki555
    Commented Nov 21, 2022 at 12:03

You must log in to answer this question.

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