View previous topic :: View next topic |
Author |
Message |
Princess Nell l33t
Joined: 15 Apr 2005 Posts: 917
|
Posted: Mon Aug 28, 2023 11:39 pm Post subject: Filesystem question |
|
|
This is wrecking my head.
I need to copy data from an old microSDHC card to a new one. Both cards are the same size and show up as "exfat" under df -T. Both cards show disklabel type dos and Type HPFS/NTFS/exFAT in fdisk. Yet, there are files I cannot copy from old to new because of illegal characters. E.g.
Code: |
/bin/cp: cannot create regular file '/run/media/user/0123-4567/music/Rachmaninoff/Rachmaninoff Symphonies and Vocalise/Rachmaninoff - Symphony No.3 In a, Op. 44: III. Allegro.mp3': Invalid argument
|
The new card came pre-formatted, and while I can't remember, I have no reason to believe I formatted the old card myself.
Why do the cards present themselves differently when the filesystems appear to be identical?
Would I have better luck if I formatted the new card myself (under Gentoo)? |
|
Back to top |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Tue Aug 29, 2023 12:18 am Post subject: |
|
|
If you are sure that the source card is of the exact same size in sectors or at least smaller than the destination card you can dd it or cat it in the new card and you have an exact copy of the source on the destination. Well I don't know how to expand an exfat filesystem because I do it only on Ext4 filesystems.
Expand a partition and a filsystem is only needed when the source is smaller than the destination if you want all the space of the card. You never make a bit to bit copy when the source is bigger than the destination. I use Rsync for data copy. It's more relevant than cp. _________________ Paul |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 21849
|
Posted: Tue Aug 29, 2023 12:31 am Post subject: |
|
|
What illegal characters are there? That name appears to be representable in basic ANSI. It has no high characters, nothing that requires Unicode, and no control characters. |
|
Back to top |
|
|
Princess Nell l33t
Joined: 15 Apr 2005 Posts: 917
|
Posted: Tue Aug 29, 2023 7:00 am Post subject: |
|
|
https://en.wikipedia.org/wiki/Exfat list the allowed characters. So in this case, it's the colon, ':'.
I have another album on the card which has colons in every song title, but only some of those don't copy.
As I have only one card slot, I'm copying the old card contents to my home dir (ext4) temporarily. Here, the files that don't copy show up with colon characters, but other files that when displayed on my phone have colons in them, are displayed with underscores instead.
I vaguely remember that in the past I needed to fix some song titles in the player software on my phone, so maybe I'll just rename the files (s/:/_/) and check that the song titles are correct on the phone, which they probably are considering that's just ID3 tags.
That's a possible workaround. Still don't understand how the colon'd files came off the old sd card. |
|
Back to top |
|
|
sabayonino Veteran
Joined: 03 Jan 2012 Posts: 1019
|
Posted: Tue Aug 29, 2023 10:25 am Post subject: |
|
|
Hi .
I think file names contain some special characters and cp command doesn't recognized or the file name is splitted and comma/spaces etc are the issues
Try rsync to copy files over (Ex)FAT32 filesystem
Code: |
$ rsync --progress --modify-window=1 --update --recursive --times source/ destination/
|
I think /run/media/user/0123-4567/music is your destination target _________________ LRS i586 on G.Drive
LRS x86-64 EFI on MEGA |
|
Back to top |
|
|
sublogic Apprentice
Joined: 21 Mar 2022 Posts: 224 Location: Pennsylvania, USA
|
Posted: Tue Aug 29, 2023 9:13 pm Post subject: |
|
|
Princess Nell wrote: | As I have only one card slot, I'm copying the old card contents to my home dir (ext4) temporarily. Here, the files that don't copy show up with colon characters, but other files that when displayed on my phone have colons in them, are displayed with underscores instead. | I wonder if the problematic files have non-printing characters in their name. Can you pipe the output of ls into od -c ? |
|
Back to top |
|
|
|