Create Mount Project Drive in TU Delft VPS authored by Ashley Cryan's avatar Ashley Cryan
Project drive storage from TU Delft ICT can be mounted and made accessible in your (TU Delft) Virtual Private Server. Follow the instructions below:
1. Connect to your TU Delft VPS via SSH (follow instructions in TU Delft ICT email from initial server setup or configure 1-step connection via SSH [here](https://gitlab.tudelft.nl/acryan/data-management-for-researchers/-/wikis/Configure-VPS-connection-via-SSH))
2. Create a new directory in /media where you will mount the project drive into. Use `cd /media` to enter the media directory, and `mkdir <yourprojectname>` to create a new directory where the TU Delft project drive will be mounted.
3. Find your user ID (uid) and group ID (gid). Open /etc/passwd by typing `sudo vi /etc/passwd` and scroll down until you see your netid. It will be followed by an :x: and some numbers separated by ':'. The first number is your uid, the second number is your gid. Copy and paste or record these numbers for use in a later step. Exit the vi editor by Control+C, then `:qa` and Enter.
4. Open the fstab file (where you can list the addresses of external file systems you want to mount) which is also in the /etc directory by typing `sudo vi fstab`
5. Locate the URL of your project storage. This can be found either in the email from TU Delft ICT confirming project drive storage setup, or by going to https://webdata.tudelft.nl/, and then WebDav Web Links > Staff-Umbrella > Enter your netID and password > "Your Project Name". Copy everything after "https://webdata.tudelft.nl/" (this will be staff-umbrella/yourprojectname)
6. On a new line in your fstab file (hit "i" to switch to insert mode and be able to type), write `//tudelft.net/` and paste the latter half of the URL you copied from the WebDav links. The full URL should be in this format: //tudelft.net/staff-umbrella/yourprojectname
7. On the same line, add a space followed by the location in your VPS where you want to mount the Project Drive storage (where you created the folder previously) to the same line. `/media/yourprojectname`
8. Add a space followed by the type of file system: `cifs`
9. Add a space followed by `username=<yournetid>`
10. Add a comma followed by `noauto`
11. Add a comma followed by `uid=<your_uid>,gid=<your_gid>` Make sure to replace <your_uid> and <your_gid> with the numbers you recorded in step 3.
12. Add the following configuration settings and permissions to the end of the line: `forcegid,rw,_netdev`
The full new line should be formatted like this: file system address, mount location, type of file system, options/permissions for mounting.
Example: `//tudelft.net/staff-umbrella/myprojectname /media/my_project_name cifs username=mnetid,noauto,uid=12345,gid=1234,forcegid,rw,_netdev`
13. Use Control+C followed by :wq to save the file and close it to get back to your terminal.
The project drive will not mount automatically, so you will need to mount it manually each time you start the server. To do so, from the home (`/`) directory in your server run `sudo mount /media/yourprojectname`. You should now be able to `cd /media/projectname` and view your files stored on the project drive using `ls`.
The steps above can also be used to mount any storage offered by TU Delft with a WebDav link (staff-homes, staff-groups, staff-bulk, student-homes, student-groups and apps). Simply use the latter half of the URL from the WebDav web link of your storage drive (step 5), which will change from staff-umbrella (project drive) to something else depending on the storage drive you would like to mount.