(Solved) Would like to mount partition without root login privileges  [Solved]

Message
Author
beersloth
Posts: 47
Joined: Thu Feb 18, 2021 11:13 pm

(Solved) Would like to mount partition without root login privileges  [Solved]

#1 Post by beersloth »

Hello,

Latest MX KDE fully updated.

I have a separate data partition that I access many times a day after rebooting my laptop for work. I really do not want to have to login to elevate privileges (I think that is what is going on) to be able to mount that partition.If it matters, I have the OS set to automatically log me in as the user so the only actual logging in I ever have to do is this process to access my work data partition.

What is the easiest way to no longer have to go through the login process to mount that partition ?

Thank you
Last edited by beersloth on Tue Jul 13, 2021 11:53 am, edited 1 time in total.

Huckleberry Finn

Re: Would like to mount partition without root login privileges

#2 Post by Huckleberry Finn »

"MX Tweak" from Menu, "Other" tab: "Enable mounting of ... non-root ... "

If still not: Mount it (simply click to enter in File Manager) then in a terminal:

sudo chown -R yourusername:yourusername /media/yourusername/*

beersloth
Posts: 47
Joined: Thu Feb 18, 2021 11:13 pm

Re: Would like to mount partition without root login privileges

#3 Post by beersloth »

You are a gentleman and a scholar. the Mx tweak worked.

Huckleberry Finn

Re: (Solved) Would like to mount partition without root login privileges

#4 Post by Huckleberry Finn »

Thank you so much. You make me shy :biggrin:

User avatar
figueroa
Posts: 1097
Joined: Thu Dec 20, 2018 11:20 pm

Re: (Solved) Would like to mount partition without root login privileges

#5 Post by figueroa »

You can add a partition to /etc/fstab so that it automatically mounts at boot:

Code: Select all

/dev/sda6       /mnt/sda6       ext4    user,auto,noatime     0 2
Adjust to meet your particulars and desired mountpoint naming.

If using the kernel partition naming scheme (/dev/sda6) doesn't work reliably for you (it usually works fine), you can use UUID= in it's place. It's used as follows:

Code: Select all

code]UUID=5958fd45-723e-4d6b-9253-e74dada52d45       /mnt/sda6       ext4    user,auto,noatime     0 2
[/code]
You can find the UUID by looking in /dev/disks/by-uuid with:

Code: Select all

ls -l /dev/disk/by-uuid
This will show you the UUID to kernel naming partition symlinks. UUIDs are permanent until forced to be changed as happens when reformatting a partition.

It's a good idea to put your mountpoints in /mnt because that's where they are supposed to be by convention. Good ones are mnemonic like: /mnt/data, /mnt/data1, /mnt/storage, /mnt/backup and so on.

Added: The "auto" setting is part of the default set, but adding it anyway to the list of options is like laying down breadcrumbs (audit trail) showing that you are doing that on purpose. The inverse "noauto" prevents the partition from being mounted automatically. The "user" setting lets an ordinary user mount it.
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

Post Reply

Return to “Software / Configuration”