Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here is what is observed:

sharad@nt535:~$ ls -l /mnt
total 12
drwxr-xr-x 2 sharad sharad 4096 2012-01-17 17:14 MyPicsAndVids
drwxr-xr-x 2 sharad sharad 4096 2012-01-17 17:14 SharadHomeDir

sharad@nt535:~$ sudo mount /dev/dataVG/SharadHomeDir /mnt/SharadHomeDir
sharad@nt535:~$ sudo mount /dev/dataVG/MyPicsAndVids /mnt/MyPicsAndVids

sharad@nt535:~$ ls -l /mnt
total 12
drwxrwx--- 4 root root 4096 2012-01-16 22:37 MyPicsAndVids
drwxrwx--- 4 root root 4096 2012-01-17 17:21 SharadHomeDir

I want to mount these as normal user. Thus, after mounting, I want the following owner /group:

sharad@nt535:~$ ls -l /mnt
total 12
drwxr-xr-x 2 sharad sharad 4096 2012-01-17 17:14 MyPicsAndVids
drwxr-xr-x 2 sharad sharad 4096 2012-01-17 17:14 SharadHomeDir

I actually want to do this via fstab. I've tried various mount options, such as user and providing uid and gid options, but none seem to work.

Now, I've searched and found this solution: How do I manually mount a linux file system read/write as a normal user? But, I want it automatically mounted at bootup using fstab only, without going through a secondary step such as bindfs. I was wondering if I could change the owner of the LVM volume perhaps?

According to the link above: On an ext4 filesystem (like ext2, ext3, and most other unix-originating filesystems), the effective file permissions don't depend on who mounted the filesystem or on mount options, only on the metadata stored within the filesystem.

Can I change some information in this metadata such that it mounts as normal user and not root user?

share|improve this question
    
It doesn't matter where the filesystem is stored, if it's on a regular partition or on a logical volume (LV). By the way, what filesystem are you using? –  Cristian Ciupitu Jun 2 '12 at 12:03

1 Answer 1

Determine where your logical volume is at /dev (eg. /dev/dm-1) and chown that device. This appears to have solved the issue for me. Gnome Disk Utility is an easy way to determine the right dev.

I mounted the volume directly under user home, this is the entry in fstab:

/dev/mapper/volgroup-logvol /home/user/Shared ext4 users,errors=remount-ro 0 0

You could add options rw,auto just in case. After reboot, I did the above mentioned chown user:user /dev/dm-1 and for me it's still working.

I don't know if there's any drawbacks in this solution, but I'd be glad to know if there are.

share|improve this answer

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.