Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I create /mnt/foo directory as a normal use and then sudo mount -t ext3 /dev/sda5 /mnt/foo. Owner of the directory is changed to root.root. How can I instruct mount to leave ownership unchanged?

ps. It is "Amazon Linux"

share|improve this question
    
Would unix.stackexchange.com/questions/14671/… work for you? It's an extra layer of redirection, but if you set it all up in your fstab it'll happen automagically for you. –  drewbenn Apr 4 '12 at 0:59
    
Good idea, but: -bash: bindfs: command not found :( –  yegor256 Apr 4 '12 at 1:06
    
'mount -obind source/ dest/'? PS my line in fstab looks like "/srv/sda6/logs /home/user/logs bind defaults,bind 0 0" –  drewbenn Apr 4 '12 at 1:10
add comment

1 Answer 1

up vote 5 down vote accepted

after you execute mount, the permission you see is the mounted directory, not the mounting point (directory) that you created. if you umount /mnt/foo successfully, you will see that the mounting point itself has not changed. therefore, if you want to preserve the same ownership after mounting the partition, you need to do a sudo chown desireduser /mnt/foo.

share|improve this answer
    
I think that mount should support some options for this operation. At least on Mac OS it has noowners option. –  yegor256 Apr 3 '12 at 22:02
1  
yeah, mount options are filesystem-dependent, and the common fs in linux like ext3 does not seem to have such an option. –  johnshen64 Apr 3 '12 at 22:06
    
such a pity.. anyway, let's keep this question open, maybe somebody will find a better solution than chown. if not, I'll select your answer as correct. thanks! –  yegor256 Apr 3 '12 at 22:09
    
You'll have to look into it, but maybe see if there are any options to ignore permissions with the fuseext2? –  Zoredache Apr 3 '12 at 22:48
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.