this post was submitted on 24 Aug 2025
46 points (96.0% liked)

Linux

57668 readers
761 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

File permissions change when transfering between external drives and laptop

I noticed a few years ago that when I transfer files back and forth between my laptop and my external drive all the files that I have transfered have changed permissions.

I format all my external drives as exFAT so I can use larger files.

Why does this happen?

Is there a better way to keep the file permissions intact when transfering files back and forth between external drives?

The test file: Fantastic Fungi (2019).mkv

+++++++++++++++++++++++++++++++++++++++++++++++++++

This is what the file permssions looks like before I transfer it to my external hard drive

ls -l

-rw-r--r-- 1 user user 577761580 May 2 2024 'Fantastic Fungi (2019).mkv'

+++++++++++++++++++++++++++++++++++++++++++++++++++

This is what the file permssions looks like after I transfer it back to my laptop

ls -l

-rwxr-xr-x 1 user user 577761580 May 2 2024 'Fantastic Fungi (2019).mkv'

When I right click file permissions dialogue box. The "Allow this file to run as a program" is ticked.

+++++++++++++++++++++++++++++++++++++++++++++++++++

The way have overcome this is to run a simple one liner to reset the permissions for directories and files.

Open a terminal in the directory of the folders and files you want to change

All directories will be 775. All files will be 664

find . -type d -exec chmod 0755 {} ;

find . -type f -exec chmod 0644 {} ;

Directory permission 0755 is similar to “drwxr-xr-x”

File permission 0644 is equal to “-rw-r–-r–-“.

-type d = directories

-type f = files

+++++++++++++++++++++++++++++++++++++++++++++++++++

you are viewing a single comment's thread
view the rest of the comments
[–] savvywolf@pawb.social 53 points 3 days ago (5 children)

Exfat does not support permissions, so when it gets moved to the drive, that information is lost.

If permission information is important to you and compatibility with non-linux devices isn't, you can reformat the device as ext4 to support all linux features.

[–] infjarchninja@lemmy.ml 5 points 3 days ago (2 children)

Thank you SavvyWolf

This is particularly annoying when I have to upgrade my distro and all my files have to be moved to an external drive.

Unfortunately some of my files are up to 10Gb. thats why I stayed with exFAT.

I will certainly try Ext4 on my external drives.

[–] Eideen@lemmy.world 18 points 3 days ago (1 children)

Try compressing it in to a tar, this will save permissions.

you can also use backup tools like "Pika backup" (borg backup).

[–] infjarchninja@lemmy.ml 2 points 3 days ago

Thank you Eideen

I have never used any back up programs, Maybe I should consider it.

Both Borg and Pike-backup are in the offical repos (extra).

I shall check them out

[–] IanTwenty@lemmy.world 6 points 2 days ago (1 children)

10Gb is not a big file relatively speaking - both ext4 and btrfs (for example) can handle 16TiB and larger. If this was your only reason for choosing exFAT then you can definately migrate.

[–] infjarchninja@lemmy.ml 6 points 2 days ago

Hey IanTwenty

Thank you

ext4 seems the way to go for me

load more comments (2 replies)