Archive: Mount the storage drive on Ubuntu

Instructions for mounting your storage drive on Ubuntu

 Please see this new message regarding the decommissioning of the storage service.

Rice University has implemented an enterprise-class storage system for your documents. Undergraduates are allocated 2GB of storage quota on this new system.

Two methods exist to mount this storage drive under Ubuntu.

The first method will mount the drive only as needed and must be run each time the user wants to connect to their storage drive. The second method will automatically mount the drive each time the computer is turned on.

Both methods require that you run the initial set of steps.

Disclaimer: These steps are all given under the assumption that you as the user are not fluent with Linux. If that is not the case, feel free to modify the commands to suit your specific needs.

Step 1: Ensure your computer has the software required

Mounting the storage drive requires Ubuntu to communicate with the Rice server. The name of the protocol which Linux uses to do this is called "cifs," the "Common Internet File System."

To install the necessary software, run the following command. It will ask you to enter your password, do so to continue.

Command Note
sudo apt-get install cifs-utils

Install CIFS

Step 2: Create the Credentials File

In order to mount the drive, your computer needs to be able to authenticate against the Rice server. We will create a file with your user name and password to do this.

This step requires you to store your Rice NET ID and Password in an unencrypted text file on your hard drive.

Although only users with root access will be able to read the file, please understand the security risks before proceeding.

Start off by creating a text file to store the user name and password into. For simplicity's sake, we will be using the program nano to do this, however, you may also use gedit, vim, emacs, or any other text editing software to accomplish this.

Run the following command to create a text file called "rice_cred" in the "etc" folder on your hard drive:

Creating rice_cred table
sudo nano /etc/rice_cred

Create Cred File

Once that is open, enter the following into the file, replacing "NETID" with your NET ID, and "PASSWORD" with your NET ID password:



Save Cred File

If you are using nano, press "CTRL + O", and then hit "ENTER" to save the file.

Once you have done that, press "CTRL + X" to close nano.

Step 3: Modify the Permissions

In order to keep the file more secure, we will be changing the permissions so that only the root user can read it.

Run the following command. This will modify the permissions of the file so that only the root user can read it.

Modify Permissions Table
sudo chmod 600 /etc/rice_cred

Mod Cred File

Afterward, verify that the change worked by running the following command. The output should look like the given output.

ls -l /etc/rice_cred

-rw------- 1 root root 38 Oct 29 14:53 /etc/rice_cred

Verify Cred File

Step 4: Create the Mount Point

Linux mounts all connected devices on folders called "mount points." We need to create a mount point where the storage drive can be connected.

To create the mount point, run the following command. This will create the folder "u-drive" in the "media" folder.

Create the Mount Point Table
sudo mkdir /media/u-drive

Make Folder

Note: All of the steps up to this point have been required for both methods. However, at this point, you can choose which method you prefer for mounting your drive.

Manual Method

Mounting the Drive

To mount the storage drive manually, run the following command.

Note that you will need to replace USERNAME with your computer username, NETID with your NET ID, and N with the first letter of your NET ID.

Mounting the Drive Table

mount -t cifs -o credentials=/etc/rice_cred,rw,uid=USERNAME,gid=1000 //storage/N-home/NETID  /media/u-drive

Run Mount Command

After running the command, the storage drive should show up in your file manager.

See Mounted Drive


Unmounting the Drive

After you use the drive, it is important to unmount it.

To do so, run the following command.

Unmounting the Drive Table
sudo umount /media/u-drive

Unmount Drive

Afterward, the drive should disappear from your file manager

See Unmounted Drive

Automatic Method

By adding the storage drive to your fstab, the drive will automatically be mounted whenever you boot the computer.

To edit your fstab, run the following command

Automatic Method Table
sudo nano /etc/fstab

Edit FSTab

Then, add the following line to the end of your fstab file, substituting the first letter of your NET ID for N, your NET ID for NETID, and your computer user name for USERNAME.

//storage/n-home/NETID /media/u-drive cifs uid=USERNAME,credentials=/etc/rice_cred,rw 0 0
Screenshot of edited FSTab

Once again, press "CTRL + O" and then "ENTER" to save the file, and then enter "CTRL + X" to close nano.

Once that's done, either reboot your computer or enter the following to mount the drive.

Mount Drive Table
sudo mount -a

Run Mount

Once that's complete, you should see the storage drive in your file manager

After Mounted


Keywords:Debian, Raspberry Pi, Ubuntu, personal, home, U drive, storage drive, mount   Doc ID:71201
Owner:DeletedDoc U.Group:Rice University
Created:2017-03-01 15:52 CDTUpdated:2023-05-03 05:57 CDT
Sites:Rice University
Feedback:  1   0