LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training 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-20-2016, 01:44 PM   #1
ReemZ
LQ Newbie
 
Registered: Jun 2009
Location: .nl
Distribution: Chakra
Posts: 3

Rep: Reputation: 0
How to set up new disk in fstab as owned by particular user


Hi all, I've just installed a second HDD and now have the following setup:
sda: SSD holding /
sdb: 1TB HDD holding swap, /var and /home
sdc: 2TB HDD (the new one), which will hold /personal and /entertainment

The point of this is to have /home hold only configurations and such, and links to /personal and /entertainment.
/personal should be owned by me and only accessible by me, /entertainment should be owned by me, and read-only to members of a group.
This way, the account I made for a friend, or a possible guest account, could listen to music or watch a film, but not remove anything.

If that disk (and only that one) could be encrypted (another thing I have absolutely no experience with), that would be even better.

I did enter a few things in /etc/fstab but I'm having trouble understanding the options section.
Currently it looks like this:
Code:
$ cat /etc/fstab
UUID=f5d7cd94-bc25-48b5-b045-b5fd6dd87964       /       ext4    defaults,noatime,discard        0       1
UUID=8874720a-6d60-4a89-869b-689843458993       swap    swap    defaults,noatime        0       0
UUID=3c9965fd-ff4d-4271-899e-7ac7212e9c18       /var    ext4    defaults,noatime        0       2
UUID=52a8edcb-b5f4-4f07-85ad-aa73bc0ebb40       /home   ext4    defaults,noatime        0       2
UUID=2ee5658e-98bb-4fa9-83b2-0c39d7838ef9       /personal       ext4    defaults,noatime        0       2
UUID=6c958a53-2240-47bf-bbd1-45fa6f1cd54a       /entertainment  ext4    defaults,noatime        0       2
tmpfs   /tmp    tmpfs   defaults,noatime,mode=1777      0       0
I did read somewhere that using uid= and gid= options doesn't work well with ext4, and indeed I was dropped into emergency mode after entering those.
I'm not sure if I need to remove defaults if I want to use uid= and/or gid=, or if I'm better off using a different filesystem.
However, I don't know all too much about filesystems either.

Obviously I did search and I did RTFM, but it's a little beyond my level of expertise or understanding, I'm having serious trouble telling options apart.

Also, there seems to be constant harddisk activity since I added that drive, no idea if that's related but I might as well mention it.

Is what I'm after even possible, or am I just missing a step?
 
Old 05-21-2016, 01:49 PM   #2
camorri
LQ Guru
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2
Posts: 5,090

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
Quote:
I did read somewhere that using uid= and gid= options doesn't work well with ext4
I don't know why someone would state this, I have used UUID's for some time without problems. This avoids the system assigning different drive names; ie sdc instead of sdb at tboot time. This can happen due to various system conditions. I have not used guid= in fstab, so no comment there.

As far as controlling access to the directories 'personal' and 'entertainment' you can control that by chmod (ing) the permissions on the two directories. See man chmod for a description. I'm sure there are help how to's if you google it.
 
Old 05-21-2016, 04:04 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Ummm, uid= is not UUID, gid= is not guid.

No, you can't use uid=, gid=, etc. with ext4. Those are overrides for filesystems that do not support Unix-style ownership and permissions.

If you want to change the ownership and/or permissions on the filesystem roots, then with the filesystems mounted run the chown and/or chmod commands on the /personal and /entertainment directories.
 
Old 05-21-2016, 04:21 PM   #4
ReemZ
LQ Newbie
 
Registered: Jun 2009
Location: .nl
Distribution: Chakra
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rknichols View Post
Ummm, uid= is not UUID, gid= is not guid.

No, you can't use uid=, gid=, etc. with ext4. Those are overrides for filesystems that do not support Unix-style ownership and permissions.

If you want to change the ownership and/or permissions on the filesystem roots, then with the filesystems mounted run the chown and/or chmod commands on the /personal and /entertainment directories.
Yeah, kinda forgot to chown those two folders to myself :$
Is that all that's needed though? I've not forgotten anything else?
And what, if and when I install a second distro, after adding the appropriate lines to fstab, is a chown all that's needed and will that not mess with the first distro?

Is encryption going to make it a problem to read the disk from another distro?

Last edited by ReemZ; 05-21-2016 at 04:31 PM.
 
Old 05-21-2016, 04:29 PM   #5
camorri
LQ Guru
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2
Posts: 5,090

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
Quote:
I've not forgotten anything else?
Don't think so. Only other user would be root that could get access. So as long as you control the root password, no one else would get access. Any one with physical access to the system could, boot it with a live CD and do what ever, is the only other thing to think about. If that was a concern, you could encrypt any area to make it much more difficult for them to access it.
 
Old 05-21-2016, 04:48 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
The only issue with another distro would be if the numeric UIDs and GIDs are not the same. It's the numeric IDs that are stored in the filesystem. Those need to map to the same user and group names in all OSs that want to share the filesystem.
 
  


Reply

Tags
fstab, group, user


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
Configure sudoers in CentOS 5.10 for a user to run a script owned by another user as that user ripelivejam Linux - Newbie 2 12-22-2015 03:02 PM
fstab - how to set rwx perimission to all user? lonecrow Linux - Newbie 6 08-19-2007 05:39 PM
Basic fstab question -- cant' set groups or use as user. jcubed Linux - Newbie 6 12-22-2005 06:47 PM
Make a file owned by root owned by a user sharpie Linux - Newbie 2 02-26-2004 02:26 AM
how do i set a user disk quota axis Linux - Security 5 09-01-2003 11:33 PM


All times are GMT -5. The time now is 08:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration