How do I set up permissions for a new hdd partition?  [Solved]

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
Charlie Brown

Re: How do I set up permissions for a new hdd partition?

#11 Post by Charlie Brown »

spring.snow wrote: Sun Jul 30, 2023 6:16 pm "Enable mounting of internal drives by non-root users." that might help with this, but I would like to avoid it if possible. I don't want it to automatically mount any external drive without any password input...
No it won't (neither the external nor the internal). Don't worry, apply it in "MX Tweak" - "Other" tab.

(In addition: that's not to "auto-mount".. just gives permission to user (from root) and enables the user to write on that partition)

MXRobo
Posts: 1838
Joined: Thu Nov 14, 2019 12:09 pm

Re: How do I set up permissions for a new hdd partition?

#12 Post by MXRobo »

RE:
One thing: not quite sure what I should be adding for the group name, I don't have any group created just one main user, haven't changed anything else. I'm afraid to create a new one cause I already have some apps installed that have a group assigned to them, so I don't want to mess up permissions all over again.

First, I don't really know linux, I may be aware of some of this stuff, but I do NOT know it!
But just to mention if interested - since you mentioned new users, MX-User-Manager is fairly self explanatory.

Personally, I'm still curious about this:

Code: Select all

# Pluggable devices are handled by uDev, they are not in fstab
but maybe it's irrelevant.
Good luck.

User avatar
pbear
Posts: 311
Joined: Tue Aug 09, 2022 9:24 pm

Re: How do I set up permissions for a new hdd partition?

#13 Post by pbear »

spring.snow wrote: Mon Jul 31, 2023 3:08 am One thing: not quite sure what I should be adding for the group name, I don't have any group created just one main user, haven't changed anything else.
The installer automatically creates a group = username of the user created during installation. The wildcard version of the command (sudo chown -R $USER:$USER /mount/point/partition), suggested earlier and which I use also, takes care of this automatically. That is, $USER is translated to your name and group, avoiding typos and works no matter which username you chose for a particular system.
@pbear I have MX installed on a small SSD, the external partition is just mostly for storage, portable if need be.
Got it, I misunderstood the first post.

Speaking of the first post, you mentioned the issue of partitions being mounted with a bunch of seemingly random numbers. They're not random. They're the UUID of the partition's file system. What most people do, and what I recommend, is that you label the file systems. The labels will be used automatically for mounting, which makes everything easier to follow. You can label partitions with Command Line, GParted or Gnome Disks.

User avatar
DukeComposed
Posts: 1499
Joined: Thu Mar 16, 2023 1:57 pm

Re: How do I set up permissions for a new hdd partition?

#14 Post by DukeComposed »

pbear wrote: Mon Jul 31, 2023 11:46 am
spring.snow wrote: Mon Jul 31, 2023 3:08 am One thing: not quite sure what I should be adding for the group name, I don't have any group created just one main user, haven't changed anything else.
The installer automatically creates a group = username of the user created during installation. The wildcard version of the command (sudo chown -R $USER:$USER /mount/point/partition), suggested earlier and which I use also, takes care of this automatically.
A word of warning, username = groupname isn't always guaranteed on every system, so don't assume this will work everywhere. The commands "whoami" and "id" can be useful here to determine what the current user is and then determine to which group (or groups) that user belongs.

Running "man whoami" and "man id" will give more information, explanation of what arguments to use, and examples. This also works for "mount" and "mkdir" and every other command you may come across. "man something" will open the manual page for the command "something", which can be handy to have in a separate terminal window for reference while typing the commands in another.

User avatar
pbear
Posts: 311
Joined: Tue Aug 09, 2022 9:24 pm

Re: How do I set up permissions for a new hdd partition?

#15 Post by pbear »

I've yet to meet a Linux installer which doesn't do what I said. In any event, the MX installer automatically creates a group = username of the user created during installation.

spring.snow
Posts: 24
Joined: Tue May 03, 2022 5:47 pm

Re: How do I set up permissions for a new hdd partition?  [Solved]

#16 Post by spring.snow »

I believe it would be fair to post a solution and mark this as solved. Similar to what was suggested on the previous page, I found a decent working solution using bash:

Code: Select all


#Navigate to the folder where mounting points are (media/user)
cd /media/username
sudo mkdir <directory_name>
blkid -> check the corresponding partition name (/dev/sde1 example) 
sudo mount /dev/sde1 /media/username/<directory_name>  [created previously]
#Now this is not usable yet as you do not have permissions to edit within this folder
sudo chown E (directory name as an example, replace with whichever you created previously)
#There is one more thing you have to consider here, this won't give permissions to subsequent folders, adding -R to the arguments solves this
sudo chown -R E
#This makes the argument recursive so it should work now

I don't know if this is the optimal way of doing it, nor can I explain some of the things on the first page (like the dilemma with the option to mount removable media automatically, in this case even for internal partitions). But maybe this can be useful to someone looking for a solution.

Post Reply

Return to “MX Help”