Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
/etc/fstab
UUID=<someuuid> /mnt/data ext4 defaults,relatime,data=ordered   0 2

and

/mnt$ ll
drwxr-xr-x 2 manuel users 4096 15. Apr 18:25 data
/mnt$ mount -a
/mnt$ ll
drwxr-xr-x 4 root root 4096 14. Apr 22:54 data
/mnt$ 

I dont get it. What is the problem with this? I want to have write permissions in /mnt/data. In subfolders I can write. It is just in this rootfolder. Why does the owner of the folder change?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

It seems that (whyever) in the first situation the volume is not mounted. You see the mount point i.e. the folder in the underlying file system. IMHO normal mount point folders should always belong to root:root and have 000 access rights as it does not make any sense to use them in a typical situation.

Mounting the volume replaces the mount point folder by the root directory of the mounted file system. Obviously this can have different access rights and owner. You need to change ownership of the folder after the volume has been mounted. This information is written to the mounted file system. Each time you mount it, these new values will appear at the mount point.

And my advice is to change the metadata of the mount point folder (when not mounted), too.

share|improve this answer
1  
"You need to change ownership of the folder after the volume has been mounted." Thats the deal nobody mentions... –  ManuelSchneid3r Apr 15 '13 at 17:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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