5

I have an external USB HD that I want to backup my music to.

When I try using rsync or cp, most files copy, but some don't because of this error:

invalid or incomplete multibyte or wide character

How do I fix this?

For reference here is how the source drive is mounted:

 /dev/sdb3 on /media/Music type vfat
 (rw,nosuid,nodev,noexec,noatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro,user)
 [Music]

Here is how the USB external drive (destination) is mounted:

 /dev/sdf1 on /media/username/Seagate Backup Plus Drive type fuseblk
 (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
 [Seagate Backup Plus Drive]

Any help would be appreciated!

  • 1
    you probably have files with bad names .. you will need to see which one of them are giving you the error and check the name for issues like special characters or paths that are too long ... I have had copying issues in Windows because the path and filename were too long. – John Orion May 23 '16 at 20:36
  • The files are ok (at least in linux). The ones that generate errors tend to be foreign language files. But shouldn't there be a way to fix this? – user2662680 May 23 '16 at 20:43
  • its probably accents or something like that .. you may have to rename those files without the accents or special characters... give it a try .. couldn't hurt . find one of the files that you have issues copying and try renaming it to test or something simple and see if you can copy it without errors .. if you can then it has something to do with the name and I have seen that on a couple of mine with Spanish titles. – John Orion May 23 '16 at 22:03
  • Renaming the files would be tricky. I have a huge banshee library that is mapped to specific file names and I would be very leery of changing the file name if possible. – user2662680 May 23 '16 at 22:30
  • "the files are ok (at least in linux)." sure, but why make a comment like that if the system is "vfat"? They are not fine for "vfat". You need to change the disk to "ext" or change the files to what "vfat" accepts as valid. – Rinzwind Jun 10 '16 at 17:27
4

For anybody curious I did solve this. First I determined that the charset on the old VFAT drive was ISO-8859-1 (very common for Windows). I then executed a rsync command with the option to convert the old charset to UTF-8 and that did the trick.

Example:

rsync -vaW --size-only --iconv=ISO-8859-1,utf-8 /media/Music/* '/media/username/Seagate Backup Plus Drive/Backup - Music/Music' > ~/rsynclog.txt

Hope that helps somebody else!

  • Music names can have other problems than odd characters, like spaces, and potentially worse, parentheses, (or other bash commands). Exposing them on the command line without proper quoting is risky. Hope the copy used directory names which were pre-checked for such problems too. – ubfan1 May 25 '16 at 16:11
  • This is a much better solution than renaming the files - a modern filesystem should allow international characters, and if you're backing up to an ancient filesystem you should be able to dumb them down. Just be warned that if you have to copy back to the original (HD crash, or you make an update on the copy), you'll end up with dumb filenames. – andrew lorien Feb 5 '18 at 4:23
1

If the problem is specific to your system (e.g. copy of file with special caracters in their names works in Windows or on other GNU/Linux distribution) you may want to add the option iocharset=utf8 at the end of your mount command. That solved the problem for me.

  • I vastly prefer this answer. – ulatekh Sep 1 at 23:45

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.