Separate /data partition for several users

New to SolydXK? This is the place to start.
Please check the other subforums to see if there's a more suitable place for your question.
carnetjoven
Posts: 2
Joined: 13 Aug 2017 08:06

Separate /data partition for several users

Postby carnetjoven » 13 Aug 2017 09:15

In the forum I found the advice to create a separate partition to store my data. Seems like a good idea to me, but since I'm working with the trial and error method and don't really understand what's going on "behind the scenes", it would be good to know whether I'm on the right path.
What I did so far:
During the fresh install of SoldydX I created /data with the mountpoint /home/data.
This seems to work:

Code: Select all

# <file system>   <mount point>   <type>   <options>   <dump>   <pass>
UUID=dd9c0959-c05a-4f1c-915d-1a25803ede20   /   ext4   rw,errors=remount-ro   0   1
UUID=8d33ee26-fdec-4c2c-a55b-7f7974b8c5f9   /home   ext4   rw,errors=remount-ro   0   2
UUID=755c0aad-5083-47aa-ac64-a78b4bd32d89   /home/data   ext4   rw,errors=remount-ro   0   2

My next steps would be:
1. For every user create a folder in /data (for example /home/data/user1)
2. Create folders for every user (/home/data/user1/documents; /home/data/user1/pictures; .......)
3. Delete the empty folders (documents, pictures, etc.....) in /home/user1
4. Create symbolic links from /home/data/user1 to /home/user1

Code: Select all

ln -s /home/data/user1/documents /home/user1


This seems rather awkward to me since it has to be done for every single user and every single folder.
My question is: Shall I go ahead, or is there a easier, faster, more elegant way of accomplishing this?

Thanks in advance for any help!

cj

kurotsugi
Posts: 1952
Joined: 09 Jan 2014 00:17

Re: Separate /data partition for several users

Postby kurotsugi » 14 Aug 2017 01:00

I think it would be easier for us if you specify what do want to achieve. regarding separate /data partition, what we usually want is a separate /data partition which could be accessible for several user (i.e: a shared partition). in this case manipulating /etc/fstab is enough. something like this :

Code: Select all

# <file system>   <mount point>   <type>   <options>   <dump>   <pass>
UUID=dd9c0959-c05a-4f1c-915d-1a25803ede20   /   ext4   rw,errors=remount-ro   0   1
UUID=8d33ee26-fdec-4c2c-a55b-7f7974b8c5f9   /home   ext4   rw,errors=remount-ro   0   2
UUID=755c0aad-5083-47aa-ac64-a78b4bd32d89   /home/data   ext4   rw,errors=remount-ro   0   2

in this way every user could acces the shared files on /home/data. technically you can mount it everywhere in your system but using /home/data is lot efficient. if you're worried about security stuff, you can restrict permission on /home so that common user can't see other user data. though, you'll need to create a simlink under /home/<user> so that they could access the shared data. the disadvantage is that you'll need to create the link for every user

User avatar
ilu
Posts: 1665
Joined: 09 Oct 2013 12:45

Re: Separate /data partition for several users

Postby ilu » 14 Aug 2017 12:54

Most people here have either a single-user account or a family setup, where all users would use the same data (no secrets on the data partition). On a single-user system a data partition would get mounted into /home/onlyuser/data, no further precautions needed. On a familiy setup a data partition would get mounted into /home/familymember1/data with symlinks from /home/familymember2/data, /home/familymember3/data and so on. In that case you'd need to use either umask on the data partition or format it with ntfs which is the easy way around all kinds of permission issues.

I'm not sure how permissions are handled for the mountpoint /home/data. Kurotsugi seems to be confident that all users would be able to access that mountpoint without problems. Can you confirm that?

For a real multi-user system, where everybody only has access to his/her own data, you would not choose this kind of setup. It's still possible to put user-specific data on another partition but thats more a server configuration you shouldn't contemplate if you are just starting out.


Return to “Newbie Questions”

Who is online

Users browsing this forum: No registered users and 1 guest