Mounting ext4 drive with specified user permission
Use bindfs
:
A FUSE filesystem for mirroring the contents of a directory to another directory. Additionally, one can change the permissions of files in the mirrored directory.
Mount the ext4
filesystem as /media/disk
:
sudo mount -o user /dev/sdXN /media/disk
Bind the mounted filesystem with permissions for the current user (or any other user/group):
sudo bindfs -u $(id -u) -g $(id -g) /media/disk /home/user/new_disk
Only FAT, vFAT, exFAT support the uid
, gid
, umask
options. You can check this by reading the list of the possible options in the mount
man page, section "Mount options for fat".
However, you can change ownership of the existing directory system by using chown on the filesystem's mount point, like:
# mount /dev/sda* /mnt/your/mountpoint/
# chown user:group 741 /mnt/your/mountpoint/