How to mount filesystem with correct user locally for a mountpoint
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to mount filesystem with correct user locally for a mountpoint
Code:
Hi Folks,
I created a Virtual Machine and created few mount points
/opt/admin/install
Everything is fine after VM creation (used oracle virtualbox) and now when it reboots it always comes as root:root for the mount point.
Below is from my fstab
/dev/mapper/vg_host1-lv_wd_admin /opt/admin/install ext4 defaults 1 2
$ ls -ld /opt/admin/install
drwxr-xr-x. 2 root root 4096 May 4 11:16 /opt/admin/install
Since i want that mountpoint to be owned by wdadmin:wdgrp i tried updating the fstab as below
but interestingly the mountpoint didnt showup after reboot.
/dev/mapper/vg_host1-lv_wd_admin /opt/admin/install ext4 defaults,rw,uid=wdadmin,gid=wdgrp,dmask=022,fmask=055 1 2
after reboot i cant see this mountpoint so can some one please give me the correct syntax to fstab to mount the mountpoint (local mount point) to wdamin:wdgroup
Since this is local mountpoint
Last edited by maddyfreaks; 05-04-2014 at 03:21 PM.
Reason: corrected typo
unsure of the details pertaining to fstab, its proper flags, or how it interacts with virtual machines, but a hackaound may be to just write a one liner with mount and place it in a startup script to be run with each reboot
Code:
sudo mount -o rw,gid=wdgrp,uid=wdadmin,dmask=022,fmask=055 /dev/mapper/vg_host1-lv_wd_admin /opt/admin/install
Last edited by cin_; 05-04-2014 at 04:41 PM.
Reason: gramm`err
even i got the idea to add small script but not sure in which script i need to add this details (or) how to make my script run after the reboot (this should happen before my application starts)
/etc/profile
The systemwide initialization file, executed for login shells
it really depends on how your system is set up,
search for some literature on initialization files pertaining to your setup, eg. distro, desktop environment, shell et al
Last edited by cin_; 05-04-2014 at 04:46 PM.
Reason: gramm`err
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.