removeable device permissions for Linux/Unix filesystems (ext4, f2fs, btrfs, ...)
For removable storage (like USB flash drives) people still tend to use FAT or exFAT. Although especially for removable devices a journaled filesystem would be the more reliably. One main problem is, that Unix/Linux filesystems usually enforce permissions which come in unhandy for removable storage. And people usually don not work in root mode and on work / university computers not even having that possibility.
I propose to add a checkbox in the "Create new Partition" dialog for setting ACL rules to disable filesystem permissions after formatting Linux/Unix filesystems like ext4, f2fs or btrfs. So these filesystems can be easily used for removable storage.
Details
On removable storage people should not be hindered by filesystem permissions. People can easily attach the storage to a computer where they have root permissions, so there nearly no security advantages in filesystem permissions for removeable storage (except in controlled security environments where you can not leave/enter the building with arbitrary digital devices). But in practice permissions on removable storage are handled the same way as for internal storage. And that often gets you a "can't create file" error when storing stuff on removable storage formatted with ext4 for example (especially if you don't have the same numeric user ID on all your computers).
So filesystem permissions seem to be a main reason not to use Linux/Unix filesystems on removable storage (at least outside of hybrid OS environments). Here is how ACLs can be used to solve that problem:
(assume the filesystem is mounted on /mnt
)
# -R to make an already created "lost+found" directory accessible.
chmod -R 777 /mnt/
setfacl -R -m d:u::rwx,d:g::rwx,d:o::rwx /mnt/
For this to work the filesystem must be mounted with the option acl
. On most modern systems this seems to work by default. But in some scenarios it might be needed to manually set acl
as preferred mount option in the filesystem metadata (if the filesystem offers this).
ext4: tune2fs -o acl /dev/sdX1
(alternatively use mkfs.ext4 -O acl
directly)
See also:
- https://unix.stackexchange.com/questions/422656/how-to-make-an-ext4-formatted-usb-drive-with-full-rw-permissions-for-any-linux-m/422687#422687
- https://opensource.com/article/20/3/external-drives-linux
Another alternative is NTFS. But on the most Linux distros the suboptimal NTFS-3G implementation is still the default and the new NTFS3 implementation still seems not to have settled down.
https://www.phoronix.com/news/NTFS3-Linux-6.0-Updates
https://wiki.archlinux.org/title/NTFS
*I am not sure if f2fs has a journal or something similar. But it is definitely a healthy option for USB flash drives.