My system has two (major) partitions: my Ubuntu install (mounted at /, obviously), and my Windows install (mounted at /win32).

Furthermore, I've symlinked some folders from my Windows partition over to by Ubuntu partition (namely ~/Documents, ~/Music, ~/Videos, and the like). This way, I have my system set up so that some folders stay in sync with each other in a reliable manner.

However, I occasionally run into the problem where I can't alter permissions at all, because the files are owned by root and not me.

Ideally, I'd like to set up (somehow) my system in such a way that /win32/Users/Owner (and nothing else) has both my user and group set as the owner instead of root. I'd also like to keep root as the owner of everything else, such as to avoid accidental mistakes on my part.

Is this even possible? How could I do this?


Assuming you mount /win32 as CIFS from an fstab entry, then you can set the uid and gid (as well as other options related to user mapping and permissions - see man mount.cifs) in the mount options in /etc/fstab.

I have no Windows partitions to verify this, but am quite sure that you could mount them more than once. So you would mount the root of the Windows partition as read-only on /win32, and the user home directory read-write somewhere else. I'm not sure if that could be at /win32/Users/Owner, i.e. overlaying the mounted /win32 tree. It can for some filesystems, not for all.

If CIFS doesn't allow such a mount, then maybe a bind mount (see man mount) can do the trick. Otherwise of course you could mount it outside the /win32 tree, e.g. at ~user/win32 or something.

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.