Profile picture for Admin

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]

script
        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:
https://help.ubuntu.com/community/Fstab

Information about init sciprts:
http://upstart.ubuntu.com/getting-started.html

Add new comment

The content of this field is kept private and will not be shown publicly.
  • No HTML tags allowed.
 o--o   o-o    o-o   o   o      o 
| | | o | | |
o-o o-o o--O | | |
| | / | | \ o
o-o o--o o o-o o-o

Enter the code depicted in ASCII art style.