0

Usually I have lots of files and applications opened just for one project, and I am working on more projects simultaneously, and if I want to switch from one project to another, than I have to close lots of files, and I have to open another lots of files every time, that’s why I organized my projects on users, every user is a project and I save sessions on logout, this way the files should reopen on login, but the problem is that the hard disks are mounted in different locations for each user like media/user1, media/user2/, … and when I switch users the disks are not found.

The question is: How can I make, that in all users the disks to mount in a same point?

1

Sudodus' answer is perfect if you have multiple partitions.

If you have one partition for all the projects, then you need symlinks.
A symlink is a file that points the system to a folder somewhere else.
This causes the system to behave as if the folder was actually in the location of the link.

First create an automatic mount for the partition as sudodus described.
Then make a symlink from each project folder to the appropriate user's home directory.

ln -s /mnt/partition/folder ~/

The partition will need to be writable by everyone, but the individual project folders can be limited to the appropriate user.

| improve this answer | |
0

Automatic mount via a line in /etc/fstab

Create mountpoints, for example

sudo mkdir /mnt/project-name-x
sudo mkdir /mnt/project-name-y
...

You can replace 'project-name-x' ... with names that help you know what it is.

Mount each partition automatically in the installed system via a line in the file /etc/fstab. Edit it with

sudo nano /etc/fstab

Example line for a partition with ext4 file system,

UUID=d3f3f4a3-3d6e-4e4f-8e1a-de30de792f90 /mnt/project-name-x ext4  defaults  0  2

You must

  • find the UUID of the partition and use it in /etc/fstab. See the output of

    sudo blkid
    

    and use it (without quotes),

  • replace /mnt/project-name-x with the actual mount point,

  • if another file system, replace ext4 with the linux name of that file system.

Otherwise the line can look like the example line. See more details in the manual

man fstab

and this link, help.ubuntu.com/community/Fstab


If a partition has the NTFS (or FAT32) file system, you may want to add mount options to give the regular user write access, as described at the following link,

How do I use 'chmod' on an NTFS (or FAT32) partition?

The mount options (after -o in the link's examples) can be added as a comma separated list after defaults, like so

...  ntfs-3g  defaults,rw,user,uid=1000,dmask=007,fmask=117  0  2

Modify the uid to match the actual user(s) and the masks that you prefer.


The new configuration with be used after reboot (or shutdown and boot).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.