Strange file behaviour

Using XFCE but working in Xterm. Mount shows (among other devices)…

 # mount

/dev/sdf1 on /mnt/OUTDRIVE type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

Working as root,

# ls -al /mnt
total 156
drwxr-xr-x  8 ion  users   4096 Jul 11 19:24 .
drwxr-xr-x 22 root root    4096 Jul  4 16:12 ..
drwxr-xr-x  2 ion  users   4096 Apr 23 17:10 cd
drwxr-xr-x  2 ion  users   4096 Apr 23 17:10 hd
drwxr-xr-x  2 ion  users   4096 Jul 11 19:23 INDRIVE
drwxrwxrwx  1 root root  131072 Jan  1  1970 OUTDRIVE
drwxr-xr-x  2 ion  users   4096 May 12 16:00 SERVER
drwxr-xr-x  2 ion  users   4096 Apr 23 17:10 usb
linux-i1f2:/home/ion #

But then as root…

# chown -R ion:users /mnt/OUTDRIVE
chown: changing ownership of '/mnt/OUTDRIVE': Operation not permitted
linux-i1f2:/home/ion # 

/dev/sdf1 is formatted as exFAT, but it’s the same if I format it as FAT-32. Meanwhile if as root I try to copy files that originated on a MacBook and were copied via a FAT-32 to my Linux box I get the following error…

cp -R DATA/APPLE/COMBINED/DENMARK/2017? /mnt/OUTDRIVE

cp: cannot create directory ‘/mnt/OUTDRIVE/2017?’: No such file or directory
linux-i1f2:/home/ion #

…while copying the same file to an ext4 drive works normally. Using the XFCE file manager (PCManFM-QT) produces similar results only worse. The file manager disappears from the monitor screen. What am I doing wrong?

Hi
Is the directory name really “2017?” If so it needs to be escaped with a leading \ as in 2017?.

Hi
Just another comment, on the MacBook, you could transfer the files via scp over the wire to the linux box, or why not just keep the mac format hpfs (it works on linux)? This will also ensure permissions/ownership remain the same…

You can not change ownership of files on a non-Linux file system. Simply because ownership (user and group), and btw also permission bits, aren’t on those file systems. What you see is only faked. And what the fakes are is given at mount by option parameters:

user_id=0,group_id=0

Nothing. Not every filesystem supports file ownership (and even if it does, it may have so different idea of owner that Linux driver simply has no way to map it to Linux users) as well as not every filesystem allows arbitrary characters in file names.

Many thanks to all of you. I have now learned a lot more about non-Linux file systems. But my problem still remains. I have transferred about 24,000 photos from a friend’s MacBook to my Linux box in order to remove duplicates and re-arrange how they are organized. The reason being I don’t know how to do that on the Mac, besides which I really dislike how it functions. Now the problem is to copy them back to the Mac. Many of those files names have illegal characters that won’t copy via FAT-32 which the Mac can read. It would be incredibly time consuming to individually search and rename them. Is there a utility that can alter the illegal characters. Removing the characters is not sufficient as some names would be duplicates. I believe transferring them via scp would require a wire connection which is missing on the MacBook. Am I correct?

Using HFS only allows me to read them into Linux. Thanks for any suggestions.

Hi
Over the wire means wireless or ethernet :wink:

So if you transfer them to your linux system via scp (ssh ftp) then make your modifications, then with sshd running on the MacBook transfer them back as the user all will be good in Mac-world… You will have no issues with the likes of illegal characters etc…

Many thanks, I will do it that way if another method I have uncovered does not work. It’s a utility called detox that converts all illegal characters in file names. I have tested it on a small scale with success and it solves the problem at the origin (bad file names).

It’s available at https://fedora.pkgs.org/30/fedora-x86_64/detox-1.3.0-7.fc30.x86_64.rpm.html and can be installed with YaST if the warning is ignored. Hopefully not malware.

Hi
For duplicate files there is the likes of fdupes and jdupes (Welcome - openSUSE Build Service) to sort those out…

Success. I had already used fdupes to a satisfactory reduction and detox worked without any hitches, and very quickly. All the data is now back in the MacBook and fully organized. Thanks for all the help. Now on to the next project.