Results 1 to 10 of 10

Thread: Strange file behaviour

  1. #1
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,288

    Default Strange file behaviour

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

    Code:
     # 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,

    Code:
    # 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...

    Code:
    # 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?

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,659
    Blog Entries
    15

    Default Re: Strange file behaviour

    Quote Originally Posted by ionmich View Post
    Using XFCE but working in Xterm. Mount shows (among other devices)...

    Code:
     # 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,

    Code:
    # 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...

    Code:
    # 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\?.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,659
    Blog Entries
    15

    Default Re: Strange file behaviour

    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....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,987

    Default Re: Strange file behaviour

    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:
    Code:
    user_id=0,group_id=0
    Henk van Velden

  5. #5
    Join Date
    Sep 2012
    Posts
    5,023

    Default Re: Strange file behaviour

    Quote Originally Posted by ionmich View Post
    What am I doing wrong?
    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.

  6. #6
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,288

    Default Re: Strange file behaviour

    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.

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,659
    Blog Entries
    15

    Default Re: Strange file behaviour

    Quote Originally Posted by ionmich View Post
    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

    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...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  8. #8
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,288

    Default Re: Strange file behaviour

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Over the wire means wireless or ethernet

    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-x8...86_64.rpm.html and can be installed with YaST if the warning is ignored. Hopefully not malware.

  9. #9
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,659
    Blog Entries
    15

    Default Re: Strange file behaviour

    Quote Originally Posted by ionmich View Post
    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-x8...86_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 (https://build.opensuse.org/package/s...TESTING/jdupes) to sort those out...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  10. #10
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,288

    Default Re: Strange file behaviour

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •