How to create DATA partition symlinks for standard user?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
woverst53
Level 1
Level 1
Posts: 7
Joined: Sun Jul 07, 2019 7:05 pm

How to create DATA partition symlinks for standard user?

Post by woverst53 » Fri Aug 23, 2019 7:40 pm

I just installed Linux Mint 64-bit v19.2 with a separate DATA partition. My goal is to keep personal files on the DATA partition...for ALL users. For my Admin account, I successfully followed the steps in https://community.linuxmint.com/tutorial/view/1609 to set up symlinks for Documents Downloads Music Pictures & Videos. Now for my wife's account who is a standard user on this same computer.

What similar steps should I use for my wife's account to set up similar symlinks from the DATA partition to her /home directory folders? I tried the same steps but it says
...user wife is not allowed to execute '/bin/mount /dev/sda4 /Mnt/DATA' as root
.

Thanks in advance for your help.

User avatar
Sir Charles
Level 7
Level 7
Posts: 1897
Joined: Thu Jan 04, 2018 1:00 pm

Re: How to create DATA partition symlinks for standard user?

Post by Sir Charles » Fri Aug 23, 2019 8:00 pm

woverst53 wrote:
Fri Aug 23, 2019 7:40 pm
What similar steps should I use for my wife's account to set up similar symlinks from the DATA partition to her /home directory folders? I tried the same steps but it says
...user wife is not allowed to execute '/bin/mount /dev/sda4 /Mnt/DATA' as root
.
Hi,

Could you please post the content of your fstab file by executing the following command in a terminal and copying/pasting the output in your reply?

Code: Select all

cat /etc/fstab
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

pbear
Level 7
Level 7
Posts: 1835
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: How to create DATA partition symlinks for standard user?

Post by pbear » Fri Aug 23, 2019 10:47 pm

I use a data partition, albeit on a single user system. Try this. Log in as yourself and run sudo ln -s /mnt/DATA/Documents /home/<wife>. Log out, then back in on her account to see whether the link works. If so, switch back to your account and repeat for the other folders.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

woverst53
Level 1
Level 1
Posts: 7
Joined: Sun Jul 07, 2019 7:05 pm

Re: How to create DATA partition symlinks for standard user?

Post by woverst53 » Fri Aug 23, 2019 11:23 pm

sheryl@bill-Dec09-Computer:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=1907f070-1bd1-4c77-8eac-4cb816687c44 / ext4 errors=remount-ro 0 1
# /Mnt was on /dev/sda4 during installation
UUID=6ca3aaea-bc8f-4f8e-997a-f1fa543bf73b /Mnt ext4 defaults 0 2
# swap was on /dev/sda2 during installation
UUID=3e8bc1c4-dcd2-418a-a70e-5a5cb26f6b0c none swap sw 0 0
# Mount DATA partition under /Mnt/DATA
UUID=6ca3aaea-bc8f-4f8e-997a-f1fa543bf73b /Mnt/DATA ext4 defaults 0 2


sheryl@bill-Dec09-Computer:~$

User avatar
Sir Charles
Level 7
Level 7
Posts: 1897
Joined: Thu Jan 04, 2018 1:00 pm

Re: How to create DATA partition symlinks for standard user?

Post by Sir Charles » Fri Aug 23, 2019 11:32 pm

woverst53 wrote:
Fri Aug 23, 2019 11:23 pm
UUID=6ca3aaea-bc8f-4f8e-997a-f1fa543bf73b /Mnt/DATA ext4 defaults 0 2
Hi,
You could edit the above line in the fstab to read as follows (copy/paste):

Code: Select all

UUID=6ca3aaea-bc8f-4f8e-997a-f1fa543bf73b  /Mnt/DATA     ext4     defaults,user    0     2
Please note that there is no space between defaults,,and user.

This should permit the partition to be mounted by any user on the system. Done editing and saving the file, run:

Code: Select all

sudo mount -a

OBS!
In case of any error messages, pleas do not reboot. Post the error messages back here for forum members to have a look.

If everything is fine, log out from your own account and log in to the account of your wife and try making the symlinks to to the folders in yor DATA partitions.

Hope this helps!
For further info, please refer to:
https://help.ubuntu.com/community/Fstab
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

altair4
Level 19
Level 19
Posts: 9692
Joined: Tue Feb 03, 2009 10:27 am

Re: How to create DATA partition symlinks for standard user?

Post by altair4 » Sat Aug 24, 2019 8:36 am

UUID=6ca3aaea-bc8f-4f8e-997a-f1fa543bf73b /Mnt ext4 defaults 0 2
# swap was on /dev/sda2 during installation
UUID=3e8bc1c4-dcd2-418a-a70e-5a5cb26f6b0c none swap sw 0 0
# Mount DATA partition under /Mnt/DATA
UUID=6ca3aaea-bc8f-4f8e-997a-f1fa543bf73b /Mnt/DATA ext4 defaults 0 2
[1] Why are you mounting the partition twice?

[2] What are the permissions of the mounted partition(s):

Code: Select all

