One-time Mounting a SMB/CIFS Share in Ubuntu
Ensure that the cifs-utils package is installed. Run the following commands in your terminal:
$ sudo apt-get update
$ sudo apt-get install cifs-utils
Use the following command to mount the share:
$ sudo mount -t cifs -o username=<username>,dir_mode=0755,file_mode=0644,uid=$(id -u),gid=$(id -g),vers=3,cache=none <mount_path> <mount_point>
Where you need to:
-
Replace <username> with your username.
-
Replace <mount_path> with the network share path you want to mount.
Example: /engnas.bu.edu/research
-
Replace <mount_point> with the full path of your local mount point.
Example: /home/<username>/my_mount_point
-
Ensure the <mount_point> directory exists or create it using:
$ mkdir -p <mount_point>
Explanation of options:
username=<username>: Username for authentication.
dir_mode=0755: Sets permissions for directories in the mount.
file_mode=0644: Sets permissions for files in the mount.
uid=$(id -u), gid=$(id -g): Mount files owned by the current user and group.
vers=3: Use SMB protocol version 3 (adjust if your server requires a different version).
cache=none: Disable caching to ensure files are always up-to-date.
FAQs:
Q: Why use dir_mode=0755 and file_mode=0644?
0755 for directories means the owner can read/write/execute and others can read/execute, which is a common permission set for folders. 0644 for files means the owner can read/write and others can only read, which is typically more secure than 0777.
Q: Why use cache=none?
cache=none disables client-side caching, so you always see the latest versions of files, which is important for shared directories. This can slow down access. If you want faster access and can tolerate occasional stale data, you can use cache=loose or cache=strict, but be aware this might lead to synchronization issues.
Additional resources:
AD-joined Linux Systems
Once your machine is joined to AD, you should add the mountpoints that you use frequently to your /etc/fstab file so that they will mount automatically on bootup. At the very least, ENG users should run:
$ mkdir -p /ad/eng/users
$ mkdir -p /ad/eng/support
$ mkdir -p /ad/eng/research
or all on one line
$ mkdir -p /ad/eng/{linux,research,courses,projects,users}
and then add the following lines to your /etc/fstab exactly as shown. Note that these lines may have line-wrapped on your screen to two or more lines, but make sure that each is truly only one line when you enter it into your fstab :
engnas.bu.edu:/Users /ad/eng/users nfs \
vers=3,tcp,soft,sec=sys,rsize=8192,wsize=8192,noatime 0 0
engnas.bu.edu:/Courses /ad/eng/courses nfs \
vers=3,tcp,soft,sec=sys,rsize=8192,wsize=8192,noatime 0 0
engnas.bu.edu:/Projects /ad/eng/projects nfs \
vers=3,tcp,soft,sec=sys,rsize=8192,wsize=8192,noatime 0 0
engnas.bu.edu:/Research /ad/eng/research nfs \
vers=3,tcp,soft,sec=sys,rsize=8192,wsize=8192,noatime 0 0
engnas.bu.edu:/eng_linux /ad/eng/linux nfs \
vers=3,tcp,soft,sec=sys,rsize=8192,wsize=8192,noatime 0 0
Quota Limits on Network Drives
If you find that ENG GRID jobs that write large amounts of data, such as Cadence simulations, are failing inexplicably, check if you’re out of space in your home directory. Note that the X: (/ad/eng/uses/u/s/username) drive has a hard quota limit of 10GB per user and cannot be updated. If your lab has a research share (/ad/eng/research), it is recommended that you put large amounts of data here instead.
Note that large amounts of data are often included beneath dotfile directories (those that start with a ‘.’) which may just be full of unneeded temporary data. For example, COMSOL stores a lot of state data in .comsol. You can speedup computations and reduce crashes by moving the recovery and workspace directories.
On Linux systems with the AD drives mounted, such as on lab machines or on eng-grid, you can check your quota usage by running “quota -s“. On Windows, you should right-click on the top-level of your home directory and choose “properties”, and your drive usage will be calculated (this may take a while as it counts up).