You are not logged in.

#1 2008-06-28 18:25:17

eltr
Member
Registered: 2008-06-28
Posts: 6

How to correctly mount a partition to user's dir?

Hello.

I have some problem of mounting sad

I want to mount a disk partition (ext3) to /home/some_user/tmp when system starting. I tried to use /etc/fstab, but after mounting dir /home/some_user/tmp have root as owner, so user some_user can't create subdirs and files into ~/tmp. I used such entry in fstab:

/dev/disk/by-label/tmp /home/some_user/tmp ext3 defaults 0 1

Is there any way to specify the owner of mountpoint (~/tmp in my case) in fstab?

Thanks!

Offline

#2 2008-06-28 18:32:36

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: How to correctly mount a partition to user's dir?

try

/dev/disk/by-label/tmp /home/some_user/tmp ext3 user,auto 0 0

Offline

#3 2008-06-28 18:40:40

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How to correctly mount a partition to user's dir?

Misfit138 is you put user in there then the user can mount and umount that. if you want make file owner then you need to put uid=some_user,gid=users or you can let your fstab alone and change permision from root.
chown -R some_user /mnt/user/tmp

Last edited by wonder (2008-06-28 18:45:41)


Give what you have. To someone, it may be better than you dare to think.

Offline

#4 2008-06-28 18:56:22

eltr
Member
Registered: 2008-06-28
Posts: 6

Re: How to correctly mount a partition to user's dir?

Misfit138 wrote:

try

/dev/disk/by-label/tmp /home/some_user/tmp ext3 user,auto 0 0

There is the same problem with this code: tmp has root as owner.

wonder wrote:

if you want make file owner then you need to put uid=some_user,gid=users

Are these options correct for ext3? These are present for some filesystem (such as adfs, affs, devpts, fat...) but not for ext3/ext2 (according to man mount) and not seem to be common for all filesystems.

or you can let your fstab alone and change permision from root.

This works! Thanks!

Offline

#5 2008-06-28 18:58:32

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How to correctly mount a partition to user's dir?

eltr you are right. stupid me smile uid,gid are for other filesystem


Give what you have. To someone, it may be better than you dare to think.

Offline

#6 2008-06-28 19:56:30

eltr
Member
Registered: 2008-06-28
Posts: 6

Re: How to correctly mount a partition to user's dir?

wonder, many thanks for your help smile

Offline

Board footer

Powered by FluxBB