Setting up a shared media drive

Solution 1:

The correct mount point is /mnt/mynewdrive; plugdev is not correct; on permissions, why not use access control lists (ACL)?

Are the ACL tools installed by default? Can't remember, but, cannot hurt to...

sudo apt-get install acl

Mount the file systems with the acl option in /etc/fstab.

sudo vim /etc/fstab

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / ext4 defaults,acl 0 1

sudo mount -o remount,acl /

Then make a group to which a user may belong for this purpose, which I'll call stone, and then make a user a member of that group.

sudo groupadd stone
sudo usermod -a -G stone $username

The user needs to log out and in again to become a member of the group. If the directory, /mnt/mynewdrive, is mounted and completely empty:

sudo chown root.stone /mnt/mynewdrive
sudo chmod 0775 /mnt/mynewdrive
sudo chmod g+s  /mnt/mynewdrive
sudo chmod +t   /mnt/mynewdrive
sudo setfacl -d -m u::rwx,g::rwx,o::r-x /mnt/mynewdrive

Above...

  • Change owner to root and group owner to stone
  • Give write ability to the stone group
  • Cause all new files to be group-owned by stone
  • Restrict delete and rename to all but the user who created the file
  • By default, allow user and group rwx, others: rx.