ls -al /Mnt
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

woverst53
Level 1
Level 1
Posts: 7
Joined: Sun Jul 07, 2019 7:05 pm

Re: How to create DATA partition symlinks for standard user?

Post by woverst53 » Sat Aug 24, 2019 11:11 am

Here are error messages after editing and saving /etc/fstab:

bill@bill-Dec09-Computer:~$ sudo gedit /etc/fstab
[sudo] password for bill:

** (gedit:6811): WARNING **: 09:43:16.405: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported

** (gedit:6811): WARNING **: 09:43:16.406: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

** (gedit:6811): WARNING **: 09:43:28.457: Set document metadata failed: Setting attribute metadata::gedit-position not supported
bill@bill-Dec09-Computer:~$ sudo mount -a
bill@bill-Dec09-Computer:~$

Here are the permissions of the mounted partition(s):

bill@bill-Dec09-Computer:~$ ls -al /Mnt
total 48
drwxr-xr-x 9 bill bill 4096 Aug 22 14:38 .
drwxr-xr-x 25 root root 4096 Aug 21 17:00 ..
drwxr-xr-x 9 bill bill 4096 Aug 22 14:38 DATA
drwxr-xr-x 2 bill bill 4096 Aug 24 09:54 Documents
drwxr-xr-x 2 bill bill 4096 Aug 22 14:38 Downloads
drwx------ 2 bill bill 16384 Aug 21 15:39 lost+found
drwxr-xr-x 2 bill bill 4096 Aug 22 14:38 Music
drwxr-xr-x 2 bill bill 4096 Aug 22 14:38 Pictures
drwxr-xr-x 2 bill bill 4096 Aug 22 14:38 Videos
bill@bill-Dec09-Computer:~$
Last edited by woverst53 on Mon Aug 26, 2019 3:34 pm, edited 1 time in total.

woverst53
Level 1
Level 1
Posts: 7
Joined: Sun Jul 07, 2019 7:05 pm

Re: How to create DATA partition symlinks for standard user?

Post by woverst53 » Sat Aug 24, 2019 1:40 pm

Why am I mounting the same partition twice in the /etc/fstab file?

The first was created during installation when I set up the separate data partition with label /Mnt.

The second was created as I performed the steps in this procedure https://community.linuxmint.com/tutorial/view/1609.

altair4
Level 19
Level 19
Posts: 9692
Joined: Tue Feb 03, 2009 10:27 am

Re: How to create DATA partition symlinks for standard user?

Post by altair4 » Sat Aug 24, 2019 2:57 pm

There's a lot going on here.
** (gedit:6811): WARNING **: 09:43:16.405: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported
I suspect you got this warning because you used sudo to invoke gedit. If you want to use sudo to invoke an application with a gui like gedit add a -H switch like this:

Code: Select all

sudo -H gedit /etc/fstab
when I logged out of my account, my wife's name was not shown on the login screen as an available user account!!
Um ... I have no idea about how that happened but I'd bet real money it had nothing to do with Sir Charles' suggestion of adding the user option to your fstab line.

All I can tell you is if you really just installed Mint (I just installed Linux Mint 64-bit v19.2 with a separate DATA partition. ) I would just start over again.

When you do have the installer mount this partition to /mnt/DATA to begin with - not /Mnt/DATA, or /Mnt, or /mnt - but /mnt/DATA.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

woverst53
Level 1
Level 1
Posts: 7
Joined: Sun Jul 07, 2019 7:05 pm

Re: How to create DATA partition symlinks for standard user?

Post by woverst53 » Sun Aug 25, 2019 12:27 pm

This is what I did next,,,that didn't work. When I downloaded a pdf file, it went into my /home folder, not into my /home/Downloads folder. And the folder permissions were screwed up.
  • I edited /etc/fstab to only mount the DATA partition once instead of twice.

    Code: Select all

    UUID=6ca3aaea-bc8f-4f8e-997a-f1fa543bf73b /Mnt/DATA            ext4    defaults,user        0       2
  • I changed my wife's account from a standard user to an administrator. (Before doing this, I would create a symlink and it always showed me as owner in folder permissions and not her.)
  • I logged in to my wife's account and took ownership of the mount point.

    Code: Select all

    sudo chown -R wife: /Mnt/DATA
  • I navigated to the data mount point.

    Code: Select all

     cd /mnt/DATA
  • I created typical home folders in /Mnt/DATA.

    Code: Select all

    mkdir Documents Downloads Music Pictures Videos
  • I saved existing files from her /home directory folders and then deleted her /home folders (Documents Downloads Music Pictures Videos) because you can't create a symlink when the /home folder already exists.
  • I then created each symlink as follows:

    Code: Select all

    sudo -u wife ln -s /Mnt/DATA/Documents /home/wife/Documents
To confirm, I checked my wife's symlink folder permissions (in her /home directory) and each one showed her as the owner. I also selected each folder, then right mouse click and selected 'Follow link to original file' and each one showed a path back to the /Mnt/DATA partition.

Post Reply

Return to “Newbie Questions”