I'm currently mounting an NTFS partition at startup using the following line in /etc/fstab:
/dev/sda3 /media/data ntfs nls=iso8859-1,umask=000
To my Ubuntu 11.10 installation, it looks as if all files and folders are owned by root
- and since NTFS doesn't really support the same rights management system anyway, there's no way I can change it after the mount is complete. No matter what I do, ls -l
anywhere on the NTFS partition will list every file and folder as owned by root:root
.
However, this causes some problems for me. Most notably, some applicaitons running under my account (called tomas
) complain about access rights. Also, whenever I try to copy (cp
) or move (mv
) files from one of my ext3 partitions to the NTFS partition, I get error messages saying
mv: preserving times for `[path to new file]`: Operation not permitted
or, similarly
mv: preserving permissions for ...
Would mounting the partition in my name instead of root help? If so, how do I accomplish that in fstab?
Update:
I have now changed the options according to the suggestions, and arrived at this:
nls=iso8859-1,permissions,users,umask=000,uid=tomas,gid=tomas
ls -l
now shows all files owned by me instead of by root, and it seems some of the problems I had before are solved. However, not all of them.
When I start Eclipse, I get an error that a file related to the android-sdk cannot be run: Permission denied. ls -l
tells me the following about the file:
-rwxrwxrwx 1 tomas tomas 159620 2011-11-29 14:50 adb*
This looks the way I want it to. But if I try to run it (./adb
in a terminal) I also get permission denied errors. But if I run it with sudo
, it works (I believe - at least it doesn't give me an error message, but it doesn't give me any output at all, which I think it shouldn't...)
Why is the above file, with execute permissions for anyone, still not executable by anyone else than root
? How do I change the way I mount the file system so it is?
Update 2:
OK, I've now come a little bit further. By mounting with these options
nls=iso8859-1,permissions,users,auto
I got all the permissions set the way I expect them to, and chown
and chmod
actually change settings on the files (at least according to ls -l
) =D
BUT my system still behaves in a weird way. The permissions for the adb
script file come up as above, but neither I nor Eclipse can run it without "Permission denied" errors. But as far as I can see the file has all the required flags set (o=rwx
should be enough, right?). Why doesn't it work?
Update 3
OK, I got everything working on the Ubuntu side, with the following options:
nls=iso8859-1,permissions,users,auto,exec
However, when I try to access files on the partition from Windows, the security settings are all messed up. On all the files (of those few I've examined) a new account called Account Unknown(long GUID)
has been added to the list of users, and has full rights. Rigths for most other users are decreased so that I don't have rights to do stuff I expect. Notably "Everyone" does no longer seem to have right to "Traverse folder / execute".
This might be solvable by just selecting the partition and allow Everyone to do anything on the root folder, and then tell it to do it recursively, but I'd rather not as I'm afraid it will take days to complete...
In the options column add
permissions
andauto
(and probablyuser
orusers
)permissions
: (NTFS-3G option) Set standard permissions on created files and use standard access control.auto
: Will be mounted at boot and frommount -a
user
: Allow an ordinary user to mount the filesystemusers
: Allow every user to mount and unmount the filesystemThen change ownership of the filesystem:
My line in
/etc/fstab
Mount and list permissions
Change ownership and list new permissions
By default, ntfs-3g mounts the partition noexec, nosuid, and nodev.
noexec
: Do not allow direct execution of any binaries on the mounted filesystem.nosuid
: Do not allow set-user-identifier or set-group-identifier bits to take effect.nodev
: Do not interpret character or block special devices on the file system.To override this and allow executing files, use
exec
Now we get
Use the
uid
andgid
options (or use the user mapping feature) of mount.ntfs (8)Mine works now perfectly when i change the fstab's line to
What about using
udisks
? It can easily mount NTFS partitions with your user as owner.Example (type it into command line):
You can also add that command to startup applications and it will auto-mount when you log-in.
Reference: AutomaticallyMountPartitions