LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-09-2015, 01:01 AM   #1
archuser
LQ Newbie
 
Registered: Feb 2015
Posts: 11

Rep: Reputation: Disabled
How is ownership of tmpfs folders created via /etc/fstab determined?


If one defines a tmpfs file system in a folder using fstab like so:
Code:
tmpfs      /mnt/ramdisk tmpfs     defaults,size=4096M 0    0
how are the owner and group decided by the OS?

Assume that /mnt and /mnt/ramdisk are owned by root.

Last edited by archuser; 03-09-2015 at 01:31 AM.
 
Old 03-09-2015, 03:40 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
With default permissions the unix permissions are 0755.

So the permissions of /mnt/ramdisk would change to 0755, no matter what original permissions of /mnt/ramdisk were.
 
1 members found this post helpful.
Old 03-09-2015, 05:05 AM   #3
archuser
LQ Newbie
 
Registered: Feb 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks for the pointer, I'll look into that tonight to get permissions sorted. Any idea why if I specify uid and gid in that fstab entry it is also ignored?
 
1 members found this post helpful.
Old 03-09-2015, 09:01 AM   #4
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Read man page of mount. It has a section on tmpfs.
 
Old 03-09-2015, 01:46 PM   #5
archuser
LQ Newbie
 
Registered: Feb 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
Ok, I've looked at the tmpfs documentation

Changed /etc/fstab to read:
Code:
tmpfs      /mnt/ramdisk tmpfs     size=4096M,mode=0777,uid=998,gid=998 0    0

Yet still the folder is owned by samba and its permissions are:
Quote:
drwxr-xr-x 6 samba samba 300 Mar 7 23:38 ramdisk

How is it that it does not change?
 
Old 03-10-2015, 01:22 AM   #6
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Try using the command line instead of fstab. May be some other script is changing after fstab.
Why is it samba because you are using that directory for samba server.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/fstab "tmpfs /tmp tmpfs defaults 0 0" ramfs?! HOW? xcislav Linux - General 2 06-04-2011 03:03 AM
Set group ownership on files as they are created gatsby Linux - Newbie 1 02-25-2008 03:31 PM
tmpfs? what are thease folders for? sirmonkey Debian 5 09-09-2007 05:14 AM
Is there a command that gives you ownership of a folder and all it's sub-folders royeo Linux - Newbie 3 06-01-2007 01:55 PM
Changing ownership of folders Nurfen Linux - Newbie 1 08-01-2004 12:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:36 PM.

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
Open Source Consulting | Domain Registration