LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to mount filesystem with correct user locally for a mountpoint (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-mount-filesystem-with-correct-user-locally-for-a-mountpoint-4175503924/)

maddyfreaks 05-04-2014 03:20 PM

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


maddyfreaks 05-04-2014 03:55 PM

can some one please help .

cin_ 05-04-2014 04:37 PM

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

maddyfreaks 05-04-2014 04:39 PM

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)

Appreciate if you can give me some tips

cin_ 05-04-2014 04:46 PM

/etc/profile
 
you could try..?

/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

frankbell 05-04-2014 08:05 PM

maddyfreaks, this is a volunteer forum and today is a weekend day for many persons.

Please relax and give persons a reasonable amount of time to see your post, decide that they can help, and frame a reply.

kathirvel 05-05-2014 01:54 PM

chown -R wdadmin:wdgrp /opt/admin/install ---> Please set ownership and group for that mounted directory and try rebooting.

I am really sorry If I am not given the correct answer,please let me know if I am wrong.

Thanks,
Kathirvel.S


All times are GMT -5. The time now is 11:43 PM.