So I just bought a new Samsung T7 Portable SSD. I initially intended to format it to exFAT, for use with both Windows, MacOS and Linux, but upon inspection, the disk comes with a default file system of HPFS/NTFS/exFAT. I didn't know that was a thing, but I decided to test it out.
To test it out, I simply copied a few ASCII text files to the disk, but regardless of method for copying, and file extension, they all get the executable flag set. I don't understand why. Why is it like this, and how can I avoid it? I want the files copied exactly as they are.
Complete output showing changed permissions.
user@ubuntu:~$ echo "test text file" > test.txt
user@ubuntu:~$ echo "test test test" > test
user@ubuntu:~$ echo "print('test')" > test.py
user@ubuntu:~$
user@ubuntu:~$ ls -l test*
-rw-rw-r-- 1 user user 15 July 18 01:20 test
-rw-rw-r-- 1 user user 14 July 18 01:20 test.py
-rw-rw-r-- 1 user user 15 July 18 01:20 test.txt
user@ubuntu:~$
user@ubuntu:~$ mkdir /media/user/T7/testdir
user@ubuntu:~$ cp test /media/user/T7/testdir/
user@ubuntu:~$ rsync test.txt /media/user/T7/testdir/
user@ubuntu:~$ rsync -a test.py /media/user/T7/testdir/
user@ubuntu:~$
user@ubuntu:~$ ls -l /media/user/T7/testdir
total 384
-rwxr-xr-x 1 user user 15 July 18 01:23 test
-rwxr-xr-x 1 user user 14 July 18 01:20 test.py
-rwxr-xr-x 1 user user 15 July 18 01:23 test.txt
Here you can see I've tried both cp, rsync and rsync -a, but they end up as executables every single time. Why?
Edit:
I tried doing exactly the same to a WD HDD that comes with NTFS by default. There, the files get the 777 permission (rwxrwxrwx).
Does it have something to do with the disk itself? Clearly my knowledge is lacking here.