Ubuntu – Root Owns Home Directory, chown does not work

chownhome-directorymountownershippermissions

I am running Ubuntu 12.04 and having various problems. I have traced it back to the fact that my user's home directory (/home/user) is owned by root.

The /home directory is actually mounted on another drive, but I can see that in fstab I am mounting only /home and not /home/user:

UUID=DC56D19E56DX3233 /home ntfs user,exec 0 2

The chown command below does not seem to work:

sudo chown -R user /home/user

This will run without errors, however it does not actually change ownership of the direcory. Here is the output of ls -ld after running the command:

drwxrwxrwx 1 root root 20480 Sep 25 00:07 /home/user

This is the same as it was previously.

Best Answer

NTFS doesn't support Unix-style 'owners', so the Linux kernel is forced to assign an owner for the entire volume - normally, root. As an alternative to moving your entire home directory to EXT4, you could also give ownership of the entire partition to a specific user or group using the 'uid' or 'gid' options for mount (or in fstab). There are security implications in a multi-user environment, but I used this method on my dual-boot laptop.

A long way inside the man page for mount (man mount), we find this under filesystem-specific options for NTFS:
uid=value, gid=value and umask=value
Set the file permission on the filesystem. The umask value is given in octal. By default, the files are owned by root and not readable by somebody else.

Your line in fstab would then be changed to UUID=DC56D19E56DX3233 /home ntfs user,exec,uid=username,gid=group 0 2, and you'd be free to edit the umask if you wanted.

Related Question