Wish you a good day!

I want to mount a folder with type ntfs or ext2 or ext4 in order to set permissions for files in that.

This is how I did:

tudinh@Acoustic:~$ sudo mount --bind -v -t ext2 -o umask=0022,gid=1004,uid=1001 /media/tudinh/Data/Downloads/oracledb /oracledb

And this is the results, type set to none instead of ext4:

/media/tudinh/Data/Downloads/oracledb on /oracledb type none (rw,bind,umask=0022,gid=1004,uid=1001)

Given that:

  • I set -o umask=0022,gid=1004,uid=1001 because I want to grant all permission to user 1001 and group 1004. Pls tell me if this is not correct.
  • /media/tudinh/Data/Downloads/oracledb is a folder in NTFS partition. (yes, I install Ubuntu along with Windows)
  • /oracledb is the mount point I created in / ext4 partition

My final purpose is to grant full permissions to user 1001 and group 1004 to all files within /media/tudinh/Data/Downloads/oracledb

  • You can't mount an NTFS partition as ext2. – Pilot6 Jun 23 '15 at 16:11

A bind mount always has type none. If you don't want type none, don't use bind mounts. Using a bind mount doesn't change permissions or ownerships.

  • No doubt I can't do that, thanks so much for your answer. But if I mount without --bind, I will receive error Failed to mount /media/tudinh/Data/Downloads/oracledb': Is a directory. So what should I do to mount the folder, and grant all permissions? – Bim Bim Jun 23 '15 at 16:19
  • @BimBim, you mount a device, not a folder. The bind mount is really a sophisticated case of a symlink... the permissions, ownerships etc capabilities are the ones of the underlying filesystem, you can't change them. If you want to apply the uid,gid or similar things, you have to apply that to the whole NTFS device when you first mount it. – Rmano Jun 23 '15 at 17:31

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.