My goal is to have a USB drive in ext4 and to use it as a normal Fat32/NTFS pendrive (or usb box drive). I would be happy to forget NTFS and Fat32 and to use this USB Drive with all pc in my local net. By the use of CHMOD and CHOWN I would create a REALLY everyone drive in ext4. Every mountpoint should be for everyone. Tons of command line rows are written but no tutorial and simple procedures to make it possible. Thanks.
2 Answers
If you want an owner/group-agnostic file system for your drive, ext3
/ext4
is not the right one for you.
Only filesystems which do not support Linux permissions like fat have an attribute for ownership/groupship: uid=value and gid=value. See the manual page on mount. (via)
As a workaround you could use a bind mount if you have sudo
, but that is probably not what you want:
sudo bindfs -u $(id -u) -g $(id -g) /media/diskFoo ~/myUIDdiskFoo
(via)
I don't know of any suitable unix/linux/opensource permission-agnostic file system. Unfortunately, you should probably use exFat
(NTFS
is a journalling fs and thus not suitable for flash storage).
Update: I just read about F2FS - "Flash Friendly File System", but I don't have any experience with it and it seems to have a normal unix permission model.

- 26,947
-
LINUX only linux, I want to forget windows in my mind. I use linux in all my infrastructure. The Askubuntu is full of expanded command lines, this is a simple question that demonstrates how the linux world is made too mutch complicated. The answer you offered is near the truth! – Gian Luca Brizi Aug 14 '19 at 13:06
A solution that gives default permissions to all, also for newly created files, is with a default access control list.
It is described for full in this unix.stackexchange answer -- the short parts:
mkfs.ext4 /dev/<device> tune2fs -o acl /dev/<device> mount /dev/<device> /mnt/<mountpoint> chown <username>:<groupname> /mnt/<mountpoint> # Optional; try to use the name of the user who is most commonly using this filesystem chmod 777 /mnt/<mountpoint> setfacl -m d:u::rwx,d:g::rwx,d:o::rwx /mnt/<mountpoint> umount /mnt/<mountpoint>
Problems might occur if you copy files with their set attributes; permissions might be preserved and other users might not edit or overwrite the files (but usually still read). But since the upper level directories are world-writeable, any user can rename or delete the files (and thus (via copying) also create new files owned by oneself and set permissions to 777
). See the above mentioned stackexchange answer.

- 163
ext4
on your pendrive. The only problem is that only linux systems will be able to see it. But it really makes no sense to use a fs with a journal on a pen drive. You can have e.g.ext2
. – Pilot6 Aug 13 '19 at 09:18ext4
, it won't have restrictions on it. You can always mount it on any other system. – Pilot6 Aug 13 '19 at 09:34chown
andchmod
at the file-system's level / the mountpoint, or at the directory level or the file level (specific for individual files if you wish). Do you need help with those commands? I suggest that you use them withsudo
until you have the desired ownership and permissions to get the access that you want to directories and files. – sudodus Aug 13 '19 at 11:59sudo chmod -R ugo+rwx /path/to/mountpoint
– sudodus Aug 13 '19 at 12:12