Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added chmod command for /srv/data directory; placed important commands in their own tabbed line.

...

Here, the directory /srv/data contains the actual raw data files. Its permissions are rwxr-xr-x, and it is owned by root. Here, all users have read and execute access. But, but only root can write and modify files. These permissions can be set with:

chmod -R a+rx /srv/data/


However, you still want to allow non-root users to upload their data for later inclusion in /srv/data. This is the purpose of /srv/tmp. This directory acts as a volatile "holding space" for all users to have write access. Once a user uploads data to the temporary directory, the system administrator may move the data into the correct location in /srv/data. This directory is still owned by root, but its permissions are rwxrwxrwt, meaning that all users may read, write, and execute all files. For an extra safeguard, set the sticky bit for this directory, so that only file and directory owners can delete or rename their data. This can be done with the command:

chmod -R a+trwx /srv/tmp

Note that these . These are actually the same permissions set for the system's /tmp directory.

...

Then, make a symbolic link inside your data directory using with:

sudo ln -s /mnt/short_drive_name/data_dir /srv/data/ext_dataset_name

. Make sure the link itself is owned by root.

...

As for the actual mount configuration, I prefer the following style added in /etc/fstab:

UUID=partition_uuid /mnt/ext/short_drive_name filesystem_format umask=022,async,auto,rw,nofail 0 0

where partition_uuid is your storage device's UUID and filesystem_format is the format of your device (ntfs, ext4, etc.). To locate your device's UUID, try the blkid command. If that is not available, then the information given by the commands lsblk and ls -l /dev/disk/by-uuid should be enough to discover your UUID. This will only allow root to write to the disk, but other users may read from it.

...