There are couple of users created on one PC for different tasks. The is second ssd connected to PC and two users need the access to it. File system is ext4. The problem is to automate the mount and access somehow.

First, you should create a folder, where second drive will be mounted. For example,

$ mkdir /media/share/

Check the ID of device with command

$ sudo blkid

Add the next line to the /etc/fstab file for automatic mounting

$ sudo nano /etc/fstab

UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX       /media/share     ext4    auto,user,rw    0       0

Let's make mounted drive accessable for all users. Lines below should be added to system autostart:

$ nano /etc/init/share.conf

# Share mount user permissions

description     "Share mount user permissions"
author          "Username"

start on ((filesystem
           and runlevel [!06]
           and started dbus
           and plymouth-ready)
          or runlevel PREVLEVEL=S)

stop on runlevel [016]

        chmod -R a+rwx /media/share/
end script

But one problem is still there - access to newly created folders without reboot. The script should be executed on user switch or login.

More information about mounting images:

Information about init sciprts:

Add new comment

The content of this field is kept private and will not be shown publicly.
  • No HTML tags allowed.
               oooooooo  ooo        ooooo  oooo               ooo        ooooo 
dP""""""" `88. .888' `888 `88. .888'
.oooooooo d88888b. 888b d'888 888 .ooooo oo 888b d'888
888' `88b `Y88b 8 Y88. .P 888 888 d88' `888 8 Y88. .P 888
888 888 ]88 8 `888' 888 888 888 888 8 `888' 888
`88bod8P' o. .88P 8 Y 888 888 888 888 8 Y 888
`8oooooo. `8bd88P' o8o o888o o888o `V8bod888 o8o o888o
d" YD 888.
"Y88888P' 8P'
Enter the code depicted in ASCII art style.