LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-04-2014, 04:20 PM   #1
maddyfreaks
Member
 
Registered: May 2011
Posts: 70

Rep: Reputation: 0
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 04:21 PM. Reason: corrected typo
 
Old 05-04-2014, 04:55 PM   #2
maddyfreaks
Member
 
Registered: May 2011
Posts: 70

Original Poster
Rep: Reputation: 0
can some one please help .
 
Old 05-04-2014, 05:37 PM   #3
cin_
Member
 
Registered: Dec 2010
Posts: 277

Rep: Reputation: 24
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 05:41 PM. Reason: gramm`err
 
Old 05-04-2014, 05:39 PM   #4
maddyfreaks
Member
 
Registered: May 2011
Posts: 70

Original Poster
Rep: Reputation: 0
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
 
Old 05-04-2014, 05:46 PM   #5
cin_
Member
 
Registered: Dec 2010
Posts: 277

Rep: Reputation: 24
/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

Last edited by cin_; 05-04-2014 at 05:46 PM. Reason: gramm`err
 
Old 05-04-2014, 09:05 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,342
Blog Entries: 12

Rep: Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730
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.
 
Old 05-05-2014, 02:54 PM   #7
kathirvel
Member
 
Registered: Jan 2011
Location: Bangalore
Distribution: RHEL,OEL
Posts: 57

Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] User has no write access to mountpoint gonny95 Linux - Newbie 3 02-09-2014 12:25 AM
autofs with cifs filesystem creating mountpoint twice? kayasaman Linux - Server 2 03-25-2012 10:35 AM
How can I give 1 user access to mount 1 particular filesystem? wjtaylor Linux - Server 4 06-13-2011 11:34 PM
iPod Mountpoint Automatically Erased, Unable to Mount Again. EzNaChOs Linux - Hardware 1 02-03-2011 08:34 AM
mount linux as samba client, own mountpoint carlbrans Linux - Networking 1 10-15-2004 06:01 PM


All times are GMT -5. The time now is 08:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration